Completely unattended local Blynk-Server setup

Well that installed OK…

pi@raspberrypi:~ $ java -version
java version "1.7.0_60"

… but that is Java7, don’t we need Java8 for Blynk?

EDIT - Yup, to old or something…

Exception in thread "main" java.lang.UnsupportedClassVersionError: cc/blynk/server/launcher/ServerLauncher : Unsupported major.minor version 52.0

2nd EDIT Well this, from the Blynk Server install page, seems to be installing… sudo apt-get install oracle-java8-jdk

Final EDIT OK, now it is all working… But I can’t quite give this a high score on the “Completely Unattended” aspect :stuck_out_tongue: Now I have to go back in time and continue with my Flash marathon :zap:

don’t know what you are doing… what PI are you using? what rasbpian version? write these lines and report output:
. /etc/os-release
OPSYS=${ID^^}
DISTRO=$(/usr/bin/lsb_release -rs)
echo $OPSYS
echo $DISTRO

script should install the right java version in first lines, tested many times…

Me neither :wink:
RPi Model B rev2.0 512MB
RASPBIAN STRETCH LITE - Kernel version:4.9

pi@raspberrypi:~ $ echo $OPSYS
RASPBIAN
pi@raspberrypi:~ $ echo $DISTRO
9.1

PS, see edits above… it is all working now.

unfortunately now i’ve not a spare RPi to retry my script, as soon as i’m back to work when i’ve an other one i’ll redo a test and eventually mod the script, thanks for the reports :slight_smile:

I remember now, I installed Blynk and Java on my OpenELEC box which doesn’t support apt-get, that is why I had to install manually. I assume the Java8 is available too btw in the apt-get repo’s

modified script to run the different install of java based on distro (jessie+ubuntu/stretch)
let me know now…
i’ll fork the update and startup script of @Lichtsignaal to add them to script and adapt to my setup ASAP, thanks for that!

1 Like

No problem!

The only sidenote is the regex to extract the version number. It’s kind of hardcoded now in the form of x.xx.x. If that ever changes, for example in xx.xx.x, that should be changed :slight_smile:

@fragolinux I am not actively using my RPi for anything except testing right now, so let me know if you want me to re-run the whole thing after all those forkin updates :wink:

I am guessing there is an easy way to wipe out what was installed (Java, Blynk, etc) without having to completely start over with a fresh Raspbian… but I could do that as well, if need be.

@Lichtsignaal your update script is well done, it checks before downloading, which is good… i was just going to redownload the jar, whatever version is it, as it’s just a few mb… i’ll take a deeper look at your, anyway
@Gunner yes, i’ll do the mods this afternoon, so if you retry this evening, restarting from scratch, it will be a very good help, thanks :slight_smile:

EDIT: sorry, busy afternoon, mods will be done tomorrow, sorry…

sorry for the delay, back to work…
i converted the install script to an option of a full startup one based on the work of @Lichtsignaal (you declared the ERROR var but never used, why? Oh, of course credits are in script beginning, as due :slight_smile: )… missing still the update part, think i’ll do ASAP…
so, to install fully unattended as before, and have it automatically started up on reboot:

sudo wget --no-check-certificate -O /etc/init.d/blynk https://gist.githubusercontent.com/fragolinux/a5e7d6153afab4c52d91d41ff9860b8c/raw
sudo chmod 755 /etc/init.d/blynk && sudo update-rc.d blynk defaults
sudo /etc/init.d/blynk install

I did a bit of copy/pasting so there could be weird stuff in there. And there’s no time limit for hobbies :wink:

hi!

i would like to try this out. i’m not a linux user (have very limited knowledge), so someone could please explain step by step what should i do?

i have a pi zero w + clean raspbian intalled, upgraded, based on this instruction.

so, whats next?

  • i just have to run these commands, and that’s all? or there are other stuff to prepare before? eg. creating directory structure, setting access rights, etc?

  • if i understand correctly, this version doesn’t has the auto update feature implemented yet?

thanks!

This is for Server install…

Quick local server setup on Raspberry PI
https://github.com/blynkkk/blynk-server#quick-local-server-setup-on-raspberry-pi

This this is for the Client, if you also want it…

How to install Node.js library on Linux

http://help.blynk.cc/how-to-connect-different-hardware-with-blynk/raspberry-pi/how-to-install-nodejs-library-on-linux

I haven’t tried @fragolinux method again, since he updated it… but it is should be a more automated Local Server install… But you learn less, and that might make troubleshooting more difficult in the future.

1 Like

yes, that’s all… at the end you’ll get the url to connect to (https://yourip:9443) and the default user and pass generated during install, which are:
user: admin@blynk.cc
pass: admin

my script is just for easy and fast install, it’s up to you to make the install secure (changing credentials ASAP) and learn how to use or to add more advanced settings, as the official guide explains very well…

oh, and there’s no autoupdate, nor i think it will ever be… i just want to add an option to update, ON REQUEST, the actual install, something like:
sudo /etc/init.d/blynk update
of course don’t try this now, as it’s not there, yet…

1 Like

quite the opposite, instead… the script is there and you know EXACTLY what it does, so you know EXACTLY what can eventually go wrong, while an user manual install could be ANYTHING, from wrong folder, to wrong permissions, and who knows… and many just want to “play” with something and don’t go in details they’ll never understand or need…

Ya… but thats how I seem to learn best… by hands on. That said, I have already manually installed my own server on a Mint netbook, so trying out another with your method will only add to my experience. :wink:

Looking through the code, it seems that updating down the road is as simple as re-running the script again? Is that correct… and subsequent script runs will retain existing settings & data, and just update the Server versions?

guys, thanks for the info.

@Gunner, in the past i already done local server setup the manual way. so that was for learning:

now i would like to try the automated way, to see how it goes.

Ditto :stuck_out_tongue: I thought you had more experience on this… but I couldn’t remember… and didn’t look back into your posts… my bad.

i use linux very very rarely, so i tend to forget things in between uses.

the easiest way would be to stop the server, download the new JAR, restart the server… the cleaner version would be to check if a new version is available and download only if it is… still have to decide what path to go to… of course no data will be modified in both cases

oh, and of course that’s how i learn, too… the fact that i made this script is to make an easier life to newbies, but to do that, you need to learn by yourself, or you can’t just do it :slight_smile:

1 Like