1.
Overview
3 Steps:Install Arduino IDE,Reload code to M100,Start to test.
The [Link] to download : The library file is downloaded to the specified path,others to the
common folder.
Arduino IDE
Serial Drivers
Demo source code
Library file:download to the path:computer--document--Arduino--libraries
2. Arduino IDE Environment Setting
2.1 Download Arduino IDE
2.2 Install Arduino IDE
2.3 Install ESP32 development board
1> Setting Boards Manager URLs
File->Preference->Add Additional Boards Manager URLs:
[Link]
2> Install ESP32 development board:Boards Manager-->Search ESP32-->Install, this will take a
few minuets, please waiting.
2.4 Install Library
Download Library:there need 10 library file to compile normally and load code to M100: 3 files
from PUSR’s library,left 7 doc. From Arduino library:
1> PUSR library files:USR_IO、AWS_IOT、ArduinoRS485.
Download the files to the path:computer--document--Arduino--libraries.
2> There need to install all the below files in the Arduino library:
ArduinoModbus、AsyncTCP、CRC、ESPAsyncWebServer、Ethernet、OneButton、PubSubClient。
Install file:take the ArduinoModbus installing for example.
Click ”Library Manager”--> Search ”ArduinoModbus”--> Click ”INSTALL”
After finishing,can find the files in:Computer--Document--Arduino--libraries
2.5 Instructions for Library Files
ArduinoModbus: query/set parameters of M100-ARD through modbus command
ArduinoRS485: RS485/232 communication
AsyncTCP:TCP communication
CRC:CRC verification for Modubs
ESPAsyncWebServer:webpage developement
Ethernet: ethernet port communication
OneButton: deal with button activition
PubSubClient: MQTT Client
USR_IO: test for IO expansion board
AWS_IOT:connection with Amazon platform
2.6 View Arduino Official Document
In Arduino website,view more instructions of Arduino IDE.
3. Load the code onto M100
3.1 Hardware Prepare
1. 12V/1A power adaptor*1
2. USB to TTL cable*1
3. WiFi antenna*1
4. USB to 485/232 serial cable*1
5. USR-M100-ARD*1
Ports Indicate:
Power M100-ARD,indicator blinking, the device successfully started
Connect M100-ARD and computor through USB to TTL cable,work indicator keep light.
In the device manager,you can find the COM port which will be used for the programm
[Link] need to install serial drive if no COM port.
3.2 Compile and Load the program
1> Open source demo code
2> Select the right ESP32 developement board: Tools-->Board-->ESP32-->ESP32-WROOM-DA
Module
3> Select download port:Tools-->Port-->COM port
4> Click Verify:recheck the code
5> Upload:Compile the code and upload to M100-ARD which will take about several min.
a. Power off the M100-ARD
b. Click Upload button
c. While it appears the content in the red frame,holding the reload button and power on the
device,then keep hold the reload [Link] need to try several time unit it is workable.
d. Once the downloading starts normally like below,can release the reload button.
Wait until the programm is loaded.
e. Disconnect the download cable,powe on [Link] until it starts successfullly.(WORK
light blinking),then proceed to the functional test.
4. Demo Function Test
4.1 WiFi connection
PC connect wifi of M100-ARD
SSID:USR-M100-ARD_xxxx, xxxx means the last four numbers of MAC address.
Password:012345678
4.2 Login Webpage
Enter [Link] in the browser,login webpage.
1 dout config:control DO on/off
2 wifi_sta_mode: set M100-ARD as STA mode to connect the AP
3 wifi_SOFP_AP_mode: set M100-ARD as AP mode
4 TCP mode:set M100-ARD to TCP
5 MQTT mode: set M100-ARD to MQTT
4.3 DO Controlling Test
Click OUT1_ON, control DO1 to on/off.
Check that the DO1 indicator on the M100-ARD is light.
4.4 STA mode
Click ”wifi_sta_mode”-->”sta_wifisetting”-->set AP’s ssid and password-->submit
5. Common Questions
An error as shown in the following figure occurs during the compilation process. How to solve it?
This error indicates that the corresponding library file is missing,Install the corresponding library
in the following path by following instructions in 2.4 Installing a Library :
D:\Document\Arduino\libraries