-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The service is not running continuously and stops. #2
Comments
That looks like you have something funky in the configurations. There might be a bug in my code as well, that's not outruled by any means, but I should be able to reproduce this, therefore I'd like to see the configuration you have (without the credentials obviously) 🙂 |
Here is the example configuration that you should have: mqtt_protocol: mqtt
mqtt_host: core-mosquitto
mqtt_port: 1883
mqtt_credentials:
client_id: ruuvi-gw-mqtt-to-ha
username:
password:
mqtt_ha_topic: homeassistant/
mqtt_ruuvi_topic: ruuvi/#
mqtt_parsed_ruuvi_topic: ruuvi/parsed/
update_interval: 60
decimals:
humidity: 2
temperature: 2
pressure: 2
battery: 0
voltage: 2
battery:
minimum: 2000
maximum: 3000
low_battery: 2100
use_prefixes: true |
Hi, this was working before.. Or it was running 1-3 months before it stopped and needed a new manual start. My configuration looks the same as yours: mqtt_protocol: mqtt |
Hmm, weird.. It looks as if the ruuvitag didn't have humidity set. Well, anyway, I'll make this a bit more robust soon |
I added a bit more logging in the version 2.0.2, if you could try with that and once your service restarts, check the Logs and paste a portion (preferably where the restart occurs) of it here, to help me investigate what's the issue at hand. 🙂 |
Hi, 2.0.2 is not stopping but there are some error messages in the log: at Writable.writable._write (/ruuvigw2ha/node_modules/mqtt/lib/client.js:335:5) |
Have you updated RuuviTag firmwares or bought new ones or something? It looks as if the ruuvitag-parser is unable to parae both |
Hi, the firmwares are the newest available. There are three types of Ruuvitags in the system. Two Pro sensors have no pressure and a third Ruuvi Pro has also no humidity. These are the sensors:
|
Oooh, okay. I haven't even tried with Pro sensors. These might not work properly.. |
I wasn't even aware that some of the sensors might not broadcast all the data. I should make it so that if e.g. humidity or pressure doesn't exist, then it wouldn't even try to read it. As per now, it relies on the assumption that every piece of data (humidity, pressure, temperature, battery, acceleration) exists on every RuuviTag. |
Hi, the service is not running continuously and stops. Here ere are error messages from the log:
/ruuvigw2ha/index.js:116
humidity: Number(humidity.toFixed(options.decimals.humidity || 2)),
^
TypeError: Cannot read properties of undefined (reading 'toFixed')
at handleData (/ruuvigw2ha/index.js:116:33)
at MqttClient. (/ruuvigw2ha/index.js:39:5)
at MqttClient.emit (node:events:527:28)
at MqttClient._handlePublish (/ruuvigw2ha/node_modules/mqtt/lib/client.js:1277:12)
at MqttClient._handlePacket (/ruuvigw2ha/node_modules/mqtt/lib/client.js:410:12)
at work (/ruuvigw2ha/node_modules/mqtt/lib/client.js:321:12)
at Writable.writable._write (/ruuvigw2ha/node_modules/mqtt/lib/client.js:335:5)
at doWrite (/ruuvigw2ha/node_modules/readable-stream/lib/_stream_writable.js:409:139)
at writeOrBuffer (/ruuvigw2ha/node_modules/readable-stream/lib/_stream_writable.js:398:5)
at Writable.write (/ruuvigw2ha/node_modules/readable-stream/lib/_stream_writable.js:307:11)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
The text was updated successfully, but these errors were encountered: