Can I send a batch of coordinates to Line-us at once


Background: I’ve successfully sent individual coordinates to my line-us using python3 on a Raspberry Pi using the g01 commands from here. (Thank you for putting that together!)

Objective: I would like to increase the speed of my line-us’s drawing because I’m feeding it many very precise coordinates. That being said, I’m currently limited by the pace of the for-loop I’m running to send the coordinates to the line-us on each iteration. My sense is that the Line-us is the faster processor and so I’m hoping there is a way to remove the dependency on the for loop (and the Raspberry Pi), whether via the ordered approach/steps below (though I’m open to other alternatives).

Question: Do you have any suggestions for how to send a batch of coordinate commands (I’m guessing a txt file containing these commands) to the Line-us so that I can do this:

  1. rpi runs the for-loop in its entirety
  2. rpi writes all x,y,z coordinate sets to a (perhaps txt) file
  3. rpi sends the file to Line-us
  4. Line-us executes against the file

Do you have any thoughts?

Thank you!


Try using the websockets API. You still send one command at a time but it’s faster than the plain sockets method as the requirement to wait for every command to be acknowledged is less critical.


Thanks for the prompt reply, Rob! I don’t have experience with websockets, so am doing my best to patch together some examples and the documentation you have. If there are specific examples that you think would be particularly helpful, feel free to send them my way; will keep you updated.

Hi Rob,

I was able to get my line-us working using websockets, but I’m finding that my line-us only successfully connects over websockets about 20% of the time (with no modifications in between attempts). The other 80% of the time, I receive the error shown in the screenshot. Do you have any suggestions?