Getting Blynk (client) to work on C.H.I.P. hardware

As I have mostly only older hardware, and as of yet been unable to join the elite ESP users :wink: I keep pushing on trying to learn stuff I didn’t really want to learn to begin with… control stuffs without coding they says… hmmm, marketing people…

Anyhow… having had very little success with my older RPi and Blynk (either works but no examples (wiringPi), or doesn’t work but with limited examples (Node)… I have decided to change tracks and work with something even less well documented, Blynk wise… :stuck_out_tongue:

the Next Thing Co. C.H.I.P.

1GHz CPU, runs Linux, has 512MB RAM, 4GB (actually 8GB) Flash, WiFi b/g/n, BT 4.0… what could possibly go wrong?? :wink:

I have successfully installed Local Server on C.H.I.P.… but I want MOAR!!

So, anyhow I basicly loaded one up using the following directions:

sudo apt-get update && sudo apt-get upgrade
sudo apt-get install build-essential
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo npm install -g npm
sudo npm install -g onoff
sudo npm install -g blynk-library

And successfully ran: blynk-client <auth> on Cloud Server.

OnOff mode
Connecting to: blynk-cloud.com 8441
SSL authorization...
Connected
Authorized
Blynk ready.

In the app I chose Generic Board and added 7 buttons (then ran out of energy - I miss my Local Server :wink: ) referencing digital pins 0-6 out of the 8 I believe the C.H.I.P. has; I was hoping to keep pushing buttons until I saw my LED (plugged into random GPIO pins) light up, thus determining the correct direct pin reference (virtual pins and code comes later, baby steps here).

From there I hit a wall… as soon as I hit any app button the CLI on the C.H.I.P. threw an error:

EACCES: permission denied, open ‘/sys/class/gpio/export’

A quick Google later said it had to do with permissions, and that was resolved with adding sudo; sudo blynk-client <auth>

But now I get this error:

(node:1243) DeprecationWarning: Calling an asynchronous function without callback is deprecated.
(node:1243) DeprecationWarning: Calling an asynchronous function without callback is deprecated.
fs.js:90
_ throw err; // Forgot a callback but don’t know where? Use NODE_DEBUG=fs_
_ ^_

Error: EPERM: operation not permitted, write

So, basicly I am thinking that Generic Board may not be the answer and I have to wait for a supported board addition to the library???

Did I use too new of a NODEJS install?? ver 7 instead of 6?

Or am I just hitting another wall, again, and my successful Blynk use is doomed to remain limited and tethered via USB link and my Arduinos :neutral_face:

It says something is deprecated, which would indicate you are running old versions. I’d first try to update your NODEjs instal.

Other than that, it’s just linux, right? So it should run the latest of Node. Run apt-get update & upgrade again and see what happens.

Which version of NodeJS is on there anyway? (Not pretending I know anything about it, but I may be able to replicate something with my Pi, it runs Linux too, so it should work basically the same.

None by default… I installed Node 7.5.0 and NPM 4.2.0

I’m reading something about the script being wrong and not being able to write to certain pins.

Can you try reading a Pin? See if that works?

I removed all buttons and added a single value display, picked a digital pin at random (D3) and ran the client… within a second (the set time for the display) it threw this error:

/usr/lib/node_modules/onoff/onoff.js:103
          throw e;
          ^

Error: Unknown system error -517: Unknown system error -517, write
    at Object.fs.writeSync (fs.js:719:20)
    at Object.fs.writeFileSync (fs.js:1233:24)
    at new Gpio (/usr/lib/node_modules/onoff/onoff.js:99:12)
    at exports.BoardOnOff.process (/usr/lib/node_modules/blynk-library/blynk-node.js:351:19)
    at Blynk.onReceive (/usr/lib/node_modules/blynk-library/blynk.js:469:29)
    at exports.SslClient.<anonymous> (/usr/lib/node_modules/blynk-library/blynk.js:548:50)
    at emitOne (events.js:96:13)
    at exports.SslClient.emit (events.js:189:7)
    at TLSSocket.<anonymous> (/usr/lib/node_modules/blynk-library/blynk-node.js:193:16)
    at emitOne (events.js:96:13)

Specification seems more than adequate.

I suspect that could be a problem as the latest instructions for the Pi are for 6.XX not 7.XX. It might be that something in the Blynk module is depreciated.

I believe the syntax for this, for additional debugging, is:

sudo NODE_DEBUG=fs node blynk-client <auth>

It took a few tries with < Error: Cannot find module '/home/chip/blynk-client' errors, but adding the path gave this result:

chip@chip:~$ sudo NODE_DEBUG=fs /usr/bin/blynk-client fac8c5a504d44dfb9865003193700a85
OnOff mode
Connecting to: blynk-cloud.com 8441
SSL authorization...
Connected
Authorized
Blynk ready.
Disconnect blynk

It just keeps cycling from connected to disconnected and I don’t see any debugging info and not much of this make any sense to me anyhow… I am starting to feel deja vu :confused:

And here I thought using NEW hardware would help (even if it isn’t officially supported…yet? :stuck_out_tongue: )

I was wondering that as well when first installing… and so I just removed NODE and reinstalled 6.9.5 along with reinstalling NPM, ONOFF and Blynk… now I am back with the same issues I had with RPi and Blynk… arrrggg.

I have:

└─┬ onoff@1.1.1
  └─┬ epoll@0.1.20
    ├── bindings@1.2.1
    └── nan@2.4.0

What hardware device are you selecting in the app?

Generic board, but I briefly tried NODEMCU (thought it was a form of generic NODE device) with same results.

And ONOFF just updated about 6 days ago to 1.1.2

Well, I could (and probably will try for awhile :wink: ) run around Google, forever, trying to learn all about Linux, Java, Node, NPM etc… just to figure this out…

Meanwhile, @Dmitriy… not sure if you are the correct one to ask… but any idea if/when an official Blynk support of C.H.I.P. might be coming along?

Blynk already works on CHIP. If you mean easier setup, than - no plans for that.

I know, I seem to have been the only one on the forum who installed server… and now client, on it… “works” yes…“functional”, er, not so much.

I am starting to think that unless one owns an ESP based device, they are not “truly” welcome into the Blynk world; Arduino works, but considered nonoptimal; RPi works, but takes a linux guru to make functional.

I have also noticed that much of your marketing has removed or shied away from the original “No Coding Required” mantra, good call.

Unfortunately the solution always appears to to “simply learn Linux, Java, Python, etc”. Not that I am against learning new things, but being forced too, just to make simple things work, is a little frustrating.

The explanation is very simple - ESP, Arduino, Particle, Sparkfun it is majority of MCUs. All others are really few % of market. Also Rasp is not an real MCU. It is regular computer. It is used as PC and not as MCU mostly. Yes, some people try to utilize it as MCU, but not much.

What marketing do you mean?

OK, so perhaps ‘slightly overstated’ is a better term then removed. i.e. Kickstarter, your main front page, etc… I guess I am just too literal… I see someone claiming “This works on that, out of the box”, I fully expect it too. However, reality ‘bytes’ sometimes :unamused:

So far the only thing I have successfully “drag-n-dropped” with my RPi and Blynk, is the RPi itself… across the desk and into the bin :stuck_out_tongue:

A microcontroller (or MCU for microcontroller unit) is a small computer on a single integrated circuit. In modern terminology, it is a System on a chip or SoC.

The Raspberry Pi is a series of small single-board computers developed in the United Kingdom by the Raspberry Pi Foundation to promote the teaching of basic computer science in schools and in developing countries. The original model became far more popular than anticipated, selling outside of its target market for uses such as robotics.

What you meant is… as a business, you develop where the money is… Fine, so don’t market as “easy to use”, then when asked a question about why it isn’t so easy, give cryptic answers or flat out “- no plans for that.” when someone asks for assistance.

NO, I may not spend a lot of money on Blynk (Local Server), but I try to payback by being an assistance to others in the forums… even defending Blynk to many whom have complained about the exact same thing “We have to learn to CODE in-order to really make use of Blynk??”. I am not asking for you to “do it all” for me… just the parts I clearly have limited control over… such as getting the basic Blynk libraries and/or infrastructure documented and working with popular MCUs such as RPi & C.H.I.P.

But that true for majority of MCUs. We can’t cover everything. We do our best with resources we have. Sorry if that not sufficient for you.

It’s still a lot better than some other solutions out there. If you for example look to FreeRTOS (which supposed to be rockstable in contradiction to the Arduino), the learning curve is still very steep.

I disagree that it’s not easy to use. In my opinion Blynk covers a very nice hole in the market for enthousiasts who want to do some home automation and other fun stuff but don’t want to get to deep into programming and electronics. If you scrape parts and shields left and right you can focus on what you want (building a robot, beer brewery or grow-box) and have Blynk take care of the interface to your project.

The Blynk project goes along as it does and certain decisions need to be made. You can’t expect software developers to work for free and some decisions affect the community of “free” or semi-free users in a bad way, but unfortunately that is just the way the world works.

I’m sure we all agree the guys here are doing a marvelous job of keeping in touch with us all (which benefits them and us) and actually listening to our requests instead of just going left or right :slight_smile:

1 Like

@Lichtsignaal I agree wholeheartedly with you.

The concern I had was limited to particular “supported” MCU (RPi) that has issues with the current install directions and examples (as many others have also pointed out). And in switching to this other Linux based MCU (C.H.I.P.), I had hoped to encourage pro-action for solid Blynk support of both the RPi & C.H.I.P. and possibly other Linux based MCUs out there (Beaglebone anyone?).

Unfortunately it appears that despite being headlined in advertising and on the supported list, development time on, apparently ?unpopular?, RPi and similar style MCU’s is scarce… and being a blunt, call it as it seems type person :stuck_out_tongue: I spoke out about the inconsistencies.

Nothing to worry about, I am not badmouthing Blynk or anyone else… I was a bit put out by the answers I was getting and was just trying to make a point. But hey it is their business model, not mine :wink:

Thankfully we have smart people on this forum and @Costas has already stepped in and provided some very welcome and helpful directions, and a all-important example!! for the wiringPi method of Blinkifying RPi.

I have been working with it all afternoon… and even have hope to eventually use some of that experience toward the eventual blynkification of the C.H.I.P. as it “almost”, but not quite works :confounded: Next time Gadget, next time!

1 Like