-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Home
Volodymyr Shymanskyy edited this page May 13, 2016
·
12 revisions
This page is a collection of notes on different hardware, pitfalls, tutorial links, etc.
You have to select UNO in the Blynk App board type, not the DUE (which refers to the Arduino Due).
This connection type is very tricky to start with.
- Be aware of your processor speed. The 8266 executes instructions a lot faster than the Uno/Mega, so you may need to throttle back a bit. I have a lot of widgets on my screen, and the flood of initializations was choking Blynk. I just added some 1 second delays after every 4 widget updates or so.
- Use push updates for widgets to avoid unnecessary calls to BLYNK_READ. I had 4 value displays that were being updated every second but the values were frequently the same. So I switched the update frequency to "push" and wrote a timer-called function to send the update only when it changed. (The documentation says no more than 10 updates per second, so make sure you respect that.) This eliminated a lot of needless messages.
- Use simple, short, modular functions. There is a lot of logic going on in my app, which I suspect was sometimes running too long and locking Blynk out. So I rewrote the code to use more modules and had them do as few things as possible. Then the next important step:
- Use a lot of timer routines. I went from 1 timer-called routine (SimpleTimer) to 5 (calling the new modules in item 3 above). Each one has a #define for how frequently it is called and they are of course staggered. This allowed me to easily tune the volume of Blynk messages to balance the message traffic out while still being responsive.
- There is now nothing else in loop() besides the calls to Blynk.run() and Timer.run().
[TODO]
ESP8266-based boards can run Blynk directly on the ESP8266 chip, using this board support package: https://github.com/esp8266/Arduino
Tutorials:
- Getting started with Blynk: https://learn.sparkfun.com/tutorials/esp8266-thing-development-board-hookup-guide/example-sketch-blink-with-blynk
- Getting started with ESP8266: http://www.esp8266.com/wiki/doku.php?id=getting-started-with-the-esp8266
Known possible hardware issues:
- ESP8266 can't be powered from 3v3 pin on most Arduino, as it requires >400 mA current.
- ESP8266 flash might get broken. The code executes without problem right after flashing, but stops working after first reboot.
- This WiFi module can somehow interfere with PIR sensors -> PIR sensor starts producing random values ;)
NOTE: Blynk can consume quite a lot of data! Use carefully not no overpay for the data plan.
https://www.npmjs.com/package/blynk-library
- Regular PC with Linux / Windows / OS X
- Single Board Computers (Raspberry Pi, BeagleBone, Intel Edison/Galileo, ...)
- OpenWRT
- Espruino
Tutorials:
- https://www.hackster.io/vshymanskyy/blynk-javascript-in-20-minutes-3ee903
- https://www.hackster.io/vshymanskyy/raspberry-pi-node-js-blynk-app-dht11-dht22-am2302-c356a8?ref=user&ref_id=10859&offset=1
- WiPy
If you like Blynk library - give it a star, or fork it and contribute!
Blynk for Business | Blynk Community | Documentation | App Store | Google Play