Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is a websocket the least memory intensive approach to moving JSON data from Arduino Uno to Bluemix?

I really need to some help. Nothing broken, just needs some guidance. I have an Arduino Uno and AdaFruit CC3300 Wifi Shield. I have built a well functioning solar powered weather station and have saturated every analog and digital io. All is working well with the IDE, my wifi sample code runs perfectly. I am using IBM Bluemix and learning a lot although nothing I have done in the past. I am an Computer Engineer having done some software and mostly embedded hardware my entire career.

Unfortunately, I just didn't have enough space to get the MQTT client running on the Uno despite a lot of optimization. Plenty of good guidance on that out there and on Bluemix itself, but I can't use it.

Here are my questions;

  1. I am thinking the a web socket is my best play to keep things lite. ----- Is that right? ---- I need to essentially pass a JSON string of about 300 characters (all sensor data and other stuff) everything 5 minutes. That's it. I just can't figure out how to get that up to Bluemix app using Node Red (learning JavaScript as well). There is a web socket node too. It is not explained well anywhere that I can find at least such that a mortal man can understand. I have also run the webclient sample for that wifi library, but can't make the jump. Just not there experience wise.

  2. I believe the AdaFruit CC3300 Wifi shield library can setup a web socket on the client side so no further space burden. ---- Is that right? -----

  3. My goal is just to be able to get this JSON formatted data up to my Bluemix app and displayed in the Node Red debug console. I am fully setup on Bluemix.

Appreciate any guidance to steer me in the right direction. dpguitarman

like image 275
DPGUITARMAN Avatar asked Oct 18 '22 17:10

DPGUITARMAN


2 Answers

Rather than going through the need for a protocol upgrade to get a WebSocket connection why not just do a simple HTTP POST?

like image 52
hardillb Avatar answered Nov 14 '22 23:11

hardillb


I think the websocket client is the best solution, lightweight for arduino, and well integrated with node/Bluemix and so on. On Arduino side you could start from this library https://github.com/billroy/socket.io-arduino-client to setup an agent returning some values on the websocket. On Bluemix side nodered or also nodejs could be good solutions, asking just some lines of JavaScript for integration, if your arduino will return a well formatted Json

like image 28
v.bontempi Avatar answered Nov 14 '22 23:11

v.bontempi