printers-for-people / ACEResearch

Anycubic ACE Pro Reverse Engineering
3 stars 0 forks source link

Investigate packet drops #8

Open Jookia opened 1 week ago

Jookia commented 1 week ago

During the dryer-power-cycle strace this line of events happened:

There's two issues here:

First, Anycubic doesn't seem to be locking access to the ACE when sending and receiving RPCs. This seems like it could be a problem during printing maybe? Who knows. Maybe they just forgot a lock for this part of code.

Second, for some reason only 64 bytes of a get_info is being received. The only thing that makes sense to me is that the ACE's logic is something along the lines of this:

This would mean:

When I say 'output 64 bytes of buffered data', I mean send a USB CDC packet which is up to 64 bytes long. Linux buffers these between read() calls, which in theory means you could read while it's still sending packets, though in practice it seems that it reads are far apart enough that all data is sent by then, no handshaking needed.