Software apps and online services
This post is all about using the elecrow Crowtail Serial Wifi connector as a WiFi peripheral to get the MSP430 connected to the internet in a cheap and easy fashion! The eight dollar Crowtail uses the ESP8266 WiFi module to communicate with the twelve dollar MSP4305529 LaunchPad through AT commands over UART. A list of the AT commands can be found here.
In order to keep the connections neat, the LaunchPad was interfaced with the Grove Base booster pack which is available in the Seeed for LaunchPad Starter Kit. This is not necessary for interfacing the Crowtail to the MSP430. The temperature and humidity sensor from the Seeed kit is also used in order to provide data for the LaunchPad to publish.
LaunchPad as a web server:
The ESP8266 is capable of acting as a WiFi access point. Through AT commands, The LaunchPad can be configured to accept TCP connections and then write data. In the code below, crowtailCode, if the user presses PUSH1 on the MSP4305529 LaunchPad, the LaunchPad will enter server mode. There will then be an open WiFi network with a name of "AI_THINKER _XXXX". The IP address where the LaunchPad is publishing data is in the serial monitor in response to the command AT+CIFSR, in this case 192.168.4.1. If the user opens a web browser and navigates to this address, the ESP8266 will accept a connection and then send data through a TCP connection. The data can be controlled in code, in this case it is publishing the temperature and humidity. The example page being published is a simple text page with code to refresh every five seconds. Any HTML code could be printed over serial to the device and then accessed. An example of the webpage hosting results can be seen below:
LaunchPad as a Client:
The ESP8266 can also be used to connect the LaunchPad to a web service as a client. If the user presses PUSH2 with the code below, the LaunchPad will connect to Thing Speak as a client and, through an API, publish the temperature and humidity data to the website. This data can then be monitored from any web connection. In order to configure this to work with Thing Speak, a free API key must be acquired and the SSID and WiFi password must be changed in code. An example of the Thing Speak data monitoring is shown below.
This device itself could be used as a cheap and easy weather monitoring station! The results could be accessed over web interface or even published to a smart watch so the user could know the temp and humidity for their house or for their exact location.
The ESP8266 interface also opens the door for many other IoT applications. It provides both an ability to host connections and connect to other services and is an extremely low cost option. It pairs very well with a low power, low cost LaunchPad to enable anyone to develop for an increasingly Internet of Things focused world!