Blynk Local Server Setup

I am facing problem running local blynk server on my raspberry pi , can somebody help me with this ?

To make server launch automatically every time Raspberry boots up or resets, find /etc/init.d/rc.local file and add a line:
java -jar /home/pi/server-0.12.0.jar -dataFolder /home/pi/Blynk &
Or if this doesn’t work for you, execute
crontab -e
add the following line
@reboot java -jar /home/pi/server-0.12.0.jar -dataFolder /home/pi/Blynk &
save and exit.App and sketch changes
Where to find /etc/init.d/rc.local file ??

Hey Adithya

If u use node (terminal editor) to edit the file you can simply type in “cd …/” without “” a few times then u should get to the basic folder where the /etc folder is.

im not sure but u can try “cd #” and then “node ./etc/init.d/rc.local” that should open the file in node.

Greedings Philipp

Thanks Irrlicht for the information

With the custom server ip address , i am not able to login into blynk app ,without which communication between app and raspberry pi is not possible.

Hey qutub,

Here the link to the Tutorial : http://docs.blynk.cc/#blynk-server-how-to-run-local-blynk-server-how-to-launch-blynk-server-on-raspberry-pi

The line should be here :smile:

> #!/bin/sh -e
> #
> # rc.local
> #
> # This script is executed at the end of each multiuser runlevel.
> # Make sure that the script will “exit 0” on success or any other
> # value on error.
> #
> # In order to enable or disable this script just change the execution
> # bits.
> #
> # By default this script does nothing.

-------------------->HERE<----------------------------

> exit 0

And to edit the rc.local file u can try to open the terminal with root.

Greeding Philipp

Thanks Philipp
How do i know is the server has auto started or not .?
and how to operate this with blynk app?

Regards
Adithya

Thanks Philipp for your reply,
but i think the rc.local file what you are showing is in /etc/rc.local. but i guess i need to edit /etc/init.d/rc.local file as shown in the above picture !
Please give a clarification on this

Oh i see :smiley: well thats what happen when my hands are faster then my brain :stuck_out_tongue:
in this case it should work when u put the line in here :

> #! /bin/sh
> ### BEGIN INIT INFO
> # Provides: rc.local
> # Required-Start: $remote_fs $syslog $all
> # Required-Stop:
> # Default-Start: 2 3 4 5
> # Default-Stop:
> # Short-Description: Run /etc/rc.local if it exist
> ### END INIT INFO

----->HERE<—

But in my knowlege the /etc/init.d/rc.local just runs the /etc/rc.local

Not 100% sure

Greetings Philipp

I can see that both the files are not having the same content, and yeah thanks once again for all the help :yum:

1 Like

Back to you @Adithya,

I sadly cant tell you how to use this with the app.

But to look if the autostart works just type “top” in the terminal, its the linux version of a taskmanager. there u can look if the java applet startet.

Greetings Philipp

Yea thanks,
After setting the local blynk server,i am unable to login into the app and github says put the authentication token in the wifi sketch , but where exactly to edit ,
i am using Raspberry pi and there is no wifi sketch example for raspberry pi

Regards
Adithya

1 Like

The wifi sketch is supposed to go into the Arduino, ESP or anything else.

You are running the local server on your Pi I assume or do you want to control your Pi with Blynk?

I am running the local server on Pi, and i want to control it with the blynk app
and also i am facing the problem with the auto start of the blynk local server

Those are two separate things. If you want to control your Pi, you have to compile the Blynk libraries to there (I have not done that myself, so I suggest you follow the tutorials for that). The local server is just for connecting together the App and the Hardware. Technically it should be possible to run the two on the same Pi device, but I haven’t tried yet, gonna try it when I decide to get another Pi, lol.

Autostart should be possible like with any other Linux system. There are a gazillion tutorials out there that deal with rc.d stuff (especially with Debian). I’ve written a nice startup script somewhere here.

1 Like

I just used PM2 to start my local server
Works a treat

1 Like