Local blynk server on Raspberry pi 3

Hello everyone.
I’m new in using raspberry pi and I’ve encounter some problem in installing my local blynk server.
When I type
sudo apt-get install oracle-java8-jdk
I have this error saying…

Package oracle-java8-installer is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source.
Package ‘oracle-java8-installer’ has no installation candidate

And this is why I cant proceed to the next step.
Can somebody help me plss??

I suggest you use the latest OpenJDK 11 by using the following command:

$sudo apt install openjdk-11-jre

To verify:

$ java --version
openjdk 11.0.5 2019-10-15
OpenJDK Runtime Environment (build 11.0.5+10-post-Raspbian-1deb10u1)
OpenJDK Server VM (build 11.0.5+10-post-Raspbian-1deb10u1, mixed mode)

then using Blynk server written for Java 11

server-0.41.11.jar

not the one for Java 8:

server-0.41.11-java8.jar

root@raspberrypi:~# $sudo apt install openjdk-11-jre
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut.
Statusinformationen werden eingelesen… Fertig
E: Paket openjdk-11-jre kann nicht gefunden werden.

root @ raspberrypi: ~ # $ sudo apt install openjdk-11-jre
Package lists are read … Done
Dependency tree is set up.
Status information is read … Done
E: package openjdk-11-jre can not be found.

Did you try to update the package lists with the following command before running ?

$sudo apt update
$sudo apt install openjdk-11-jre

Which Raspberry Pi model and Raspbian version you are using?

You can find out by

$uname -a

giving output like this for RPi 3 running latest Raspbian Buster:

Linux raspberrypi-02 4.19.75-v7+ #1270 SMP Tue Sep 24 18:45:11 BST 2019 armv7l GNU/Linux
To run Java 11 on the old Raspberry Pi Zero (W) not using newer ARMv7 CPU, you have to use Zulu OpenJDK. See this forum’s discussion:

If you’re running RPi 3/3+/4, we have to dig deeper to see why you have this issue.

