I figured it was again time to install Blynk on my old RPi B 2.0, but with intent to actually learn how to use it.
I did run into this when first starting out with Blynk, late last year, and made a post about it, but it was a bit of a hack what with combining suggestions and directions from multiple Google references… so I am not going to reference it here. Besides, I honestly don’t remember if I ever got it working properly back then (probably just gave up and switched to Arduino, which I understand a bit better )
Unfortunately I think the instructions in the DOCs are still out-dated, as I am still getting these errors, although it appears to install:
pi@raspberrypi:/ $ sudo npm install -g onoff
npm WARN npm npm does not support Node.js v0.12.6
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can’t make any promises that npm will work with this version.
npm WARN npm You can find the latest version at https://nodejs.org/
/usr/local/lib
└── onoff@1.1.1
pi@raspberrypi:/ $ sudo npm install -g blynk-library
npm WARN npm npm does not support Node.js v0.12.6
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can’t make any promises that npm will work with this version.
npm WARN npm You can find the latest version at https://nodejs.org/
/usr/local/bin/blynk-client -> /usr/local/lib/node_modules/blynk-library/bin/blynk-client.js
/usr/local/bin/blynk-ctrl -> /usr/local/lib/node_modules/blynk-library/bin/blynk-ctrl.js
/usr/local/lib
└── blynk-library@0.4.5
And this statement (in the DOCs) appears to be outdated:
Run Blynk test script (put your auth token):
blynk.js 715f8cafe95f4a91bae319d0376caa8c
As one would now have to use:
blynk-client 715f8cafe95f4a91bae319d0376caa8c
And so I managed to get connected (using my own auth code and Cloud Server - as I couldn’t figure out how to connect to my Local Server from the terminal - again, all references appear to be outdated).
pi@raspberrypi:/ $ blynk-client xxxxxxxxxxxxxxxxxxxxx
OnOff mode
Connecting to: blynk-cloud.com 8441
SSL authorization...
Connected
Authorized
Blynk ready.
However, when I moved a slider, linked to Digital 18 (which had an LED wired to it and GND)… nothing happens.
So then I added a display widget to Digital 17 to see if I could at least see if it went HIGH or LOW (with a jumper to ground or 3.3v), but as soon as I start the app (with the display widget added in the app, but nothing physically connected to the pin) the client crashed:
Disconnect blynk
REARMING DISCONNECT
Connecting to: blynk-cloud.com 8441
SSL authorization...
Connected
Disconnect blynk
Connecting to: blynk-cloud.com 8441
SSL authorization...
Connected
Disconnect blynk
And it would keep this up until l Ctrl-C out on the terminal and remove the display widget from the app (ver 2.8.1).
And so here I am, looking for insight and assistance on these issues:
1 - How to properly update whatever version of Node - or Node.js - I am supposed to have installed, in-order to get ONOFF to work correctly (assuming that is even the issue)
2 - What is the correct command format to connect to my Local Server, over Ethernet, from a RPi terminal.
3 - Why would the client crash just because of a display widget in the app?
Oh, and please update the DOCs if necessary
++++++++++++++++++++++++++++++++
EDIT and UPDATE - after much trial, I ended up going the wiring PI method - if you don’t want to read everything below, then just start here
Go here for install directions:
The after getting that installed, first make sure you are in the correct directory (or include it in the command - see how I have done both, for reference, in the picture below) and then run sudo ./blynk --token= (don’t include the <>) when using cloud server. I am unsure if you need the ./ or just / before blynk… probably depends on the directory or path.
If you have your own Local Server then you need to add the IP and port.
And we are in like Flynn
Enjoy!
++++++++++++++++++++++++++++++++