Skip to content
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

Saxi becomes unresponsive while plotting, and Axidraw starts/stops too #194

Closed
lostPixels opened this issue Oct 14, 2023 · 7 comments · Fixed by #195
Closed

Saxi becomes unresponsive while plotting, and Axidraw starts/stops too #194

lostPixels opened this issue Oct 14, 2023 · 7 comments · Fixed by #195

Comments

@lostPixels
Copy link

lostPixels commented Oct 14, 2023

I'm running Saxi remotely on a RPI and experiencing some odd behavior when plotting. The UI becomes unresponsive, and the Axidraw sputters. The oddest thing is that the machine will return to normal function if the UI is closed. This has led me to quickly closing the tab once I hear the stepper engage, which doesnt always eliminate the possibility that the steppers will sputter and lose alignment.

Ive experienced this with many different SVGs of various complexities.

In the attached image you can see the http response time grow to be quite large.

Also included is a video of the Axidraw as it sputters: https://imgur.com/a/pq8US58

Saxi version: 0.15.0
Node Version: v18.16.1
Using NVM: Yes
Raspberry Pi version: 4
Axidraw: V3/A3 (newest Firmware)

Plot File: 20mb~ SVG

Update: Downgrading to version 0.13.0 will resolve this issue for now.

Screenshot 2023-10-14 at 9 08 46 AM
@jedahan
Copy link
Contributor

jedahan commented Oct 14, 2023

As a sanity check, i looked at the length of a serialized plan for the following svg.

svg is 800kb, JSON.stringify().length / 1024 / 1024 = 9.26 Megabytes

I generally expect the rendered paths to be much larger than the svg (vector to raster, all that jazz), but this seems a bit excessive.

If its a matter of timing and blocking on the server, there might be simple fixes, like enabling gzip support.

If its a memory usage thing, we might want to try more compact representations.

This might be a red herring, but its a start.

test

@jedahan
Copy link
Contributor

jedahan commented Oct 14, 2023

Note that I have experienced this issue, and was able to stop it completely by removing WebSerial support from the repo. It would be ideal to fix webserial though, see alexrudd2#89

@alexrudd2
Copy link
Collaborator

I think this is the same as #131

It's harder to reproduce on more powerful hardware, but most people on RPi's usually see it intermittently

@alexrudd2
Copy link
Collaborator

@lostPixels

Can you try the code in this pull request: alexrudd2#113 and see if it helps any?

@lostPixels
Copy link
Author

Hey @alexrudd2 , I spent a while this morning getting the dev version on to my RPI but couldnt get it to run, I kept getting Error: listen EADDRINUSE: address already in use :::9080

I can report though that moving back down to 0.13.0 had resolved my glitching issue for now.

@alexrudd2
Copy link
Collaborator

Hey @alexrudd2 , I spent a while this morning getting the dev version on to my RPI but couldnt get it to run, I kept getting Error: listen EADDRINUSE: address already in use :::9080

OK, that's usually pretty straightforward. Something is running on your computer on port 9080, either another instance of saxi or some other program. You can either restart the machine or pass e.g. --port 9081.

@jedahan
Copy link
Contributor

jedahan commented Oct 18, 2023

Next steps might be to figure out how to profile memory usage after loading a plan, and then see what changes help.

Following https://nodejs.org/en/docs/guides/diagnostics/memory .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants