New FluidNC HTTP Commands

This is a very interesting pull request that was just completed into main (not in a release yet but will be in 4.0.2). It would allow for some interesting abilities like sending commands or getting data from home assistant or other APIs.

8 Likes

Indeed. Very interesting!

That would be awesome to know. Things like being able to turn my dust collection on/off that is already set up in HA would be sweet.

1 Like

I’d teach it to say lines from Command and Conquer or Starcraft… :stuck_out_tongue:

1 Like

Destination?

Affirmative!

4 Likes

I am old, I need Start Trek or Star Wars

:rofl:

2 Likes

“Make it so”

2 Likes

Number 1. Oh oh wait, how about “Q”

We’re going in FULL THROTTLE, that oughtta keep those tie fighters off our backs.

Well, that was fun. I setup Home Assistant on Docker, built that latest main of FluidNC and put it on my Eggbot. I tied Home Assistant to Alexa, created a webhook, and after resolving some firewall issues, I can now run this gcode command which gets Alexa to say “Alexa says hello to FluidNC!”.

$HTTP/Command=@alexa_speak_start

I have a file on flash called http_settings.json which contains:

{
  "tokens": {
    "ha_url": "192.168.0.145:8123",
    "ha_token": "[token from Home Assistant goes here]"
  },

  "commands": {
    "alexa_speak_start": "http://${ha_url}/api/webhook/fluidnc-alexa-speak{\"method\":\"POST\",\"headers\":{\"Authorization\":\"${ha_token}\",\"Content-Type\":\"application/json\"},\"body\":\"{\\\"message\\\":\\\"Alexa says Hello to FluidNC!\\\"}\"}"
  }
}

Umm, you could do a lot of crazy things with this.

Also, WebDAV is pretty cool:

With the WebDAV changes, you could also do stuff like create a custom interface, upload say test.html.gz to flash, and go to http://fluidnc.local/flash/test.html and get to that interface while still keeping the WebUI. Before, you could only download the file if you went to http://fluidnc.local/test.html, it wouldn’t render in the browser. That opens up some things too.

2 Likes

Hopefully Fluidnc 4 with stabilize soon. It would be nice to be able to send a gcode file from MillMage or Lightburn to the SD card using WebDAV. I remember the MillMage guys mentioning it a while back on Discord.

1 Like

I’m pretty optimistic about 4.0.2.

1 Like

FluidNC v4.0.2 was just released. I’ll be testing this one as I believe it may be stable now. (If you’re relatively new, don’t try it yet until we’ve done some testing.)

4 Likes

4.0.2 and there is a slightly newer webui, 3.0.10.

2 Likes

“He’s dead, Jim”

“I canna doit cap’n, I donna have the pwrrr!”

“Set phasers to stun”

1 Like