Wiflash
Wiflash
Team Members
- Adhithya Rajasekaran
- Vikram Jain
- Ernesto Trotman
- Nicholas Wang
Project Idea
Remotely program an Mbed using either Ethernet or Wifi.
Parts Required
We used the following parts
- 1 X RJ-45 Ethernet Jack or 1 X ESP-8266 Wifi Module
- 1 X Mbed
- Web Server
Wiring
We connected our Mbed to the internet using an RJ-45 jack. We were unable to get Wifi working with either GTWifi or GTOther.
RJ45 | Mbed |
---|---|
P1 | TD+ |
P2 | TD- |
P7 | RD+ |
P8 | TD- |
Project Details
Our project is composed of four subsystems
- Wiflash Desktop App (Wiflash Programmer)
- Wiflash Cloud
- Wiflash Library for Developers
- ESP8266 Library for Developers
Wiflash Desktop App
The Wiflash Desktop App is a native cross platform application that allows developers to program an Mbed remotely. A fully native desktop app needed for two reasons
- User Registration and Mbed Registration
- Programming the Mbed
User Registration/Mbed Registration
The Wiflash Cloud needs to know the serial number of the Mbed to establish a connection and push the code to that specific Mbed. So we needed some way of talking to the Mbed locally and getting its serial number. This functionality is implemented using the desktop application.
Mbed Registration Program
In order to register your Mbed, we need to find the unique serial number assigned to each Mbed. In order to access the Mbed's serial number, you need to download and load the following program into your Mbed.
Import programidentifier
Serial number identifier program for Mbed
This program opens up a serial port on the computer and waits for commands from the desktop app. The desktop app has a button for device registration. If the user clicks on that, the app will start probing all the available serial ports and check if a Mbed is connected to the computer. Once it finds the Mbed, it will send probe messages requesting the Mbed to send back its serial number.
Since the connection between the Wiflash Cloud and the Mbed needs to be secure and unique, we force each Mbed to be registered to a user. The desktop application handles all the user authentication for the system.
Programming Mbed
We don't have access to the Mbed online compiler. So we cannot download the .bin files directly from the online compiler.
Instead, we ask the user to compile the .bin file from the online compiler. Then the user can drag and drop the .bin file into the desktop app and .bin file will be uploaded to the server. Here is a look at our desktop app's programming interface
The native desktop app is written using HTML, CSS, Node.js and C++ glue code for serial communication.
Wiflash Cloud
Once the program is dropped into the Wiflash Desktop App, the program is uploaded to the Wiflash Cloud servers. The server is written using the Ruby on Rails framework and runs on DigitalOcean. Once the server receives the program, it will forward the file to the Amazon S3 Cloud Storage server. The Amazon S3 server is connected to a Amazon Cloudfront CDN distribution which will allow for a fast streaming download of files from the Wiflash cloud.
Wiflash Library
Once the compiled .bin file is in the cloud, we need to send the program to the Mbed. This would require networking elements on the Mbed to be turned on and the Mbed also needs to be continuously checking in with the server to let the server know about the status of the Mbed and to check if a new program is available to download. Once it detects that a new program is available for download, there must be some code on the Mbed to actually download the binary file and reset the Mbed. All of this functionality is handled by the Wiflash library. You can find more information about the library at
Import librarywiflash2
Updated Wiflash
Note: The Wiflash library doesn't have any error checking code or error handling. Bugs might still be present in the code. If you run into any issues, please email arajasekaran7 at gatech dot edu.
Mbed Preparation
To prepare you Mbed for remote programming, remove all the existing .bin files. from the Mbed. Then load the following demo program into the Mbed
Import programwiflashdemo
Demo program for Wiflash
Then reset the Mbed. As long as your Mbed is connected to the internet, your Mbed should now be remotely programmable.
Then open up the Wiflash Desktop App and drag and drop any program that includes the Wiflash library. An important note - All programs that you want to remotely program to an Mbed must include the Wiflash library and must setup the library. It will take approximately 20s for the Mbed to recognize that a new program has been uploaded and it will take another 20-30s for it to download and reset itself to run the new program.
ESP 8266
ESP8266 is a low cost Wifi module that we originally planned to use get the Mbed to connect to the internet. But due to restrictions of the GT network, we were unable to do that. But we made a draft library for the ESP8266 chip. You can find more information on the ESP8266 chip and the library at https://developer.mbed.org/users/adhithyan15/notebook/esp82661/
Demo Video
Please log in to post comments.