Jump to content
Sign in to follow this  
szhao

Remotely Control Your LaunchPad with Firmata and Bluetooth

Recommended Posts

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? 

 

post-37286-0-33687000-1404149118_thumb.png

 

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

@@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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...