-
Platform
- Hardware: VM - Guest: 1 vCPU / 2GB RAM / 20GB HDD
- Operating System: AlmaLinux 8.4
- OpenHAB Version: 2.5.12 & 3.1.0
- Originating Issue: openHAB Android App v2.19.0
-
Issue
- Expected Behavior: After setting the LAN IP address of the openHAB server on the Android App (no user & pass) the Android App should connect to the server.
- Actual Behavior: The Android App looks or an openHAB server and fails, showing the message: “We didn’t find an openHAB server in your network.”
- Steps: (Steps to reproduce the issue)
- Install AlmaLinux in a virtual machine
- Depending on the version of openHAB you want to install, run all the commands mentioned below using the “root” user (this is for testing purposes, so make sure those are the commands you want to run before doing it). NOTE: for the Linux fans, from the line 3 (after rebooting the server, you can copy all the lines then paste them in the console and the process will run faster, if you know what I mean)
2.1 openHAB 2:
sed -i 's/^SELINUX=.*$/SELINUX=disabled/' /etc/selinux/config
reboot
sudo dnf -y install epel-release
sudo dnf -y install vim htop iftop unzip
# Install Zulu
sudo dnf -y install libX11 libXext libXi libXrender libXtst alsa-lib
cd /opt
sudo curl -O https://cdn.azul.com/zulu/bin/zulu8.27.0.7-jdk8.0.162-linux.x86_64.rpm
sudo rpm -ivh zulu8.27.0.7-jdk8.0.162-linux.x86_64.rpm
java -version
# Install openHAB 2
sudo useradd --system --no-create-home --shell /sbin/nologin openhab
sudo curl -O https://openhab.jfrog.io/artifactory/libs-release-local/org/openhab/distro/openhab/2.5.12/openhab-2.5.12.zip
sudo unzip openhab-2.5.12.zip -d /opt/openhab2
# Install openHAB 2 add-ons (optional)
sudo curl -O https://openhab.jfrog.io/artifactory/libs-release-local/org/openhab/distro/openhab-addons/2.5.12/openhab-addons-2.5.12.kar
sudo cp -av openhab-addons-2.5.12.kar /opt/openhab2/addons/
sudo chown -hR openhab:openhab /opt/openhab2
cat << EOF | sudo tee -a /lib/systemd/system/openhab2.service
[Unit]
Description=The openHAB 2 Home Automation Bus Solution
Documentation=http://docs.openhab.org
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
User=openhab
Group=openhab
GuessMainPID=yes
WorkingDirectory=/opt/openhab2
#EnvironmentFile=/etc/default/openhab2
ExecStart=/opt/openhab2/start.sh server
ExecStop=/bin/kill -SIGINT $MAINPID
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable --now openhab2.service
sudo firewall-cmd --add-port={8080/tcp,8443/tcp} --permanent
sudo firewall-cmd --reload
2.2 openHAB 3
sed -i 's/^SELINUX=.*$/SELINUX=disabled/' /etc/selinux/config
reboot
sudo dnf -y install epel-release
sudo dnf -y install vim htop iftop unzip
# Install Zulu
cd /opt
sudo curl -O https://cdn.azul.com/zulu/bin/zulu11.52.13-ca-jdk11.0.13-linux.x86_64.rpm
sudo rpm -ivh zulu11.52.13-ca-jdk11.0.13-linux.x86_64.rpm
java -version
# Install openHAB 3
sudo useradd --system --no-create-home --shell /sbin/nologin openhab
sudo curl -O https://openhab.jfrog.io/artifactory/libs-release-local/org/openhab/distro/openhab/3.1.0/openhab-3.1.0.zip
sudo unzip openhab-3.1.0.zip -d /opt/openhab3
# Install openHAB 3 add-ons (optional)
sudo curl -O https://openhab.jfrog.io/artifactory/libs-release-local/org/openhab/distro/openhab-addons/3.1.0/openhab-addons-3.1.0.kar
sudo cp -av openhab-addons-3.1.0.kar /opt/openhab3/addons/
sudo chown -hR openhab:openhab /opt/openhab3
cat << EOF | sudo tee -a /usr/lib/systemd/system/openhab3.service
[Unit]
Description=openHAB - empowering the smart home
Documentation=https://www.openhab.org/docs/
Documentation=https://community.openhab.org
Wants=network-online.target
After=network-online.target
[Service]
User=openhab
Group=openhab
WorkingDirectory=/opt/openhab3
#EnvironmentFile=-/etc/default/openhab3
ExecStart=/opt/openhab3/runtime/bin/karaf daemon
ExecStop=/opt/openhab3/runtime/bin/karaf stop
Restart=on-failure
SuccessExitStatus=0 143
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable --now openhab3.service
sudo firewall-cmd --add-port={8080/tcp,8443/tcp} --permanent
sudo firewall-cmd --reload
- Wait 3-4 minutes to let the newly installed server to stabilize.
- In a different device than the openHAB server, open an internet browser (tried with Chrome and Firefox) and access to the openHAB IP address using the format http://<openhab_ipaddr>:8080/ and/or https://<openhab_ipaddr>:8443/ to make sure the page shows the openHAB web interface.
- Download OH from Google Play and configure a new server in the openHAB Android App using the exact addresses used in the step 4, the username and password were left empty. The Demo Mode is disabled.
- Went back to the main screen of the Adroid App and received an error message indicating that no OH server was found
-
What I have done so far
- I tested with an openHAB 2 and an openHAB 3 server, same result
- It is not a firewall issue because the web interface is accessible from an internet browser from the device running the OH Android App and the connection is done without problems
- I tested from an old device with the openHAB Android App v2.16.0 and it connected to the OH servers (v2 and v3), so definitely it should be a problem with the v2.19.0 Android App.