Discovering Blynk… and making it work on DFRobot WiDo

I discovered Blynk last week.

Blynk01

Blynk

Create an app for any connected project or product based on Arduino, Raspberry Pi, ESP8266 and other hardware

 

I saw it could work with Adafruit CC3000 breakout board… and WiDo is working with this library. So lets test it !

  • Grab a WiDo
  • Add the proper libraries
  • Connect 3 leds to the WiDo on pin 11, 12 and 13 (but any other pin will do !).
  • Download this sketch
  • Rename config.h.sample into config.h and customize the values depending on your environment
  • Upload  on the WiDo (don’t forget to specify the proper board : it’s a Leonardo clone)

And that’s it !

You’ll notice the code is rather simple : almost all the magic happens in Blynk.run() whicg updates the led status when you press a button on Blynk App and a bit in Blynk.virtualWrite() which sends a value on virtual pin 1 and is used to blink a virtual led.

10 thoughts on “Discovering Blynk… and making it work on DFRobot WiDo

  1. Hi there, Martin here from Argentina trying to engage my kids with arduino stuff.
    I ve an arduino wido board, brand new and working ok uploading that Lauren CC3000 forked library, (buildtest, Wido2LocalTcpServer, etc).
    Also I have those Blync librarys and my phone running tha app and some Leonardo board project.
    I cant make work your .ino… Do you use the adafruit cc3000 original library or the Lauren fork one? (if I try to compile your code with the last cc3000 it compile but not work with my wido, if I do the same with lauren library, it does not compile)

    Any hint?

    • Hello Martin,

      I used original CC3000 Adafruit Library.

      Do you get any output in serial monitor ? Does it connect to the wifi network ? I’ll rebuild this and do some tests.

      Jean-Sébastien

      • I am having some of the same problems…

        I cannot get the forked CC3000 library to compile, but when using the up-to-date CC3000 library it compiles with errors, the board initializes (sometimes it gets far enough to establish a wifi connection) then after 1-2 seconds the entire board just halts in the middle of whatever it was doing and stops working entirely.

        I hit the reset button, and it initializes and does the same thing.

        When I use the exact same code and remove all of the wifi references from your sketch it will compile and run no problem. The minute I try to re-implement the CC3000 library and connection to wifi it halts again.

        I was however, able to get one of the pre-made sketches included in the forked github download of the CC3000 library to work, establishing a connection to the Carriots server and sending remote temperature data. It runs for awhile and then the board overheats and it halts. But it successfully establishes a remote connection, wifi network connection etc.

        I’m not sure whats different about the two that would cause one to work and not the other.

        I’m assuming the overheating problem is completely unrelated.

        • Hello,

          I used orginal Adafruit CC3000 lib, not the DFRobot modified one. If my memory serves me well, the only thing to change is th CC3000 IRQ pin from 3 to 7.
          Did you try to enable debug output for Blynk ? Just add
          #define BLYNK_PRINT Serial
          at the very beginng of your code.

          Also, you may want to try sample code Blynk/Boards_Wifi/CC3000 and see what happens.

          Carriots code is rather different because it initialize the CC3000 whereas, using Blynk, Blink.begin() is initializing the cc3000 itself.

          I’ll try to do some tests but it’s been a while since I tested this.

          • The problem is that even if I enable debugging, the entire board locks up within a second of it being flashed. One time it printed to serial that it was initializing the connection, then nothing again…

            I am using the latest official library for the CC3000. Can you confirm which version precisely you used? You used the original, but at that time it could have been older than the current latest version to date.

            My IRQ Pin is set to 7. I copied your code exactly.

          • Also… I managed to narrow down the problem I believe to what seems to be my Blynk library for the CC3000 card.

            See the error:

            Compiling sketch…
            “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”

          • Hello again,

            This is not an error, just a Warning. It should finish to compile and load the sketch onto the Wido.

            I tried to make it run again on mt side with all the lastest version and is seems there is a problem.
            – Arduino IDE : 1.8.2
            – cc3000 lib 1.0.3
            – blynk 0.4.7
            – SPI 1.0.0

            I added #define BLYNK_PRINT Serial at the begining of my sketch. I can see it connecting :


            Initializing Blynk using Wifi (CC3000 compatible)
            [3648] Connecting to ******
            [16955] Getting IP...
            [19259] IP: ***.***.***.***
            [19260] GW: ***.***.***.***
            [19261] DNS: ***.***.***.***
            [19262]
            ___ __ __
            / _ )/ /_ _____ / /__
            / _ / / // / _ \/ '_/
            /____/_/\_, /_//_/_/\_\
            /___/ v0.4.7 on Arduino Leonardo

            [19266] Looking for blynk-cloud.com
            [19284] Connecting to 139.59.206.133
            [19442] Ready (ping: 70ms).

            So it means it connects to blynk server.
            But here, it stops.

            Do you get the Blynk debug output ?
            Keep in minf that the wido is not an arduino uno clone but a leornado clone. It means that it won’t reset when you open the serial console. You can miss the output. To make sure you won’t miss a thing, just wait for the serial connection. After SerialBegin(); add the following :

            while(!Serial); //waiting for serial connection

            I’ll dig a bit deeper this week.

  2. Merci bien Jean Sebastien, I move my self to ESP 8266 it seems more versatil cheaper and a strong community. I will re test over wido again in next weeks,
    M

  3. Indeed. I am using leonardo clone. Not uno or even leonardo eth.

    I am also getting exactly as far as yourself and then as soon as it connects and pings the server it just locks up before it can even blink the leds. Leds work no problem when the cc3000 blynk is not initialized.

    I am also having no issues connecting to carriots server and posting data to my streams.

Leave a Reply

Your email address will not be published.