Based on this info Websockets | Wiki.js, just poll at a reasonable rate and parse the status. This board runs a version of CircuitPython that doesnāt support web sockets, so just connecting a socket to telnet port 23.
Now that it works, a bunch of other things to do like display different coordinate systems, maybe even add a few buttons (since you can send commands,) enclosure, etc. Right now itās just the mode, MPos:x, y, z, and a clock that is synced via Adafruit.IO
Ahh, I see youāve fallen down the same rabbit hole as me. Watch out, next thing you know, youāll be building an entire pendant!
You could use an NTP (Network Time Protocol) server like pool.ntp.org. Thatās a more standard way to sync time but if Adafruit works, thatās good too.
Indeed. It was built in to the demo code I started with, so figured Iād stick with it! Pretty impressed with circuit python, Adafruit has libs for everything!
Haha. Iām not even sure what this is for, or why itās useful, since I already have the fluid dial. But, I could hang it on the wall since it has a clockā¦
Since youāve treaded this path, do I just grab the other coordinate offsets from $# and do the math myself? (displaying something other than mpos) Need to take a stroll through the codeā¦
I havenāt done this but I believe you take the WCO values from the status string and use those offsets to calculate based on the MPos. Those WCO values arenāt displayed every time. Or thereās another command to get all of the workspace offsets.
Sounds good. I find it strange that those random bonus values show up in the status string, but Iām sure thereās a good reason. Iām enjoying poking around with it, and glad they added the telnet connections, since I canāt do websockets with this specific platform (and donāt want to compete with webUI for the websocket anyway.)
FluidNC does this slightly differently than ESP3D, so this is one of the things I had to fix for WebUI-3 to work for us.
All of the status updates should contain MPos, which is the current machine position from Home
WCO is the āWorkspace coordinate offsetā and that is only given every 10 updates I believe, unless a change triggers it to update sooner.
For instance, issuing G56 then G54 continuously will give you new offsets every time, since you are changing workspaces.
So if you want the current position in active workspace coordinates, you have to save and/or update the current offset any time it comes in, and apply it to machine position yourself.
That WebUI code is in .\src\targets\CNC\FluidNC\filters.js if you are interested, but probably not overly useful as a āgo byā for Arduino/ESP32 C++ code
Note that instead of issue status requests with ā?ā, you can still do auto-reporting with telnet so it only sends an update when something changes. Iām currently using $Report/Interval=100 (although that 100 might be a bit aggressive).
Excellent, thanks for all the info. Iāll put up the code when Iām done hacking on this thing. For some reason I wasnāt finding that Automatic Reporting page, so thanks for that!
Iāve added a repo at GitHub - fkcurrie/fluidnc-ledscreen to enable similar functionality. Itās using real-time position monitoring via WebSocket - the latency is pretty good. Also using the Adafruit LED Bonnet on a Raspberry Pi5. There is a py script as well as all that is needed to containerize it via docker. Hopefully the docs make the install relatively clear and easy.