Bit the bullet and installed Node.JS / Blynk on Rpi3. It's awesome

This isn’t really a ‘projects made with Blynk,’ but I didn’t know where to put it.

I just wanted to throw this out there- especially for people who have only done fairly simple projects with Arduino’s and ESP’s and mostly using Arduino IDE- try out Blynk on a Raspberry Pi.

For whatever reason (okay, I’ve started dabbling in Javascript coding), I bit the bullet and spent quite a bit of time getting a headless Raspberry Pi 3 I’ve had sitting around collecting dust all set up with Node, the Blynk library, Git, etc. today… I also downloaded VS Studio Code (nice looking, quite customizable text editor) and Git for Windows and spent more time getting my Windows 10 computer to a point where I could be editing a .js file in the editor while watching things happen in my console output via a built in git-bash terminal in VS Studio.

I sure as hell don’t really know what I’m doing yet, but it’s a huge breath of fresh air.

  1. There are tons of cool libraries out there via NPM- they’re easy to install and update… It’s so much better than going through the Arduino IDE. And it’s a hell of a lot easier to update your Blynk library through NPM vs having to re-upload a sketch on an ESP that has been running something for the last 8 months straight and knowing something is going to break. :frowning:

  2. Editing code wirelessly. Yeah, it’s not too difficult to code Arduinos/Esp’s wirelessly, but changing a RPI script is like opening the hood of your car. You just… open the file that’s on the Rpi, edit it, save, and you’re done. You can see which file you’re currently running (for those of you with dozens of updates on your Arduinos and you can’t remember which .ino you uploaded last/which is currently running on it). And most importantly, you’re doing all of this across the room from your Rpi. Maybe across the city via ssh.

  3. Javascript is… kind of a fun language. Definitely a change of pace from C++. Event handlers are cool, and the timers are pretty straightforward- and maybe even a little more controllable than the simpleTimer library you’re used to.

  4. Git. Getting git set up and using it for my Arduino / Esp projects has just been kind of a pain in the ass for whatever reason. Maybe it’s because keeping track of libraries you use in a project is such a PIA with the arduino IDE, or something, but switching to an RPI makes using something like Github ridiculously easy.

  5. Blynk- Obviously, I want to tie this back to Blynk… but the blynk library install is super quick. You can also quickly check if you’re connecting to the Blynk server via the script that is installed with the library. It’s awesome.

End of rant. Point is, if you haven’t tried it yet, take a day to mess around with it.

I’m curious what other’s thoughts are on Blynk + Rpi… Pro’s and Con’s: I can think of 1 con- where is the nicely organized Javascript equivalent to all of the Arduino Blynk examples?!

2 Likes

I can really empathise with many of your comments… JS is a nice change from C++, I like how I can group everything into nice little “packages” instead of pre-setup, setup, main loop, functions, etc… and it just works :slight_smile:

Haven’t done much with timers yet… just a simple Delay/Pause" routine… That I suspect is non-blocking.

And yes, very quick to make a change and implement the change, and repeat until it works. I use VNC and run Geany to do the editing. I then run my script in a terminal window. So I simply edit my code, SAVE, CTRL-C in the CLI (to stop the script assuming it didn’t crash from last edit :stuck_out_tongue_winking_eye: ) up arrow to rerun script command, rinse & repeat. Very quick, which is nice when I am randomly trying different bracket combos trying to figure out what goes where :smiley:

MULTITASKING!!! I really like how I can run “child” processes from within my Blynk sketch… start and stop video streaming, check… run OLED display demos, check… click a button and send a PiCam picture to the OLED, check (still waiting for an image viewer for Blynk App - HINT :slight_smile: )

I think that may be up to us RPi NodeJS users to eventually produce. I already have a handful of my own examples that I have parceled out in this forum.

Hmm, on that note, since they are all wrapped up in my single NodeJS testbench script, I should break them out into another post or three in my Simple Code Example topic.

EDIT I made a new topic instead - NodeJS Blynk - Code Examples for Basic Tasks (Work in Progress). @zeeko feel free to send me any code snippets you have and I can add them in, with author credit of course.

1 Like

Initially I thought you were talking about the fact that you’d installed Node-Red on an Rpi3 along with Blynk (which is the setup that I use).
It might be worth changing the title of the thread to clarify that it’s NodeJS rather than just “Node”.

Pete.

2 Likes