lux4rd0 / sense-collector

Sense Collector provides a way of collecting real-time data from the Sense Energy Monitor. Includes Grafana dashboards for visualizations of detected devices and smart plugs and their wattage, voltage, and amp utilization.
https://labs.lux4rd0.com/sense-collector/
GNU Affero General Public License v3.0
25 stars 4 forks source link

Error messages: sleep #6

Closed jeff47 closed 2 weeks ago

jeff47 commented 1 year ago

Hello, I've got this working but there is a persistent error in the logs:

Try 'sleep --help' for more information.

sleep: invalid option -- '1'

I went through the .sh scripts and tried to see which call was causing the error, but I couldn't work it out. But I suspect that if one of the scripts isn't sleeping as it should be, it may be polling much more frequently than designed.

jeff47 commented 1 year ago

Enabling all the debug options reveals what I think is the problem:

sense-collector  | host-performance: Sleeping: -1.4476 seconds
sense-collector  | sleep: invalid option -- '1'

I was able to correct this by adding this environmental variable: SENSE_COLLECTOR_PERF_INTERVAL: 60

I think this line in start-host-performance.sh needs a sanity check, as well as a default value for $perf_interval.

delay=$(echo "scale=4;(${perf_interval}-($after-$before) / 1000000000)" | bc)

paradizelost commented 1 year ago

Can also confirm that setting SENSE_COLLECTOR_PERF_INTERVAL does eliminate the error

lux4rd0 commented 2 weeks ago

The new version doesn't need the sleep features anymore to handle interactions. Try it out! Thanks!