FluidNC Wifi and Bluetooth Setup - Longus/FluidNC GitHub Wiki
FluidNC Wifi and Bluetooth Setup
Status
This document is incomplete and evolving daily. Suggestions are encouraged.
Wifi or Bluetooth
The ESP32 cannot do wifi and Bluetooth at the same time because there is only one radio. Both take use a lot of code space, so we have 2 versions of the pre-compiled firmware (wifi & bt). Install the one you plan to use. You can still choose the noradio and wifibt options if you compile yourself. See this page for more details.
WiFi Settings
All of the radio options are set with $
commands and not via the config file. This was done to help make sure you have a stable radio setup while developing and fine tuning your config file. The list of settings available depends on whether you are using WiFi or Bluetooth. You will not see the Bluetooth options while using the WiFi firmware.
Below are all the settings.
STA refers to "Station" which would be your local wifi. Send $STA
to see all the current values.
- $Sta/SSID This is the SSID (service set identifier) of you local WiFi router.
- $Sta/Password This is the password for you local WiFi router.
- $Sta/IPMode (DHCP or Static) Typically your router will give you an address to use at the time of connection. Use DHCP for that mode. If you have set up your router to use a specific address, use the Static mode.
- $Sta/IP Set this to an IP address if you are using Static mode, otherwise the value is ignored.
- $Sta/Gateway
- $Sta/Netmask
AP refers to "Access Point". This is a WiFi access point on the ESP32. Send $AP
to see all the current values.
- $AP/SSID This is the SSID name for the access point. The default is "FluidNC"
- $AP/Password The password will not be show when you request the current value. The default password is
12345678
- $AP/IP
- $AP/Channel
Other settings
-
$System/Hostname
-
$Http/Enable
-
$Http/Port
-
$Telnet/Enable
-
$Telnet/Port
-
$WiFi/Mode (AP, Off, STA or STA>AP) This is the mode the wifi will use. STA>AP means it will attempt to use STA, then fall back to AP mode
-
$Notification/Type
-
$Notification/T1
-
$Notification/T2
-
$Notification/TS
Passwords
There are no commands to tell you the current password. This offers a little bit of security. Someone with direct access to the ESP32 can dump the flash memory and find the password. For better security you should use a network firewall.
Note: Your console does not know you are sending a password, so it will be displayed as you type it.
WiFi STA DHCP Address
In this mode your router will assign an address. You will be able to see it in the startup messages. In the case below it is 192.168.1.19
. You would use this as the address in your web browser.
[MSG:INFO: STA SSID Barts-WLAN DHCP]
[MSG:INFO: Connecting.]
[MSG:INFO: Connecting..]
[MSG:INFO: Connecting...]
[MSG:INFO: Connected - IP is 192.168.1.19]
[MSG:INFO: WiFi on]
[MSG:INFO: Start mDNS with hostname:http://fluidnc.local/]
[MSG:INFO: SSDP Started]
[MSG:INFO: HTTP Started]
[MSG:INFO: Telnet Started on port 23]
Troubleshooting
Failing to Connect
This is an example of failing to connect in STA mode and switching to AP mode.
[MSG:INFO: STA SSID Barts-WLAN DHCP]
[MSG:INFO: Connecting.]
[MSG:INFO: Connecting..]
[MSG:INFO: Connecting...]
[MSG:INFO: Connecting....]
[MSG:INFO: Connecting.]
[MSG:INFO: Connecting..]
[MSG:INFO: Connecting...]
[MSG:INFO: Connecting....]
[MSG:INFO: Connecting.]
[MSG:INFO: Connecting..]
[MSG:INFO: AP SSID FluidNC IP 10.0.0.1 mask 255.255.255.0 channel 1]
[MSG:INFO: AP started]
[MSG:INFO: WiFi on]
[MSG:INFO: Captive Portal Started]
[MSG:INFO: HTTP Started]
[MSG:INFO: Telnet Started on port 23]
Connect to an External Network
Using AP mode for production is not recommended, use it only for the initial setup. The AP core code from Espressif seems to have problems that we have been unable to isolate, and that might be too deep in the SDK for us to fix. As a workaround, consider a dedicated external AP. It does not need to be a modern high performance one, an old one from the junk box will probably be just fine.
Users routinely use WiFi connected tablets running WebUI. Both the tablet and the FluidNC controller can connect to an external network which can be a collection of routers from a couple of generations back. Even better performance would be expected from a dedicated AP.
Use of a USB/Serial Cable
USB is always available as a fallback - and FluidNC will also fallback to AP mode if if fails to connect to an external AP in STA mode.
You cannot use WebUI via a USB connection. Instead you must use some other sender like UGS on a connected computer. There are also senders that run on computers connected either via Bluetooth, or serial (with some amount of extra effort to get a USB serial port into the tablet hardware/software setup).
Use of Bluetooth
If you are having WiFi connection problems, perhaps Bluetooth would be more reliable in your specific environment, it is unknowable. You will just have to try it.
Electrical Noise
Spindles or other high power motors can generate a lot of electrical noise that can cause interference with WiFi and Bluetooth radios. One way to determine if they are part of the problem is to run "air cut" test jobs with the spindle turned off, to see if the disconnects stop.
If the spindle turns out to be part of the problem, search the web for advice on how to filter and shield its power connections.
Modifying WebUI
WebUI is separate code written in JavaScript. It can certainly be customized if you have the requisite coding skills.
Signal Strength
Check the signal strength of the target WiFi with $Wifi/ListAPs
. It is in JSON format because it is primarily used by the WebUI and senders.
{"AP_LIST":[{"SSID":"Barts-WLAN","SIGNAL":"82","IS_PROTECTED":"1"},{"SSID":"4ag2hc1lj2ek7","SIGNAL":"32","IS_PROTECTED":"1"},{"SSID":"TheWIFI-2","SIGNAL":"30","IS_PROTECTED":"1"}]}
Special Characters
SSIDs and password often use special characters. See this FAQ note on character limitations.