Week 10

Networking

Introduction:

This week we were tasked with building something that could communicate over some network.

Workflow

Plan: Experiment with Wi-Fi modules.

Design

In my final project, I'm building a living flowerpot. What better way to have a living flowerpot than have one that can speak to the world. I decided it would be a cool feature for the pot to tweet things. Maybe based on what its listening to, or maybe weekly reminders to water my plants.

For this week, I wanted to build off of the sample ESP8266 board and code on the CBA site. I decided to add a button, to simulate some input that would control something over the web server.

I drew up his schematic in Eagle. It was entirely based on the sample schematic. The routing is pristine on that one!

I looked into the ESP8266 datasheet to see whether my button needed an external pull up resistor, and where I could route it to.

With no external resistors needed, I could add a button fairly easily to GPIO9. I looked through the datasheet to see how to interface with it.

Cutting & Soldering

Finally, a straightforward cut! I think this was my first time everything worked without any devastating issues. Yay!

Soldering was also easy. There weren't too many components, so I put it all together fairly easily.

Testing

I was really helped by Matt Groh's documentation, and this tutorial to get started.

I couldn't try the Serial-ESP connection, as I read the tutorial after soldering everything together. So I started directly with the miniterm.py procedure Matt described.

I experimented with sending a few commands. I did not want to mess around with Harvard Wi-Fi at all, with my previous attempts at working with that network. I actually went to MIT to try running the exact same commands as Matt did, and things seemed to work!

Then I looked at the webserver code that was mentioned in Matt's links, and uploaded that to my ESP. Viola! Something I could mess around with.

I went inside the process_command code and added a snippet of my own.

Unfortunately I couldn't test this too much, due to time constraints. It wasn't working the first few times, but I think that was because I wasn't defining the input pins properly.

What to do next

  • Get this to interface with Twitter.
  • Actually test my button code.