0

CC3000
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

CC3000

by Med96 on Wed Jan 10, 2018 3:51 am

I have the Adafruit CC3000 breakout setup to an Arduino Uno. It works for about 30 mins to an hour and than stops working. If I reset it, it works again (then hangs again after the ~30mins). Any thoughts?
Code: Select all | TOGGLE FULL SIZE
/////////////////////////////////////////////////////////////////////////
#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       "------------------"  // Your WiFi SSID, cannot be longer than 32 characters!
#define WLAN_PASS       "-----------------------------"  // 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 "------------------------------------"  // Replace it with your Ubidots token
#define ID "----------------------------------" // Replace it with your Ubidots' variable ID


 
Ubidots client(TOKEN);

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

}

void loop() {
 
  float value = analogRead(A0);
  client.add(ID,value);

  client.sendAll();
}
Last edited by adafruit_support_carter on Fri Jan 12, 2018 5:06 pm, edited 1 time in total.
Reason: added [code] tags

Med96
 
Posts: 3
Joined: Wed Jan 10, 2018 3:43 am

Re: CC3000

by adafruit_support_carter on Fri Jan 12, 2018 5:07 pm

When it stops working does it freeze? Or just send wrong values? Or something else? What are you using for power? Can you post a photo of your setup showing all connections.

adafruit_support_carter
 
Posts: 13998
Joined: Tue Nov 29, 2016 2:45 pm

Re: CC3000

by Med96 on Mon Jan 15, 2018 5:10 am

hello and thanks for answer
it freeze and when i reset it, it works again and send correct values


Code: Select all | TOGGLE FULL SIZE
#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       "ORANGE_C9B1"  // Your WiFi SSID, cannot be longer than 32 characters!
#define WLAN_PASS       "-------------------"  // 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 "------------------------------"  // Replace it with your Ubidots token
#define ID "---------------------" // Replace it with your Ubidots' variable ID
#define DEVICE_LABEL "-----------------" // Replace it with your Ubidots' device label
#define VARIABLE_LABEL "------------------" // Replace it with your Ubidots' variable label
#include <avr/wdt.h>
//****************************************************************************************
const int led1 =  8;
//****************************************************************************************
Ubidots client(TOKEN);
void wdt_init(void) __attribute__((naked)) __attribute__((section(".init3")));
void setup() {
  Serial.begin(115200);
  client.initialize();
  client.wifiConnection(WLAN_SSID, WLAN_PASS, WLAN_SECURITY);
 pinMode(led1, OUTPUT);
}
void wdt_init(void)
{
    MCUSR = 0;
    wdt_disable();
    return;
}
void loop() {
  float value1 = analogRead(A8);
  client.add(ID,value1);
  client.sendAll();
  //*************************************************************************************
  float value = client.getValue(DEVICE_LABEL, VARIABLE_LABEL);
  Serial.print("The value obteined is: ");
  Serial.println(value);
   if (value == 1.0) {
    digitalWrite(led1, HIGH);
  } else {
    digitalWrite(led1, LOW);
  }
  //***********************************************************************************
}

arduino mega cc3000 <====>ubidots<====>labview
Attachments
26909379_964191210423094_2097745771_o.png
26909379_964191210423094_2097745771_o.png (82.95 KiB) Viewed 201 times
26942255_964186640423551_2056023426_o.jpg
26942255_964186640423551_2056023426_o.jpg (167.73 KiB) Viewed 201 times
26906021_964192557089626_353029898_o.jpg
26906021_964192557089626_353029898_o.jpg (101.49 KiB) Viewed 201 times

Med96
 
Posts: 3
Joined: Wed Jan 10, 2018 3:43 am

Re: CC3000

by adafruit_support_carter on Tue Jan 16, 2018 11:58 am

It may be related to the Ubidots library. Can you recreate the freeze up by running this simple test sketch:
https://github.com/adafruit/Adafruit_CC ... etTime.ino
Just let it run and see if it freezes after some period of time.

adafruit_support_carter
 
Posts: 13998
Joined: Tue Nov 29, 2016 2:45 pm

Please be positive and constructive with your questions and comments.