normen / rpi-throttled

Node.js library to check for undervoltage and overheating events on a Raspberry Pi
1 stars 0 forks source link

TypeError: Cannot read property 'on' of undefined #1

Open Meach opened 4 years ago

Meach commented 4 years ago

Hey!

I am getting this error in my application:

........../node_modules/rpi-throttled/lib.js:23 command.stdout.on('data',this.setData.bind(this)); ^

TypeError: Cannot read property 'on' of undefined at RpiThrottled.update (........../node_modules/rpi-throttled/lib.js:23:22)

I have a simple file that calls "update()" function every 5 seconds, indefinitely. After few hours, it crashes with error above. Any idea what I could do? Should I use the synchronous version instead?

Cheers

normen commented 4 years ago

Apparently the command line process that's executed every time the data is updated couldn't be started for some reason. At any instance, checking every five seconds seems a bit excessive, I'd start with lowering that frequency first. Starting the command line environment, executing the command - all of that may take more than 5 sec.

Meach commented 4 years ago

Thank you for answering. I will increase the time between and see if that fixes it.