CC3000 & Xively Error when adding a third channel

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
y2014
 
Posts: 3
Joined: Tue Jul 22, 2014 11:37 am

CC3000 & Xively Error when adding a third channel

Post by y2014 »

Hi,

I am working through the CC300 & Xively sketch on Arduino UNO:
https://learn.adafruit.com/adafruit-cc3 ... troduction.

It works well if I rename a Data Channel, delete one. However, when adding a third Data Channel, I get following error in the Serial Monitor:
{"title":"Bad request","errors":"Invalid content in request body. Must be UTF-8."}

I added a Sunshine Data Channel to Xively and following "sensor" to Arduino sketch:
randomSeed(analogRead(0)); // RANDOM
int sunshine = random (300); // RANDOM

My data string is looking like this:
String data = "";
data = data + "\n" + "{\"version\":\"1.0.0\",\"datastreams\" : [ {\"id\" : \"Temperature\",\"current_value\" : \"" + String(temperature) + "\"},"
+ "{\"id\" : \"Humidity\" ,\"current_value\" : \"" + String(humidity) + "\"},"
+ "{\"id\" : \"Sunshine\" ,\"current_value\" : \"" + String(sunshine) + "\"}]}";

Any suggestions on how to fix the error? and how many data channels can be sending / receiving data to / from CC3000?

Thank you

User avatar
marco26fr
 
Posts: 38
Joined: Sat Jul 28, 2012 5:25 am

Re: CC3000 & Xively Error when adding a third channel

Post by marco26fr »

Hello,

I am the author of the guide and I'd be happy to help :) I successfully sent 3 and even 4 variables to Xively, so it is definitely possible. I don't see anything wrong with your code. Did you create the third variable after having already sent data to Xively for the first two variables ? I noticed that I sometimes get errors when I already logged data for 2 variables & I am trying to add a third one. Try the project again with a brand new 'device' on Xively.

Also, I recently updated the code by adding the Arduino watchdog so the project cannot 'freeze' anymore if something goes wrong. I am not sure this would fix your problem, but I will try basing your sketch on this new version of the code. You basically have to split the data into several smaller Strings and send them one after the other. I'll let you have a look inside the code:

https://github.com/openhomeautomation/a ... 000-xively

Let me know how it goes!

PierlugiRovere
 
Posts: 15
Joined: Tue Jul 08, 2014 8:40 am

Re: CC3000 & Xively Error when adding a third channel

Post by PierlugiRovere »

marco26fr wrote:You basically have to split the data into several smaller Strings and send them one after the other.
I had tested it yesterday. this is the first day that the program run 24 hours without crashes.

Tomorrow i'll post my sketch entirely.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”