i would like to start blynk server on raspberry pi start. For that i programmed a runnlevel script. After System start i can see that blynk can’t find the directory which the server.properties is stored. Blynk creats its log directory directly under /
the blynk server.jar is under /opt/blynk. Can enyone help me. Thanks
The init Script is:
#!/bin/sh
### BEGIN INIT INFO
# Provides: Blynk
# Required-Start: $syslog
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Blynk for Raspberry
# Description: Blynk for Raspberry
### END INIT INFO
# Actions
case "$1" in
start)
/usr/bin/java -jar /opt/blynk/server-0.12.1.jar -dataFolder /opt/blynk/Blynk &
echo "Server gestartet"
;;
stop)
pkill -9 -f server-0.12.1.jar
#screen -S "Blynk" -X quit
;;
restart)
$0 stop
$0 start
;;
esac
exit 0
The blynk.log is the following:
11:19:57.261 INFO - Application server port 8443.
11:19:57.279 INFO - Administration server port 8777.
11:46:11.846 INFO - Using data dir '/opt/blynk/Blynk'
11:46:14.583 INFO - Initializing mail transport. Username : example@gmail.com. SMTP host : smtp.gmail.com:587
11:46:16.405 INFO - Plain tcp/ip hardware server port 8442.
11:46:16.410 INFO - Enabling SSL for hardware.
11:46:16.418 WARN - ATTENTION. Certificate / and key / paths not valid. Using embedded certs. This is not secure. Please replace it with your own certs.
11:46:24.642 INFO - SSL hardware port 8441.
11:46:24.646 INFO - Enabling HTTPS for hardware.
11:46:24.646 WARN - ATTENTION. Certificate / and key / paths not valid. Using embedded certs. This is not secure. Please replace it with your own certs.
11:46:26.142 INFO - HTTPS hardware server port 7443.
11:46:26.177 INFO - Enabling SSL for application.
11:46:26.178 WARN - ATTENTION. Server certificate paths cert : '/', key : '/' - not valid. Using embedded server certs and one way ssl. This is not secure. Please replace it with your own certs.
11:46:28.133 INFO - Application server port 8443.
11:46:28.151 INFO - Administration server port 8777.
thanks for the awsome script. But i have still problems to start Blynk after restart of raspberry.
If i start the script manualy /etc/init.d/blynk start then everthing is working fine. If i restart the raspberry, blynk didn’t find the folder /opt/blynk which includes all the config files. Why? Thanks!
i get the following messages in /logs/blynk.log (the folder /opt/blynk/Blynk is correct).
09:47:07.435 INFO - Using data dir '/opt/blynk/Blynk'
09:47:10.421 INFO - Initializing mail transport. Username : example@gmail.com. SMTP host : smtp.gmail.com:587
09:47:12.245 INFO - Plain tcp/ip hardware server port 8442.
09:47:12.250 INFO - Enabling SSL for hardware.
09:47:12.258 WARN - ATTENTION. Certificate / and key / paths not valid. Using embedded certs. This is not secure. Please replace it with your own certs.
09:47:15.238 INFO - SSL hardware port 8441.
09:47:15.242 INFO - Enabling HTTPS for hardware.
09:47:15.244 WARN - ATTENTION. Certificate / and key / paths not valid. Using embedded certs. This is not secure. Please replace it with your own certs.
09:47:19.434 INFO - HTTPS hardware server port 7443.
09:47:19.469 INFO - Enabling SSL for application.
09:47:19.470 WARN - ATTENTION. Server certificate paths cert : '/', key : '/' - not valid. Using embedded server certs and one way ssl. This is not secure. Please replace it with your own certs.
09:47:21.639 INFO - Application server port 8443.
09:47:21.659 INFO - Administration server port 8777.
That’s weird. It should be the same. I always start stuff by hand because I run openelec (which is very limited). What kind of OS are you running on your Pi?
ok i found the problem but not the solution. if i start /etc/init.d/blynk start for example from the folder/tmp. It didn’t start correctly. He can’t find the propertie Files, becouse it seems the server.jar search in the actually folder which i started the command. if i type the command /etc/init.d/blynk start from the folder /opt/blynk, everything works very well.
I think thats the problem. i must start the server.jar in that folder in which the server.jar is.But how can i start it on raspberry pi startup?
cd /storage/blynk/
java -jar server.jar -dataFolder /storage/blynk"
This is how it was done initially. But I agree this is not always clear. So I made some changes. Please try Dropbox - Error - Simplify your life this build and tell me if it works for you. Also have in mind that default logs path is “./logs” where “.” is dir from which you are running script.
May I ask are you running Blynk on an Openelec system? As you say the changes you can make are very limited when using Openelec. Maybe you just meant you generally start scripts manually in Openelec but not in reference to Blynk. If you are running Blynk with Openelec could you provide a few details of the set up.
Sure, I put the Blynk files on the /storage part and create the startup script manual. I also run it manual because my Pi is basically my 24/7 media machine, so it’s nearly always running.
Because the server side is Java-based it’s pretty much the only thing running beside the XBMC part of course.
There is a binary Java which you can download, add it to your path and you’re done.
Thanks I will give it a try when I have time.
If a local server can be run with Openelec presumably Blynk can also run with Blynk servers (rather than local servers), is this right?
Thanks Dimitriy but just to be clear my question is not about local and cloud based servers. It is about the ‘locked down’ media player software Openelec on the Raspberry Pi. I am aware it can all be done with Raspbian or RaspBMC but not quite sure about the best media player, in my opinion, Openelec.
Lichtsignaal has indicated it can be done so I will try to set it up when I have time.
Maybe I will wait until you support Python and then I could consider building a Kodi AddOn for Blynk control.
Just let me know if you need assistance. So far it’s running quit smooth here with one exception. When I start copying files things seem to freeze up because all the CPU is used up. This is partly because I have an older model Pi, with the newer ones this shouldn’t be a problem.
On average when watching some stuff on the Pi the Java server works very good
Lichtsignaal with reference to Openelec and the message I sent you about connecting to the Blynk server rather than having the server on a Raspberry Pi running Openelec.
Looking at the various scripts for different operating systems I notice there is some ‘experimental’ Python modules available. Having previously written some very basic Kodi AddOns then I believe it should be possible to access the Blynk server with an Openelec system.
Do we have any Kodi coders on the site or has anyone already used the Python stuff?
I’d love to give it a go, but I’m afraid I never used Python (how hard can it be though … ) but I never made stuff for Kodi, so I’m all for a solution, but I’m already spending way too much time in the attic according to my wife
I’m guessing this is just working locally at the moment but I will investigate further and report back. When I say locally I don’t mean a local server, simply the device being controlled is local to the device running Python.