Just thought I’d share a little project I’ve been playing with.
I recently picked up a line-us on ebay, and being a bit of a hardware hacker the first thing I did was play around with the machines various API’s. @rob was kind enough to grant me access to the BETA firmeware which comes with websocket support and I just found this so much fun.
For my project then I used the websockets API and connected it with Node RED and implemented a plotclock. For those who may not know, a plotclock is some kind of robot that draws the time on a whiteboard surface and then erases and redraws the time when it changes.
I’ve uploaded a couple of videos on instagram which you can find here and the node red flow for the project can be found here (it depends on the simple message queue and moment contrib nodes so you’ll need to make sure you have the installed too) and you’ll need to 3D print a little eraser which you can find my STL file here.
Ultimately the flow connects to the line-us machine then runs through a routine where it fetches the current time, then uses some predefined GCODE templates to generate the output GCODE required (shifting them along the print area). The GCODE is then pushed into a queue and is fed to line-us one by one. As the flow receives an OK message, it releases the next GCODE command until the current routine is complete. Once it is complete, it uses the HOME position ok response to trigger then next iteration. This time however the routine will wait in a loop until the time actually changes and then in the GCODE building node it also injects some initial GCODE to grab the eraser and clear the print area before plotting the the time again.
Overall it was a fun little project and am really happy I picked one of these little machines up.
The only things you should need to change are potentialy the time zone in the “moments” node and maybe the connection address (I ended up using the line-us ip address as it was more reliable than the line-us.local hostname). Other than that, there reset should stay the same.
Thanks for guiding - got node-red up and running and when importing your script and deploying some movements are occuring on the Line-us; is there a way to see / report whats happening during the script? I try to add message and see debugs but so far no luck
The line-us does make a “wave” movement when a connection is made / lost so that is to be expected, but otherwise it should just move based on the GCODE commands.
To debug you can connect any node to a the debug node to output what it’s payload is to the debug console on the right hand side, but for errors nested deep in a node you’d probably need to check the node-red error log.
I’ve run it here and it seems to work fine. Here’s what I did:
Download the flow from Matt’s GitHub
Install the two packages:
npm install node-red-contrib-simple-message-queue
npm install node-red-contrib-moment
In the node red gui, paste in the flow from the json file in 1. using import/clipboard
Double click on the flow tab and enable.
As Matt said, if your Line-us is waving that means you’re connecting OK - as he mentioned in his original post, using the mDNS name line-us.local can sometimes fail but if you’re not seeing the wave then you could try using the IP address of your Line-us.