szhao 17 Posted June 30, 2014 Share Posted June 30, 2014 Programming a microcontroller for the first time can be a daunting task. What if you can remotely control your microcontroller by simply clicking few buttons on a PC GUI? With Energia support, I was able to port existing Firmata code used for Arduino onto LaunchPads. Firmata is a serial communication protocol that allows a host (PC) sending commands to the microcontrollers (MSP430). You can use it to toggle pins and LEDs, or read digital and analog inputs without writing any C code. This makes it super easy to test out your new sensor or debug your circuit. Bluetooth simply creates a virtual serial port that emulates a physical serial port wire, so you can control and monitor your board remotely. Here is a demo video: The application GUI is written in NodeJS. The browser is connected to the Node server using web socket. Whenever the user clicks a button, a message is sent to the server and the server will send Firmata commands to the LaunchPad. You can easily expand on top of the demo GUI I created by writing some javascript. Let's say you want to turn on an LED when the temperature is too high. You can let your Node server constantly check the temperature reading. Once it reaches the threshold, then set the LED pin to HIGH. You can find out the source code of my project at my GitHub page: https://github.com/shengzhao91/FirmataGUI zlalanne, sexton, pine and 3 others 6 Quote Link to post Share on other sites
HylianSavior 37 Posted June 30, 2014 Share Posted June 30, 2014 @@szhao looks neat! szhao 1 Quote Link to post Share on other sites
zlalanne 37 Posted July 3, 2014 Share Posted July 3, 2014 You say you use a websocket for communication between the backend and frontend part of the application. Have you thought about implementing the websocket protocol on the MSP430 itself with a CC3000? That way the firmata control can be done over wireless? Also there are some nodejs mechanisms for packaging up projects into a single binary for execution. Might be interesting to have this in a gui rather than running on a port. https://github.com/rogerwang/node-webkit https://github.com/atom/atom-shell Quote Link to post Share on other sites
szhao 17 Posted July 3, 2014 Author Share Posted July 3, 2014 @@zlalanne It would be really sweet to have CC3000 for our communication. But I am not exactly sure how to implement the websocket with MSP430. I found this link here and it seems like CC3000 does not support websocket. http://e2e.ti.com/support/wireless_connectivity/f/851/t/280655.aspx. I have been playing with Atom-Shell a bit. It is definitely a neat way to create a polished GUI. I will put out an update when this app is packaged. Thanks for the pointers. Quote Link to post Share on other sites
zlalanne 37 Posted July 3, 2014 Share Posted July 3, 2014 Since websocket is just TCP based at its core it should be supported by CC3000. I would start looking at porting an arduino library to energia, which would probably be easier than writing it from scratch. I haven't used atom-shell yet just node-webkit but it looks promising. https://github.com/brandenhall/Arduino-Websocket szhao 1 Quote Link to post Share on other sites
szhao 17 Posted July 7, 2014 Author Share Posted July 7, 2014 I just found this video on youtube. It shows creating a web server and toggling pins through the browser. I also got a SimpleLink CC3200 LaunchPad. Maybe it can do the same thing with a more compact form. GeekDoc 1 Quote Link to post Share on other sites
adrianF 43 Posted July 10, 2014 Share Posted July 10, 2014 Sheng - soooo cool. One thing to also note is that the Firmata GUI that Sheng created is dynamic --- this means that any LaunchPad that has the Firmata Energia sketch flashed to it will sort of do a "handshake" with the GUI to describe the pins & peripherals that are available. Then, the GUI dynamically populates with a list of the pins for that specific LaunchPad. Pretty slick. The Firmata Energia example sketches are in the Energia GitHub >> https://github.com/energia/Energia/tree/master/libraries/Firmata bluehash and szhao 2 Quote Link to post Share on other sites
bluehash 1,581 Posted July 10, 2014 Share Posted July 10, 2014 Sheng - soooo cool. One thing to also note is that the Firmata GUI that Sheng created is dynamic --- this means that any LaunchPad that has the Firmata Energia sketch flashed to it will sort of do a "handshake" with the GUI to describe the pins & peripherals that are available. Then, the GUI dynamically populates with a list of the pins for that specific LaunchPad. Pretty slick. The Firmata Energia example sketches are in the Energia GitHub >> https://github.com/energia/Energia/tree/master/libraries/Firmata Ok.. That is cool. Quote Link to post Share on other sites
adrianF 43 Posted July 10, 2014 Share Posted July 10, 2014 Ok.. That is cool. I know right!??!! Each LaunchPad is defined here in the Firmata boards.h file --> https://github.com/energia/Energia/blob/master/libraries/Firmata/Boards.h bluehash 1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.