[SOLVED] CC3000 with more than one variable hangs

Hi,

I am new to Ubidots and was hoping someone could help me out. I have a CC3000 with an Arduino Uno and I can get the single variable upload to work, but when I try to add a second variable the code hangs. I setup a second variable on the website and used that ID. Can I do this with a free account or do I need to purchase an account to pull in more than one variable per device?

Thanks for any help!!

Jon

code is as follows:
#include <UbidotsCC3000.h>
#include <Adafruit_CC3000.h>
#include <ccspi.h>
#include <SPI.h>
#include <string.h>
//#include "utility/debug.h"  // Uncomment this line to set DEBUG on

#define WLAN_SSID       "xxxxxx"  // Your WiFi SSID, cannot be longer than 32 characters!
#define WLAN_PASS       "xxxxxx"  // Replace it with your WiFi pass
// Security can be WLAN_SEC_UNSEC, WLAN_SEC_WEP, WLAN_SEC_WPA or WLAN_SEC_WPA2
#define WLAN_SECURITY   WLAN_SEC_WPA2

#define TOKEN "xxxxxx"  // Replace it with your Ubidots token
#define ID "xxxxxxx" // Replace it with your Ubidots' variable ID
#define ID2 "xxxxxx"

Ubidots client(TOKEN);

void setup() {
  Serial.begin(115200);
  client.initialize();
  client.wifiConnection(WLAN_SSID, WLAN_PASS, WLAN_SECURITY);

}

void loop() {
  float value = analogRead(A0);
  float value2 = analogRead(A1);
  client.add(ID,value);
  client.add(ID2,value2);
  client.sendAll();
}

Hi there, I know the CC3000 has a payload limitation for HTTP. You might be reaching that limit.

I suggest you use MQTT to send several variables. This is a library provided by the manufacturer themselves: https://github.com/adafruit/Adafruit_MQTT_Library then follow Ubidots’ MQTT guidelines: https://ubidots.com/docs/api/index.html#publish

Hi hackmed,

Thanks for your suggestion!! That seems to be the issue. I commented out the first variable and the second one worked perfectly. Just need to figure out if I can do multiple Client.sendall()s in the program. If not I will get a different WIFI board.

Thanks
Jon