The WiDo board is a clone of Arduino Leonardo with a CC3000 chip.
Originally I had ZERO luck following the instructions on the WiDo website, so I decided to try and link up to Blynk myself. I used the sketch designer on the Blynk website, API/Auth Key in my email, and uploaded the sketch to the device. At first I thought maybe I was doing something wrong…
So when that didn’t work, I followed an instruction guide that someone made for this exact combination of products. https://interactingobjects.com/discovering-blink-and-making-it-work-on-dfrobot-wido/ This guy has a YouTube video of a successful connection, provides his sketch and all of the necessary files, libraries, and parts to make it work. I followed these instructions to an “Io-T.” See what I did there?
I have 3 LEDs (Red, Yellow, Green) wired up to PINs 13, 12, 11 respectively alongside 3 x 220 ohm resistors and a jumper from the 5V output on the board to the (+) rail on the breadboard.
From there I input my WiFi credentials for my 2.4 GHz network into the config.h file I downloaded:
#define WLAN_SSID "XxxXxxx"
#define WLAN_PASS "xxxxxx"
#define WLAN_SECURITY WLAN_SEC_WPA2
char auth[] = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
Code:
// CC3000 / Wido pins
#define ADAFRUIT_CC3000_IRQ 7
#define ADAFRUIT_CC3000_VBAT 5
#define ADAFRUIT_CC3000_CS 10
#include <SPI.h>
#include <Adafruit_CC3000.h>
#include <BlynkSimpleCC3000.h>
#include "config.h" // Contains wifi and Blynk info
// OUT
#define pinLedRed 13
#define pinLedYellow 12
#define pinLedGreen 11
void setup()
{
Serial.begin(9600); //for debugging - disable once live.
pinMode(pinLedGreen,OUTPUT);
pinMode(pinLedYellow,OUTPUT);
pinMode(pinLedRed,OUTPUT);
// On Leonardo, wait for the Serial monitor to be opened
// so we get debug from the begining (for debugging)
digitalWrite(pinLedGreen,HIGH); delay(500);
//while(!Serial);
digitalWrite(pinLedYellow,HIGH); delay(500);
Serial.println("Initializing Blynk using Wifi (CC3000 compatible)");
Blynk.begin(auth, WLAN_SSID, WLAN_PASS, WLAN_SECURITY);
Serial.println("Initialized !");
digitalWrite(pinLedRed,HIGH); delay(500);
digitalWrite(pinLedGreen,LOW);
digitalWrite(pinLedYellow,LOW);
digitalWrite(pinLedRed,LOW);
}
long lastHB=0;
long valHB=0;
void loop()
{
Blynk.run(); //start polling the system and reporting to the Blynk app.
// Sends a heartbeat to Blynk
// and make one of the led real leds blink
if(millis()-lastHB > 1000) {
if(valHB==LOW) valHB=HIGH; else valHB=LOW;
Blynk.virtualWrite(1, valHB);
digitalWrite(pinLedGreen,valHB);
lastHB=millis();
}
}
When I press the upload button I can see the RED LED blinking along with the onboard LED since I think PIN 13 is tied to this… I watch it upload… and it starts in to the loop then stops… The entire board just stops working and the power LED sits there static after the loop runs for about 2 seconds.
If I remove all of the WIFI/CC3000 libraries and code the loop will run just fine. But whenever I invoke the Wifi connection using the CC3000 library it halts again. Every now and then, the Blynk app will recognize that the device came online for a few milliseconds or so and report the last time it was offline, but I can never get it to an Online state perpetually.
One exception to this, is using the prebuilt sketch to connect to wifi using Carriots. This is the only sketch I can get to work with the wifi chip on the board. Its a simple sketch that reports real time temperature to the Carriots server. It succesfully establishes a wifi connection to my router, connects to the carriots server, authenticates my account, and runs its loop successfully. Nothing is different from what I can see about how the library is invoked or the commands for the credentials etc.
However, IRONICALLY after I let this run for awhile, the board eventually got to over 100 degrees F and halted once more in the middle of serial output. (Although I was simultaneously powering it with USB and a 12V/1A power adapter. Dont think this was the problem, maybe just the high frequency of traffic requests of sending data to carriots? Anways…
I never tried to include the Blynk connection info simultaneously inside of this sketch although that would be an interesting test just to see if it would identify itself as online.
So I decided to enable all console warnings and verbose messages…
Error Msg’s:
"C:\Users\Matthew\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -Wall -Wextra -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10801 -DARDUINO_AVR_LEONARDO -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x8036 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="Arduino Leonardo"' "-IC:\Users\Matthew\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.18\cores\arduino" "-IC:\Users\Matthew\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.18\variants\leonardo" "-ID:\Users\Matthew\Documents\Arduino\libraries\Adafruit_CC3000" "-IC:\Users\Matthew\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.18\libraries\SPI\src" "-ID:\Users\Matthew\Documents\Arduino\libraries\Blynk\src" "C:\Users\Matthew\AppData\Local\Temp\arduino_build_182693\sketch\BlynkLedTest.ino.cpp" -o "C:\Users\Matthew\AppData\Local\Temp\arduino_build_182693\sketch\BlynkLedTest.ino.cpp.o"
In file included from D:\Users\Matthew\Documents\Arduino\libraries\Blynk\src/BlynkSimpleCC3000.h:13:0,
from D:\Users\Matthew\Documents\Arduino\BlynkLedTest\BlynkLedTest.ino:24:
D:\Users\Matthew\Documents\Arduino\libraries\Blynk\src/Adapters/BlynkCC3000.h: In member function 'bool BlynkTransportCC3000::connect()':
D:\Users\Matthew\Documents\Arduino\libraries\Blynk\src/Adapters/BlynkCC3000.h:52:18: warning: unused variable 'a' [-Wunused-variable]
uint8_t* a = (uint8_t*)&addr;
^
Compiling libraries...
Compiling library "Adafruit_CC3000"