[SOLVED] deCONZ API completely missing

To conserve electricity, I’m moving my deCONZ from an x86 to an RPI.

Everything seems to be working, except that the installation of RPI has nothing under /api. As such, none of the applications (phoscon, for instance) work.

See this simple example curl asking RPI for the config via the API:

$ curl http://44.128.4.56:9181/api/config  
<html><head></head><body><h1>This is not the page you are looking for</h1><p>The file /api/config couldn't be found.</p></body></html>

I tried to install version 2.14.01 (the one that the x86 box runs right now) and the latest 2.17.01, and both show the same problem.

Reconnecting the ConBee II to the x86 box returns the expected output:

$ curl http://44.128.4.182:9181/api/config
{"apiversion":"1.16.0","bridgeid":"xx","datastoreversion":"93","devicename":"ConBee II","factorynew":false,"mac":"00:16:3e:42:00:b6","modelid":"deCONZ","name":"Phoscon-GW","replacesbridgeid":null,"starterkitid":"","swversion":"2.14.1"}%   

The above happens with and without moving the original .local/share/dresden-elektronik/deCONZ/ to the RPI.

This is the systemd service file that starts deCONZ:

# cat /etc/systemd/system/deconz-vnc.service 
[Unit]
Description=deCONZ: ZigBee gateway -- REST API
StartLimitIntervalSec=0

[Service]
User=deconz
ExecStartPre=+/usr/bin/chown deconz /dev/ttyACM0
ExecStart=/usr/bin/deCONZ -platform vnc --http-port=9181 --dev=/dev/ttyACM0
Restart=on-failure
RestartSec=30
#AmbientCapabilities=CAP_NET_BIND_SERVICE CAP_KILL CAP_SYS_BOOT CAP_SYS_TIME

[Install]
WantedBy=multi-user.target

Checksums for the installers:

$ sha256sum deconz_2.1*
682238ca46f9dad034ab0c2adbe5acdaea62d7634a5b1dd8a2158bf9d6df4312  deconz_2.14.01-debian-buster-stable_arm64.deb
ceecb87bd6f3711a837973fa99fcd92c20caff7c1edb92c7eb192d9cee875e9b  deconz_2.17.01-debian-buster-stable_arm64.deb

I’m clueless about what goes wrong with the RPI version of deCONZ.

Forgot to mention that the dongle and the network work on the RPI. If I connect to the deCONZ app via VNC, I can see the whole ZigBee network exchanging messages. It’s ‘just’ the API missing.

Hello, how have you installed deconz ?

What is the result of https://phoscon.de/discover

Hi, I installed it using the AUR ArchLinux package.

I don’t think that this would be the problem as both the original .deb and the resulting ArchLinux packages have the same contents:

Arch package contents:

tar tJvf deconz-2.14.01-3-aarch64.pkg.tar.xz | sort -k6 -V

https://0x0.st/oOKE.txt

Original .deb contents:

dpkg --contents deconz-2.14.01-x86_64.deb | sort -k6 -V

https://0x0.st/oOK6.txt

The only exception is that the arch package has systemd files under /usr/lib and not under /lib as the deb originally had them.

Discover returns an empty array ([]) in both scenarios. I personally never needed it as the Phoscon web app starts (loaded from the actual deCONZ HTTP listener) with querying the /api/config. It finds on the x86 host just fine. The RPI-hosted one, however, starts to netscan those ‘popular’ RFC1918 ranges for the gateway. Right after it could not find the /api/config endpoint (as per browser dev-tools).

When the browser requests for /api/config, deCONZ on RPI tries to find it as if it were a static file:

read(10, "GET /api/config HTTP/1.1\r\nHost: "..., 90) = 90
statx(AT_FDCWD, "/usr/share/deCONZ/webapp//api/config", AT_STATX_SYNC_AS_STAT|AT_SYMLINK_NOFOLLOW|AT_NO_AUTOMOUNT, STATX_ALL, 0xffffff1e27e8) = -1 ENOENT (No such file or directory)
write(5, "\1\0\0\0\0\0\0\0", 8)         = 8
write(10, "HTTP/1.1 404 Not Found\r\nContent-"..., 205) = 205

In case of the working x86 host, it does not consider files:

read(18, "GET /api/config HTTP/1.1\r\nHost: "..., 91) = 91
write(4, "\1\0\0\0\0\0\0\0", 8)         = 8
write(18, "HTTP/1.1 200 OK\r\nAccess-Control-"..., 409) = 409

All the library requirements are met both for the deCONZ binary and the libdeCONZ.so: https://0x0.st/oOP-.txt

RPI uname:

$ uname -a
Linux alarm 5.19.6-1-aarch64-ARCH #1 SMP PREEMPT Thu Sep 1 20:24:41 MDT 2022 aarch64 GNU/Linux

Ah, you are on Arch linux? That might be an explanation. AFAIK, its not in the supported OS list. Perhaps some dependencies missing.

I found this on github:

Perhaps this can help you?

Ah, yes, you are right dear sir. I should have checked all .so files in the package.

$ ldd /usr/share/deCONZ/plugins/libde_rest_plugin.so
	linux-vdso.so.1 (0x0000ffff9a220000)
	libdeCONZ.so.1 => /usr/lib/libdeCONZ.so.1 (0x0000ffff99e00000)
	libcrypt.so.1 => not found

It finds the library after installing libxcrypt-compat legacy compact package:

$ ldd /usr/share/deCONZ/plugins/libde_rest_plugin.so
	linux-vdso.so.1 (0x0000ffff83eea000)
	libdeCONZ.so.1 => /usr/lib/libdeCONZ.so.1 (0x0000ffff83ad0000)
	libcrypt.so.1 => /usr/lib/libcrypt.so.1 (0x0000ffff83a80000)

I’ll check if it gets REST plugin working when I get home.

Yes, and I was so preoccupied with having 1:1 converted .deb packages that I did not consider the chance of having some packages missing. Especially since the arch package is an actively maintained one. Well, it looks like they forgot to include this (arch only) dependency.

1 Like

Got home, it works perfectly. Thanks @Mimiix for the tip and @Smanar for the help.
:partying_face:

1 Like