nornagon / saxi

Tools & library for driving the AxiDraw pen plotter
GNU Affero General Public License v3.0
472 stars 55 forks source link

"Couldn't acquire wake lock" message on Pi #174

Closed andypiper closed 1 year ago

andypiper commented 1 year ago

Raspberry Pi 4B OS: Raspbian GNU/Linux 11 Node: 20.4.0 AxiDraw firmware version: 2.8.1

Server listening on http://[::]:9080
Found EBB at /dev/ttyACM0
Received plan of estimated duration 9m31s
Beginning plot...
Couldn't acquire wake lock. Ensure your machine does not sleep during plotting
Plot took 1m34s
Received plan of estimated duration 8m53s
Beginning plot...
Couldn't acquire wake lock. Ensure your machine does not sleep during plotting
Plot took 9m1s

I'm also seeing the same issues with the firmware check as described in #150

alexrudd2 commented 1 year ago

I'm also seeing the same issues with the firmware check as described in #150

@andypiper Does the code here work for you? https://github.com/nornagon/saxi/pull/176

andypiper commented 1 year ago

yes, thanks @alexrudd2 that fixes the CLI firmware message / gets back the version and outputs an expected TODO error message. No change on the wake lock that I can see, but that's not unexpected.

andypiper commented 1 year ago

Since the wake-lock module is macOS-only, it may be worth wrapping the call to WakeLock() in src/server.ts with an os-check, to avoid this warning - until I looked at both the saxi and wake-lock module code, I didn't know that this was not something I needed to worry about on a Pi.

alexrudd2 commented 1 year ago

@andypiper Can you try either of the linked PRs and see if this works for you? (one's here, one's a fork). @jedahan did exactly as you suggested with an OS check wrapper.