Latest Domoticz Update (Mai 2019)
Mai 10, 2019

About a week ago, a new stable version (4.10658) of Domoticz was made available. Normally, I would have waited a few weeks before proceeding with the update of the program and I would have saved the contents of the Raspberry Pi SD card before testing the new version. But I was tired, coming back from a trip of more than three weeks so that one of the two neurons I had left was not working. The other was concerned about the failure encountered with the VPN server installed shortly before leaving. While there was no direct link between the VPN and Domoticz servers, I clicked on the update button displayed by the latter in its Web page.

It was the first time I updated the software in this fashion. Previously I preferred to install new versions of Domoticz on a fresh copy of the most recent Raspbian distribution, copying the database of the home automation server after. I must admit that the update went very well without any of the problems I had encountered before because I often forgot to install some needed package. Hats off and thanks to the Domoticz developer team with Gizmocuz in the lead.

By the way, the update is done so quickly that Domoticz was back on line before the Raspberry Pi watchdog could bite. That was fortunate, because in my dazed state I had forgotten about the watchdog installed just before leaving.

Unfortunately, two problems came up very quickly. If you have encountered the same difficulties, please read to the end before following the steps described below, as there is a better solution than those I initially tried.

An authentication error was reported every 5 seconds or so. The log (Setup/Log) was quickly filling up with messages similar to these.

... 2019-0507- 14:04:43.447 Error: CheckAuthToken(ID=ba2a6efcab2819d0c939e57203b7dec0_MzFkN2I4NzctNGMyZS00ZTA1LWEwNWEtNDFjYjJhM2M1ZTcx) : session id not found 2019-0507- 14:04:48.489 Error: CheckAuthToken(ID=ba2a6efcab2819d0c939e57203b7dec0_MzFkN2I4NzctNGMyZS00ZTA1LWEwNWEtNDFjYjJhM2M1ZTcx) : session id not found 2019-05-07 14:04:53.532 Error: CheckAuthToken(ID=ba2a6efcab2819d0c939e57203b7dec0_MzFkN2I4NzctNGMyZS00ZTA1LWEwNWEtNDFjYjJhM2M1ZTcx) : session id not found ...

According to some answers on the Domoticz forum, this behaviour could be eliminated by erasing the web browser history. The results were mixed when I did this with Chrome on two Android tablets and Firefox on an Ubuntu desktop computer. After a while, the shower of error messages started again when I passed from one browser to another.

In addition, each of these messages gave rise to an email. Fortunately, it was easy to stop the flow of error emails by disabling the Send Errors as Notification option in the Email.

Image Domoticz: Setup/Settings/Email

Do not forget to click on the  Apply Settings  button for the change to take effect.

The other problem was more serious. When the Domoticz web page was accessed from an external network, it showed that the server was offline when that was clearly not the case since the server would not accept bad passwords. Besides, the log showed that the connection was correctly established.

... 2019-05-07 15:03:23.896 Status: Login successful from for user 'michel' 2019-05-07 15:03:23.897 Status: Incoming connection from: ...

Fortunately, the local area network was specified in the System settings so it was still possible to connect to the home automation server.

Image Domoticz: Setup/Settings/Sytem/Local Networks

The temporary solution for this problem was to add the public IP address of my network, which was then, to the list of local networks. When I confirmed that I could reach the server from this address because it did not present a login screen, I removed 192.168.0.* from the list of local networks. Trying to connect to Domoticz from a computer on the local network failed because again Domoticz reported it was offline after supplying the correct credentials at the login screen. This was proof that the problem was related to the authentication procedure and had nothing to do with accessing the server from a remote location.

Before returning to the forum to announce this discovery, I had the brilliant idea to check the list of issues in the Domoticz repository on Github. Finally, one of the neurons was firing a bit more often. I learned that not only were the bugs well known, but that a solution was already available in the beta version. Again I showed a lack of judgment in installing this version without saving anything before. Here is how I did it. In the Software Updates section of the System tab under the Setup/Settings menu, I changed the Release Channel from Stable to Beta. Then I clicked the  Apply Settings  button. Next, I selected the Check for Update choice in the Setup menu.

Image Domoticz: Setup/Settings/System/Software Updates

Finally, I clicked the update button to the new beta. The two problems mentioned were handled and Domoticz worked wonderfully as before.

While I was writing this post, I saw that a new stable release (4.10717) has been available since yesterday (May 9th). This time I saved a copy of the Raspberry Pi SD card before updating. I returned the release channel to stable and I updated to the newest stable version. Since then, there is no major problem. There remains a minor glitch. After changing settings Domoticz asks for login credentials even it is accessed from a client on one of the listed local networks (no username/password). As the password needs to be given only once and it can be avoided by clearing the web browser cache, harping on this is nit-picking.

All is well that ends well, at least for people who have a relatively simple system that works on Raspbian. The lesson from all this is obvious: no matter the circumstances, before updating any program of major importance, activate at least two neurons and make a backup to be able to go back to a working system if necessary.