root@raspberrypi:/home/pi# $sudo apt update
Holen: 1 http://ppa.launchpad.net trusty InRelease [15,5 kB]
OK   http://mirrordirector.raspbian.org jessie InRelease
OK   http://archive.raspberrypi.org jessie InRelease
OK   http://mirrordirector.raspbian.org jessie/main armhf Packages
Ign http://ppa.launchpad.net trusty InRelease
OK   http://ppa.launchpad.net trusty/main Sources
OK   http://mirrordirector.raspbian.org jessie/contrib armhf Packages
OK   http://ppa.launchpad.net trusty/main armhf Packages
OK   http://mirrordirector.raspbian.org jessie/non-free armhf Packages
OK   http://archive.raspberrypi.org jessie/main armhf Packages
OK   http://mirrordirector.raspbian.org jessie/rpi armhf Packages
OK   http://archive.raspberrypi.org jessie/ui armhf Packages
OK   http://ppa.launchpad.net trusty/main Translation-en
Ign http://ppa.launchpad.net trusty/main Translation-de_DE
Ign http://ppa.launchpad.net trusty/main Translation-de
Ign http://archive.raspberrypi.org jessie/main Translation-de_DE
Ign http://archive.raspberrypi.org jessie/main Translation-de
Ign http://archive.raspberrypi.org jessie/main Translation-en
Ign http://archive.raspberrypi.org jessie/ui Translation-de_DE
Ign http://archive.raspberrypi.org jessie/ui Translation-de
Ign http://archive.raspberrypi.org jessie/ui Translation-en
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-de_DE
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-de
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en
Ign http://mirrordirector.raspbian.org jessie/main Translation-de_DE
Ign http://mirrordirector.raspbian.org jessie/main Translation-de
Ign http://mirrordirector.raspbian.org jessie/main Translation-en
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-de_DE
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-de
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-de_DE
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-de
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en
Es wurden 15,5 kB in 7 s geholt (2.100 B/s).
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.
Statusinformationen werden eingelesen.... Fertig
Aktualisierung für 23 Pakete verfügbar. Führen Sie »apt list --upgradable« aus, um sie anzuzeigen.
W: GPG-Fehler: http://ppa.launchpad.net trusty InRelease: Die folgenden Signaturen konnten nicht überprüft werden, weil ihr öffentlicher Schlüssel nicht verfügbar ist: NO_PUBKEY C2518248EEA14886
root@raspberrypi:/home/pi# $sudo apt install openjdk-11-jre
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.
Statusinformationen werden eingelesen.... Fertig
E: Paket openjdk-11-jre kann nicht gefunden werden.
root@raspberrypi:/home/pi# $uname -a
bash: -a: Kommando nicht gefunden.
root@raspberrypi:/home/pi#
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
root @ raspberrypi: / home / pi # $ sudo apt update
Get: 1 http://ppa.launchpad.net trusty InRelease [15.5 kB]
OK http://mirrordirector.raspbian.org jessie InRelease
OK http://archive.raspberrypi.org jessie InRelease
OK http://mirrordirector.raspbian.org jessie / main armhf Packages
Ign http://ppa.launchpad.net trusty InRelease
OK http://ppa.launchpad.net trusty / main sources
OK http://mirrordirector.raspbian.org jessie / contrib armhf Packages
OK http://ppa.launchpad.net trusty / main armhf packages
OK http://mirrordirector.raspbian.org jessie / non-free armhf packages
OK http://archive.raspberrypi.org jessie / main armhf Packages
OK http://mirrordirector.raspbian.org jessie / rpi armhf Packages
OK http://archive.raspberrypi.org jessie / ui armhf Packages
OK http://ppa.launchpad.net trusty / main Translation-en
Ign http://ppa.launchpad.net trusty / main Translation-en_US
Ign http://ppa.launchpad.net trusty / main Translation-de
Ign http://archive.raspberrypi.org jessie / main Translation-en_US
Ign http://archive.raspberrypi.org jessie / main Translation-de
Ign http://archive.raspberrypi.org jessie / main Translation-en
Ign. Http://archive.raspberrypi.org jessie / ui Translation-en_US
Ign. Http://archive.raspberrypi.org jessie / ui Translation
Ign. Http://archive.raspberrypi.org jessie / ui Translation
Ign http://mirrordirector.raspbian.org jessie / contrib Translation-en_US
Ign http://mirrordirector.raspbian.org jessie / contrib Translation-de
Ign http://mirrordirector.raspbian.org jessie / contrib Translation
Ign http://mirrordirector.raspbian.org jessie / main Translation-en_US
Ign http://mirrordirector.raspbian.org jessie / main Translation-de
Ign http://mirrordirector.raspbian.org jessie / main Translation-en
Ign http://mirrordirector.raspbian.org jessie / non-free Translation-en_US
Ign. Http://mirrordirector.raspbian.org jessie / non-free Translation-de
Ign http://mirrordirector.raspbian.org jessie / non-free Translation
Ign http://mirrordirector.raspbian.org jessie / rpi Translation-en_US
Ign http://mirrordirector.raspbian.org jessie / rpi Translation-de
Ign. Http://mirrordirector.raspbian.org jessie / rpi Translation-en
There were 15.5 kB fetched in 7 s (2,100 B / s).
Package lists are read ... Done
Dependency tree is set up.
Status information is read .... Done
Update available for 23 packages. Run apt list --upgradable to display it.
W: GPG Error: http://ppa.launchpad.net trusty InRelease: The following signatures could not be verified because their public key is not available: NO_PUBKEY C2518248EEA14886
root @ raspberrypi: / home / pi # $ sudo apt install openjdk-11-jre
Package lists are read ... Done
Dependency tree is set up.
Status information is read .... Done
E: package openjdk-11-jre can not be found.
root @ raspberrypi: / home / pi # $ uname -a
bash: -a: command not found.
root @ Raspberry Pi: / home / pi #

Raspberry Pi 3+

You’re running very old Raspbian Jessie, and I’m afraid it’s no longer be supported and updated with new packages.
I suggest you install newer Raspbian OS, such as Stretch or Buster (the latest).
Go to

to download and update.

yes, use Jessie. Problem is still, that runs on this Hyperion for an Ambilight. Had then only in addition the Blynksrver installed with in order not to use a new / different RPi. Would Hyperion also run on the new version?

Because currently runs the Blynkserver yes with java 8 quite stable

I’m sorry I don’t fully understand because the translation loss.
I don’t know what Hyperion is, unless in Greek mythology. Is it another model of RPi?
But I guess it’s still OK if you can still run Java 8 as Blynk Server still supports, at least for now.

To update RPi from Raspbian Jessie to latest Buster, you can try these commands (but be sure to back up everything before doing)

$sudo apt update
$sudo apt dist-upgrade
$sudo apt full-upgrade

This way probably creates some headache because some software configs are not correct.

Thank you. I will install it on another MicroSD card. I keep the originals as a backup.

PS: Hyperion is an open source ambient light software. Feel free to join us and contribute new features! Webpage: https://hyperion-project.org/

have now set up a new microsd card with the latest Rspianimage and installed Java. Nevertheless, I have a problem, the server does not start.

....
Vorbereitung zum Entpacken von .../openjdk-11-jre_11.0.5+10-1~deb10u1_armhf.deb ...
Entpacken von openjdk-11-jre:armhf (11.0.5+10-1~deb10u1) ...
openjdk-11-jre:armhf (11.0.5+10-1~deb10u1) wird eingerichtet ...
libatk-wrapper-java (0.33.3-22) wird eingerichtet ...
libatk-wrapper-java-jni:armhf (0.33.3-22) wird eingerichtet ...
Trigger für mime-support (3.62) werden verarbeitet ...
Trigger für hicolor-icon-theme (0.17-2) werden verarbeitet ...
Trigger für gnome-menus (3.31.4-3) werden verarbeitet ...
Trigger für libc-bin (2.28-10+rpi1) werden verarbeitet ...
Trigger für desktop-file-utils (0.23-4) werden verarbeitet ...
root@raspberrypi:/home/pi# java --version
Ungültiger Maschinenbefehl
root@raspberrypi:/home/pi# cd blynk
root@raspberrypi:/home/pi/blynk# java -jar server-0.41.11.jar -dataFolder /home/pi/blynk log &
[1] 2047
root@raspberrypi:/home/pi/blynk#

I don’t know which installation step you did not do correctly, but from the symptom:

root@raspberrypi:/home/pi# java --version
Ungültiger Maschinenbefehl => Invalid machine command

I bet your RPi didn’t know where the java command is, therefore, your Blynk server couldn’t start.

You can find out if your openjdk java was installed (normally /usr/bin/) by using this command to test

pi@raspberrypi-02:~ $ /usr/bin/java --version
openjdk 11.0.5 2019-10-15
OpenJDK Runtime Environment (build 11.0.5+10-post-Raspbian-1deb10u1)
OpenJDK Server VM (build 11.0.5+10-post-Raspbian-1deb10u1, mixed mode)
pi@raspberrypi-02:~ $ 

if this is not working, you can find out if and where java was installed by using this command:

pi@raspberrypi-02:~ $ sudo find / -name java -print
...
...
/usr/share/java
/usr/bin/java              <=  this is where java normally installed
...

For example, you find out java was installed in /usr/bin/java, you have some options such as:

  1. Using /usr/bin/java instead of only java whenever you run it
pi@raspberrypi-02:~ $ /usr/bin/java --version
openjdk 11.0.5 2019-10-15
OpenJDK Runtime Environment (build 11.0.5+10-post-Raspbian-1deb10u1)
OpenJDK Server VM (build 11.0.5+10-post-Raspbian-1deb10u1, mixed mode)
pi@raspberrypi-02:~ $ /usr/bin/java -jar server-0.41.11.jar -dataFolder /home/pi/blynk log &

  1. Update your PATH to java

One note is that you’d better not use root account in everyday job. One small mistake can destroy your system. Use pi or whatever account you create but root. Whenever you need root privilege, use sudo. Also change the default root and pi password.

pi@raspberrypi-02:~ $ sudo passwd root
pi@raspberrypi-02:~ $ passwd

Good luck.

My server works perfectly until I close the terminal where the server was installed. The server disconnect(goes offline). Is there anyway tjat the Server runs even though I close the terminal? And the auto restart doest work for me… I followed the instruction about crontab -e but the problem is still there

To make the process still working after you close the terminal you run the command, you have to put the process to work in background by putting an Ampersand & at the end of the command.

For example:

java -jar /home/pi/Blynk/server-0.41.11.jar -dataFolder /home/pi/Blynk &

not just

java -jar /home/pi/Blynk/server-0.41.11.jar -dataFolder /home/pi/Blynk

To make the Blynk Server working after restarting the RPi, you need to put the command in /etc/rc.local. You can use nano text editor to do that.

pi@raspberrypi-02:~ $ sudo nano /etc/rc.local


#!/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.

# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
fi

# Add this line before exit 0
java -jar /home/pi/Blynk/server-0.41.11.jar -dataFolder /home/pi/Blynk &

exit 0

then press Ctrl-O to Write-Out or Save. Finally Ctrl-X to exit.

Try to restart by

pi@raspberrypi-02:~ $ sudo shutdown -r now
1 Like