Hello,
It is a common problem for Raspberri PI that after some time, the SD cards could be corrupted due to constant system writings etc. I am trying to make Zwave2Mqtt as reliable as possible, so here what I did:
removed :
dpkg --purge rsyslog
apt-get remove --purge wolfram-engine triggerhappy cron anacron logrotate dphys-swapfile fake-hwclock
apt-get autoremove --purgedpkg --purge rsyslog
apt-get remove --purge wolfram-engine triggerhappy cron anacron logrotate dphys-swapfile fake-hwclock
apt-get autoremove --purge
installed:
apt-get install --no-install-recommends busybox-syslogd ntpdate watchdog unionfs-fuse
turn down system logs, swap and turned on fastboot: in /boot/cmdline.txt added logo.nologo fastboot noswap.
What could be the next steps to do?
By the way, what you think, is it possible to create Zwave2Mqtt Read-Only system?
Best regards
By the way, what you think, is it possible to create Zwave2Mqtt Read-Only system?
Yes sure, but I have 0 experience in such things. The only files that I wrote are all inside store directory of z2m app
Thanks for the comment,
BTW, I am using sudo iotop -o -a to check what files are written on SD card
Let me know if you make progreess with this. Is so could you create a section in readme or an issue to explain how you did?
Sure, if I will manage to do this :)
@prisikarm I have a mostly read-only implementation of Zwave2MQTT by using this config:
{
"mqtt": {
"name": "Mosquitto",
"host": "mosquitto",
"_ca": "",
"ca": "",
"_cert": "",
"cert": "",
"_key": "",
"key": "",
"port": 1883,
"reconnectPeriod": 10,
"retain": true,
"auth": true,
"username": "",
"password": "",
"prefix": "homeassistant",
"qos": 1,
"clean": false
},
"gateway": {
"values": [],
"type": 0,
"payloadType": 1,
"hassDiscovery": true,
"ignoreStatus": true,
"retainedDiscovery": false
},
"zwave": {
"port": "/dev/ttyNVT0",
"networkKey": "",
"saveConfig": false,
"configPath": "/usr/local/etc/openzwave/",
"pollInterval": 2000,
"assumeAwake": true
}
}
The only thing I need to address is the OZW_Log.txt which is constantly appended to but I haven't had time to address this since the stdout logging depends on the file. For me out would be enough to log to directly to stdout since I am running a container.
Then the only file next to the settings.json is the ozwcache.xml. @robertsLando what is the exact function of this file?
Edit: dove in the code and open-zwave has no option to just log to stdout and always creates a file. I will open an issue for this over at open-zwave.
Opened the issue:
https://github.com/OpenZWave/open-zwave/issues/2160
Relevant code in Zwave2MQTT:
https://github.com/OpenZWave/Zwave2Mqtt/blob/0635ece9ff994c7307415b16594812342997ab8c/lib/ZwaveClient.js#L120-L132
Where cfg is the zwave section in the settings.json
https://github.com/OpenZWave/Zwave2Mqtt/blob/be5e356eaf41b24530e4c487f6ed39e9f78fbb25/app.js#L50
Then the only file next to the settings.json is the ozwcache.xml. @robertsLando what is the exact function of this file?
@wilmardo That is an OZW file, it's used as cache for devices infromations like valueids, name, locations etc...
@robertsLando That is an absolute necessity of the open-zwave client? It is the last file which needs addressing to get a stateless Zwave2MQTT.
I moved the settings.json to an external location (for now with a patch):
https://github.com/LANsible/docker-zwave2mqtt/blob/master/stateless.patch
For some background for this patch, here is the same change I proposed for Zigbee2MQTT:
https://github.com/Koenkk/zigbee2mqtt/pull/2519
Is this something you are willing to merge? I would love to open a PR for the change :) I don't know if the path.join(...paths) to path.resolve(...paths) breaks existing setups.
I don't know if the path.join(...paths) to path.resolve(...paths) breaks existing setups.
Do you really need this? I'm ok for others and I would be glad to review a PR, I'm not so sure if resolve will break someting
UPDATE: Based on my search on the code it should not break anything. But if you can even make it work witout that it would be better
@robertsLando That is an absolute necessity of the open-zwave client? It is the last file which needs addressing to get a stateless Zwave2MQTT.
Not having it present would increase the startup times of OZW as it has to "re-interview" all devices. Not recomended as people complain a lot about the startup times as it is.
i would suggest your best bet would be to use a cheap usb stick to mount where the files that do change, or mount a network volume if you've got something more robust elsewhere in the network.
i basically run it as an immutable container in Kubernetes with a nfs volume mount to my NAS for the things that change.
I would however check that you're doing something to either provide an easy way to mount RW regularly to update zwave2mqtt or you're isolating it enough on the network to protect against the impact of security vulns that come up on either this project or any of the dependencies.
Closing the conversation since it's pretty old, please reopen if you see necessary
Most helpful comment
Not having it present would increase the startup times of OZW as it has to "re-interview" all devices. Not recomended as people complain a lot about the startup times as it is.