Skip to content

WiFi Configuration

The ESP32 on the RoArm-M2-S supports three WiFi modes. The mode persists across reboots via a configuration file stored in flash.

ModeCodeDescription
Off0WiFi disabled
AP1Arm creates its own access point
STA2Arm joins your existing network
AP+STA3Both simultaneously (default)

Create a standalone access point. Useful for field operation without a router.

Set AP credentials:

{"T":402,"ssid":"RoArm-M2","password":"12345678"}

Enable AP-only mode on boot:

{"T":401,"cmd":1}

Connect to the RoArm-M2 network, then access the web interface at 192.168.4.1.

WiFi settings are saved to a wifiConfig.json file in the ESP32’s flash storage. Two ways to create it:

From current running config:

{"T":406}

From explicit parameters:

{"T":407,"mode":3,"ap_ssid":"RoArm-M2","ap_password":"12345678","sta_ssid":"YourNetwork","sta_password":"YourPassword"}

The arm reads this file on boot and applies the saved configuration automatically.

Query the current WiFi state:

{"T":405}

Returns the current mode, SSID, IP address, signal strength, and MAC address.

To stop WiFi (until next reboot):

{"T":408}

If you only need serial control, disable WiFi entirely:

{"T":401,"cmd":0}

Once connected via WiFi, open the arm’s IP address in a browser. The built-in web application provides:

  • Joint angle sliders
  • XYZ coordinate control
  • Gripper open/close
  • Mission recording and playback
  • WiFi and servo configuration

Web application interface Image: Waveshare

T-CodeCommandDescription
401CMD_WIFI_ON_BOOTSet WiFi mode at boot (0/1/2/3)
402CMD_SET_APConfigure AP SSID and password
403CMD_SET_STAConfigure STA SSID and password
404CMD_WIFI_APSTAConfigure AP+STA simultaneously
405CMD_WIFI_INFOQuery current WiFi status
406CMD_WIFI_CONFIG_CREATE_BY_STATUSSave current config to flash
407CMD_WIFI_CONFIG_CREATE_BY_INPUTSave explicit config to flash
408CMD_WIFI_STOPDisconnect WiFi

WiFi configuration reference from Waveshare Wiki and firmware source json_cmd.h.