Problem with UBUS Device Tracker

I noticed that the upgrade affects the installation in two ways: all the xtra packages get uninstalled, the acl file in /usr/share/rpcd/acl.d/user.json is deleted. You therefore have to start from scratch. On top of that 18.x seems to require the uhttpd-mod-ubus package.

One small caveat that tripped me up when I upgraded to the next minor version: you need to restart the services yourself by running /etc/init.d/rpcd restart && /etc/init.d/uhttpd restart after installing packages.

Another trick that helped me to arrive to this solution: the call that hass does to openwrt can be done manually using curl:

curl --data-ascii '{"jsonrpc": "2.0", "id": 1, "method": "call", "params": ["00000000000000000000000000000000", "session", "login", {"username": "root", "password": "<insert your password>"}]}' http://<router ip>/ubus/ -v

Thanks! I forgot to restart the services
 :weary:
I will submit an issue so they can change the documentation about UBUS and HA.

I was still looking into hardening the connection to ubus by limiting network access and shrinking the permissions to the minimum, because IMHO the description on the HA component is not really secure.

Just want to confirm that rf3141 solution worked for me. When I upgraded to OpenWRT 18.06 ubus to HA stopped working. I then upgraded to HA 0.77.3 but it did not solve the problem.
After:
opkg install uhttpd-mod-ubus
/etc/init.d/rpcd restart && /etc/init.d/uhttpd restart
It worked again.

Same issue when upgrading to 18.06. uhttpd-mod-ubus install seems to have resolved. :smiley:

What is the expected response?
Trying to debug my setup, this is what I get:

*   Trying 192.168.0.1...
* TCP_NODELAY set
* Connected to 192.168.0.1 (192.168.0.1) port 80 (#0)
> POST /ubus/ HTTP/1.1
> Host: 192.168.0.1
> User-Agent: curl/7.54.0
> Accept: */*
> Content-Length: 158
> Content-Type: application/x-www-form-urlencoded
> 
* upload completely sent off: 158 out of 158 bytes
< HTTP/1.1 404 Not Found
< Connection: Keep-Alive
< Transfer-Encoding: chunked
< Keep-Alive: timeout=20
< Content-Type: text/html
< 
* Connection #0 to host 192.168.0.1 left intact

Anything in the 200 range. I will run the call on my setup in the morning.

I have noticed that the installed packages are gone when you upgrade openwrt. I have had to reinstall the packages after each upgrade. Maybe that is the reason you get a not found?

Thank you for your reply!

Turns out I did not have all the required packages installed. When I wasn’t able to install uhttpd-mod-ubus ("Unknown package") I somehow assumed that it was no longer required for 19.x. Turns out I first had to update opkg. :man_facepalming:

I guess that is going to be first contribution to the documentation :upside_down_face: