Raspberry Pi Zero (W) as Blynk Local Server

Very happy- feel like I’ve won the lottery- got blynk local server running on the pi zero w, using a hotspot from my phone so no issues with the school network. Now I need to try understand why I cant get the local server to auto load at boot up. I’ve tried the rc.local and cron examples I’ve seen. I have managed to get a python script to run at boot up with rc.local but not the blynk server.

Any suggestions?

A bash script triggered by cron is my favourite.

Can you show us the rc.local scripts? Both working and non-working. I created my own startup script and there are a couple scripts on the forum for starting/stopping the Server.

I’d copied the example from github- but there are two small errors which prevented the server from running- they are, that it suggests you do not need the full path name for the server file and the server file name is incorrect (it does not have the java8 at the end). I was copying it exactly so it tripped me up!
All working well know.

Next step to have the set of leds show activity on the server!

1 Like

Now I’m stuck with enabling email. I’ve set server.properties and I’ve created a specific email address to allow access for less secure apps but I’m still getting error msgs. Any pointers? Do I need to setup a script to run email services on the pi zero?

Have you setup mail.properties? https://github.com/blynkkk/blynk-server#enabling-mail-on-local-server

Hi Gunner
Thank you- I used the guide and an existing gmail account.

I took advice from someone and created a new account just for the server and this worked first time - I’d set the gmail account to allow accesss from less secure programs on both accounts. It worked first time with the new account. As mail.server has all the information in plain text it might be best practice to advise setting up a gmail account specifically for communications from the local server.

I now have a pi zero running headless with a python script to make a nice led display and users can login to create an account and have emails with their auth token sent to their email address of choice.

Now I need to work out if I can get an ip on the Raspberry pi that doesnt change!- can I set tthe pi up to have a static ip?

The forum is parted in this matter. On one side it’s me, other side is everyone else :wink:

“A house divided against itself cannot stand” as Lincoln once said. :man_farmer: In the long run I strongly recommend the use of systemd which enables you to run the Blynk server as a true service.

I’ll check this out over the next couple of weeks.
Thanks for the link

I have a blynk.service running now but it asks for a password- Id ideally like to run the pi zero headless!

Whaaat?! How, when, where?!? :face_with_raised_eyebrow: :open_mouth:

When I do the sytemctl preset blynk.servce I get this appear…


When I check if the servcie is running with
systemctl is-active blynk.service
I get
activating
which seems to last forever- I was expecting a “0” to sho all wwas working.

Any thoughts?- Is it a Users and Groups thing?

I’ve not had a password box pop up at all I had to look up the default password!

You need to authenticate as root, try:

sudo systemctl preset blynk.service

Hi thanks for that-

Still getting a log in box.

Retried making the service - had to use sudo nano to make a blynk1.service blank file to write the service into as with nano blynk1.service it would not let me write to the file. Could that be the issue? I need to understand users and group better- where is the best place to look?

Thanks for the help btw!

Following on

blynk1.service - Starts and stops the Blynk server daemon
Loaded: loaded (/etc/systemd/system/blynk1.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Sun 2018-02-11 09:27:16 GMT; 1s ago
Process: 909 ExecStart=/usr/bin/java -jar /home/pi/server-0.30.2-java8.jar -dataFolder /home/pi/blynk -
Main PID: 909 (code=exited, status=210/CHROOT)

Feb 11 09:27:16 raspberrypi systemd[1]: blynk1.service: Unit entered failed state.
Feb 11 09:27:16 raspberrypi systemd[1]: blynk1.service: Failed with result ‘exit-code’.

The blynk1.service file has the full -mailConfig and serveConfig path which is truncated in this report generted with systemctl status blynk1.service

So… Did a bit of googling and decided to try running the java command line to start tthe server and got an error msg about the certificates I’d generated following the tutorial.

I removed the certificates from the server.properties file after experimenting with full paths- and the server loaded and ran as expected.

Sry for late reply!

Can you paste the file /etc/systemd/system/blynk1.service

And the output of

~# ls -l /home/pi

Hi distans,
Removing the call to the security certificates from the server.properties file solved the problem. I think the newer versions of local server have some security built in.

Its been running solidly for a couple of weeks now!

1 Like

Great tutorial on how to get the local Blynk server started! However, I am having a trouble where I can’t seem to start the server nor being able to detect the java version that is running on the RPi Zero. I have tried:

  1. $ java -version
  2. $ java -jar /home/pi/Blynk/server-0.41.8.jar -dataFolder /home/pi/Blynk -serverConfig /home/pi/Blynk/server.properties -mailConfig /home/pi/Blynk/mail.properties

Both of these returns the following error:
“Error occurred during initialization of VM
Server VM is only supported on ARMv7+ VFP”

Could this be the newer version of Raspbian that I’m using or am I totally missing the mark here? Any help is appreciated. Thanks

1 Like

Hey! got the same problem. Did you got Any solutions ?

The newer Java Versions didn´t run on raspi zero w because of older Arm Architecture. You have to install Raspbian Jessie or Jessie Lite and use Java8. Then you need to install Blynk for Java8.

https://github.com/blynkkk/blynk-server/releases/download/v0.41.12/server-0.41.12-java8.jar