Google Chat: zj734465502@gmail.com
+86-0755-88291180
sales01@spotpear.com
dragon_manager@163.com
services01@spotpear.com
manager01@spotpear.com
WhatsApp:13246739196
Generally, Wifi configuration includes the following three modes:
1. AP mode (Access Point mode):
Configure the wireless router or wireless access point as the primary network entry point. In this mode, the device acts as the center of the network, allowing other devices to connect to it so that they can access the internet or local network resources. AP mode is commonly used to create a wireless local area network (WLAN).
2. STA mode (Station mode):
STA mode configures a wireless device as a client to connect to an existing wireless network, typically an access point (AP) mode device. In STA mode, the Wi-Fi module can receive wireless signals from other devices or routers and access the internet or other network resources through that wireless network.
3. AP + STA mode (or Repeater mode):
AP+STA is a combination mode that allows a device to function as both an Access Point and a Station simultaneously. In this mode, the device can connect to an existing wireless network (STA mode) while also creating a new wireless network (AP mode) that allows other devices to connect to it and access the internet or other network resources. This mode is often used to extend the coverage range of a wireless network and relay the signal to more distant areas.
RoArm-M2-S is shipped with the default configuration of WiFi in AP mode. If you wish to change it to a different mode, you can achieve this by entering the corresponding JSON commands in the JSON command input box on the web interface or through serial/USB communication. Below, we will explain the specific meanings of the JSON commands related to WiFi configuration.
First, you can use the CMD_WIFI_ON_BOOT command to set the default operation mode of WiFi after booting the robotic arm.
{"T":401,"cmd":3}
The following introduces the meaning of JSON command in different modes of WiFi.
{"T":402,"ssid":"RoArm-M2","password":"12345678"}
By using this command, the robotic arm will establish a Wi-Fi hotspot, allowing other devices (e.g., smartphones, and computers) to connect to this hotspot. Since the default mode is AP mode when it leaves the factory, there is no need to use this command initially to set the AP mode.
{"T":403,"ssid":"yourWiFiName","password":"yourWiFiPassword"}
Using this command, the robotic arm will connect to an existing wireless network. The wireless network will assign an IP address to the robotic arm, which will be displayed on the second line of the OLED screen. This IP address can be used for JSON command communication via HTTP requests.
Note: If the robotic arm is set to STA mode for the first time, it will automatically switch to AP+STA mode. If it fails to connect to an existing Wi-Fi network after 15 seconds, the robotic arm will automatically switch to AP mode.
{"T":404,"ap_ssid":"RoArm-M2","ap_pawword":"12345678","sta_ssid":"yourWiFiName","sta_password":"yourWiFiPassword"}
Using this command, the robotic arm will connect to an existing Wi-Fi network while simultaneously creating a hotspot named "RoArm-M2." In this mode, the OLED screen will display the Wi-Fi name of the AP on the first line and the IP address assigned by the wireless network on the second line.
The above explanations provide the meanings of various JSON commands for configuring different WiFi modes.
View WiFi configuration information by using CMD_WIFI_INFO, input:
{"T":405}
The return value is shown below:
{"ip":"192.168.10.90","rssi":-50,"wifi_mode_on_boot":3,"sta_ssid":"yourWiFiName","sta_password":"yourWiFiPassword","ap_ssid":"RoArm-M2","ap_password":"12345678"}
The following introduces the command to generate a WiFi configuration file.
WiFi configuration file storage in wifiConfig.json of Flash. When you store the content for the first time, the file will be created. The content of the file is shown below:
{"wifi_mode_on_boot":3,"sta_ssid":"JSBZY-2.4G","sta_password":"waveshare0755","ap_ssid":"RoArm-M2","ap_password":"12345678"}
{"T":406}
The following message will be fed back after the input:
{"info":"/wifiConfig.json created.","wifi_mode_on_boot":1,"sta_ssid":"JSBZY-2.4G","sta_password":"waveshare0755","ap_ssid":"RoArm-M2","ap_password":"12345678"}
{"T":407,"mode":3,"ap_ssid":"RoArm-M2","ap_password":"12345678","sta_ssid":"JSBZY-2.4G","sta_password":"waveshare0755"}
Finally, you can turn off WiFi by using CMD_WIFI_STOP.
{"T":408}
This section describes what it means to use the JSON commands for robot arm WIFI configuration and return to the RoArm-M2-S main interface to learn more aspects of robot arm use.