Update and upgrade problems Raspberry - Linux - node.js - Nmp

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
koen076
Posts: 6
Joined: Monday 04 March 2019 19:29
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Belgium
Contact:

Update and upgrade problems Raspberry - Linux - node.js - Nmp

Post by koen076 »

Hi there,

I have a problem with my Raspberry system. Since, I guess, January 2019, I have a Raspberry Pi, for my Domoticz. For the connection with my iPhones, I use Homebridge. I never used a Raspberry before, so I was, and still am, a bit of a nitwit in the world of Linux.

So I downloaded a version of Linux, with a pre-installed Homebridge. I could install Domoticz with a little help, and it worked for quite a long time. I did the updates of Homebridge, as well as for the plug-ins and Domoticz. I also made backups of Domoticz and made images of the system.

But since March this year I couldn't update Domoticz anymore. As soon as Domotics started, it crashed immediately. So I installed an old image and didn’t do the updates anymore. Later I fount out that I had to upgrade my Linux Debian from version Stretch to Buster.

I also had to update Homebridge. But there started the problem. I also had to upgrade node.js (and npm?). But I couldn’t. I did upgrade according to the tutorial on GitHub (https://github.com/oznu/docker-homebridge) , but it didn't work out. Well, after the upgrade, when I did a check, the version was upgraded, but according to the System Information of Homebridge itself, it still gives the old version number for node.js as well as npm.

According to Homebridge, this is the system information:
OS: Alpine Linux (3.8.1)
Node.js Version: v10.13.0
Npm Version: v6.4.1
Storage Path: /homebridge
Config Path: /homebridge/config.json
Plugin Path: /homebridge/node_modules
Docker: Yes

Then I studied the information of the Homebridge on GitHub better and figured out this:
• While not recommended, if you are using the "Ubuntu" or "Debian" variant of the image, you can also update inside the container using hb-service update-node and then restarting manually. Users running the "Alpine Linux" variant cannot use hb-service update-node.

• It is important to update Node.js using the same method you originally used to install it, or using hb-service update-node.
Do not update Node.js using instructions you found on some random site on the internet.
Avoid nvm or n - these are great tools for developers, but require additional configuration when running Homebridge as a service user.
Failing to adhere to these guidelines will likely result in you having multiple copies of Node.js installed which will cause many strange problems (if you have done this, see how to fix it on Linux and macOS).
So, as far as I can see, I have Alpine Linux, and I don't know how Homebridge was ever installed, because it was already installed on the image from where I started.

I also tried to start with a newly installed system, but when I do so, I don't get a stable system when I import my Domoticz backup file. I guess, because of the Homebridge plugins I installed and Domoticz uses?

So I think I need the 'old' Alpine version, upgraded to Buster, Homebridge updated, and now figure out how node.js is installed.

Can someone please give me some info how I can update node.js and npm? Is there a possibility to find out how these were installed and how I can do a proper node.js and npm update?

Or, may be better, how can I get my system back working again, with a stable Domoticz with the backup of the current configuration, Homebridge, Apple Home and the used plugins.

Thanks!
User avatar
erem
Posts: 230
Joined: Tuesday 27 March 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Amsterdam/netherlands
Contact:

Re: Update and upgrade problems Raspberry - Linux - node.js - Nmp

Post by erem »

i strongly suspect your problems originate in using a docker container.

I would suggest you save your domoticz database and scripts and start over on a new sd card

- install raspbian buster (https://www.raspberrypi.org/documentati ... ng-images/)
- install domoticz (Raspberry Pi/Ubuntu installation: 'curl -sSL install.domoticz.com | sudo bash')
- install node.js (sudo apt-get install nodejs )
- install homebridge (https://github.com/homebridge/homebridg ... untu-Linux)
- install edomoticzhttps://www.npmjs.com/package/homebridge-edomoticz
Regards,

Rob
koen076
Posts: 6
Joined: Monday 04 March 2019 19:29
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Belgium
Contact:

Re: Update and upgrade problems Raspberry - Linux - node.js - Nmp

Post by koen076 »

Hi Rob,

Thank you for your reaction.
I already tried this, and I also prefer this way you describe.
But when I restore my Domoticz database on a 'new' system, Domoticz crashes.
And my Domoticz configuration is quite large, too large to create a whole new one.

May be it crashes because of Homebridge plugins or hardware I installed on the old system. So I installed the plugins on the new system, but without any result. I disabled hardware items that were in relation with the plugins, again no result.
The plugins I installed on Homebridge are:
- Homebridge Dummy
- Homebridge Sonos
- Homebridge Config UI X
- Homebridge Zp
- Homebridge Edomoticz
The other hardware I have are:
- 2x Philips Hue Bridge
- Xiaomi gateway
- Buienradar
- Homewizard
- OpenZWave USB
- RFXCOM - RFXtrx433 USB
- Onkyo AV Receiver (LAN)

So I prefer to reinstall my Raspberry Pi, so it will be up to date again. But then I struggle to restore the database for a stable Domoticz system.
I really hope someone can help me with this.

Koen
User avatar
erem
Posts: 230
Joined: Tuesday 27 March 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Amsterdam/netherlands
Contact:

Re: Update and upgrade problems Raspberry - Linux - node.js - Nmp

Post by erem »

Koen,

I would try to start bringing up Domoticz without homebridge and with all plugins disabled.
Once Domoticz works, you can always re-add homebridge.
I have read somewhere in this forum a way to disable all plugins with sqlite, but cannot find that post anymore
EDIT: FOUND IT: viewtopic.php?f=6&t=34761
maybe @waaren can help here.

Another thing is the database version is tied to the version of Domoticz.
A mismatch here can also lead to problems.
I do not know of any table that relates versions of Domoticz to version of database (found in table preferences, key DB_Version)
Again, maybe Waaren can help you there, he is very knowledgeable about the things

i hope it works out for you.
Regards,

Rob
koen076
Posts: 6
Joined: Monday 04 March 2019 19:29
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Belgium
Contact:

Re: Update and upgrade problems Raspberry - Linux - node.js - Nmp

Post by koen076 »

Hi Erem,

The Domoticz database versions are equal.
I really hope @waaren can help me.

Thanks again for your reaction and looking for that certain post.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Update and upgrade problems Raspberry - Linux - node.js - Nmp

Post by waaren »

koen076 wrote: Thursday 10 December 2020 11:05 The Domoticz database versions are equal.
@koen076,

did you already try to start domoticz after restoring the database on the newly installed system?
and

Code: Select all

sudo apt install sqlite3
sudo service domoticz stop # just to be sure
cd <domoticz dir> # replace with the directory where domoticz is installed
sudo sqlite3 domoticz.db "update hardware set enabled = 0 " # Disable all hardware 
sudo sqlite3 domoticz.db "select nvalue from preferences where key = 'DB_Version'" # Datbase version
sudo domoticz --version # this shows the domoticz version
sudo service domoticz start
If domoticz then still crash do:

Code: Select all

sudo ./domoticz 
And share the output

If domoticz does not crash, enable the hardware from within the GUI one by one until a crash occurs. This to identify which hardware module is causing the crash
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
AllesVanZelf
Posts: 265
Joined: Monday 05 February 2018 8:42
Target OS: Raspberry Pi / ODroid
Domoticz version: 12467
Location: Netherlands, near Haarlem
Contact:

Re: Update and upgrade problems Raspberry - Linux - node.js - Nmp

Post by AllesVanZelf »

Nodejs is at version 15 now. Maybe there is one of the problems.

Code: Select all

curl -sL https://deb.nodesource.com/setup_15.x | sudo -E bash -
see here: link
Domoticz 2020.1 (12230) on Raspberry Pi 3B with Raspian Buster. Besides Domoticz, Rpi is running Pi-Hole.
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Update and upgrade problems Raspberry - Linux - node.js - Nmp

Post by EddyG »

OS: Alpine Linux (3.8.1) is quite old (from 11-09-2018)
It might be the same lib problem as between stretch/buster.
What is the output of?

Code: Select all

ldd --version
koen076
Posts: 6
Joined: Monday 04 March 2019 19:29
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Belgium
Contact:

Re: Update and upgrade problems Raspberry - Linux - node.js - Nmp

Post by koen076 »

YESSS!!
It works again. I am so happy!
It was the plugin of Homewizard that made the crash. I should have kicked out that thing, but some 868MHz temp sensors work pretty well on distances. And my Raspberry Pi has no 868MHz receiver.
Thank you @erem and @waaren!!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest