FluidNC Wireless RGB LED Display thingy

I had a screen and microcontroller Overview | Adafruit MatrixPortal M4 | Adafruit Learning System in a box from Adafruit from a few years back. I realized it had wifi, so, I started yet another little project :smile:

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

5 Likes

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ā€¦

1 Like

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.

1 Like

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.)

1 Like

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

3 Likes

It looks like you can change $Report/Status=0 and then it will show WPos in the status string instead of MPos:

http://wiki.fluidnc.com/en/features/commands_and_settings#reportstatus

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).

1 Like

You can, but, at least for WebUI, we display both.

So the math has to happen either way.

Regardless of which mode itā€™s in, both sets of coordinates are updated with the relevant saved WCO being applied to whichever one needs it.

But for a home-built display, if you only want workspace coords, that should work

2 Likes

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.

1 Like

Awesome! I kinda lost interest in it, but perhaps Iā€™ll fire it up in some future form!