# Configuration by the Serial Console ## Modbus Ethernet Wi-Fi Gateways (G11 - G13) Another way to configure the device is via a serial console. In case of the G11 - G13 Modbus gateways an additional USB/UART converter is needed. ##### Procedure to enter serial console mode - Turn off the power of the device. - Connect Ethernet converter to the dedicated USB/UART converter via the microUSB port. - Connect the USB/UART converter to the PC. - Open the serial console (default baud rate is 115200 bps). - Press and hold the S1 button. - Turn on the power. - Wait until the ST indicator (orange LED) lights up (it should light up after red light - service mode). - Release the S1 button. - Login using user’s personal credentials or default login details. - If the process is successful, configuration command can be typed into the terminal. [](https://doc.redisage.com/uploads/images/gallery/2024-03/a5a95447-11ad-467f-afc0-dd83c392aa44.png) ### List of all commands
**Command** | **Description** |
help | Print the help. |
conn | Print active TCP connections. |
net\_stat | Print lwIP statistics. |
eth\_mac | Print or change MAC address. |
wifi\_mac | Print or change Wi-Fi MAC address |
ipconfig | Print or change the network configuration. |
http\_port | Print or change default http port. |
telnet\_port | Print or change default telnet port. |
modbus\_tcp\_port | Print or change modbus port. |
ping | Check internet connection with the desired host. |
defaults | Reset application variables to defaults |
restart | Restart the system. |
user | Print or change user configuration. |
sys\_heap\_usage | Print current heap usage. |
modbus | Print or changes modbus settings. |
modbus\_ports | Print or changes modbus ports settings. |
modbus\_routing | Print or change modbus routing settings. |
wificonf | Wi-Fi interface configuration |
exit | Exit console. |
PORT\_NUMBER is a number of ports in modbus gateway and it is counted from 0.
- **modbus\_routing** - **modbus\_routing help** Print routing's help. - **modbus\_routing show** Display all active routing table in system. \[LP\]: \[SLAVES NUMBERS\] \[IP/HOSTNAME\] \[PORT\] \[TIMEOUT\] - **modbus\_routing add SLAVE\_ADDR HOSTNAME PORT TIMEOUT** SLAVE\_ADDR with HOSTNAME PORT is used by uarts working in Modbus router mode. TIMEOUT (in ms) is used to close the connection if a slave is not responding. The maximum records is 8. One record for one address/ip. Example: modbus\_routing add 18 192.168.0.10 502 2000 Example: modbus\_routing add 18;25 192.168.0.10 502 2000 Example: modbus\_routing add 18-25 192.168.0.10 502 2000 Example: modbus\_routing add 18-25;\* 192.168.0.10 502 2000 Example: modbus\_routing add 18-25 modbus.local 502 2000 - **modbus\_routing remove \[HOSTNAME\_NUMBER/all\]** Remove Modbus Routing Table record. HOSTNAME\_NUMBER is line number from /show/ command. Example: modbus\_routing remove 2 Example: modbus\_routing remove all ##### Network settings The following commands might be helpful to change network settings according to target LAN parameters, - **ipconfig** - **ipconfig addr ADDRESS** Set IP address to ADDRESS. Example: ipconfig addr 192.168.0.10 - **ipconfig mask NETMASK** Set subnet mask to NETMASK (in dot-decimal format). Example: ipconfig mask 255.255.255.0 - **ipconfig mask BIT\_COUNT** Set subnet mask to BIT\_COUNT bits. Example: ipconfig mask 24 - **ipconfig gateway GATEWAY\_IP** Set network gateway to GATEWAY\_IP. Example: ipconfig gateway 192.168.0.1 - **ipconfig dhcp \[enable/disable\]** Enable or disable DHCP client. Example: ipconfig dhcp enable - **ipconfig dns1 ADDRESS** Set primary DNS to ADDRESS, disable getting DNS from DHCP if enabled. Example: ipconfig dns1 192.168.100.1 - **ipconfig dns2 ADDRESS** Set secondary DNS to ADDRESS, disable getting DNS from DHCP if enabled. Example: ipconfig dns2 1.1.1.1 - **wificonf** - **wificonf stassid SSID** SSID of target AP (Access Point). Example: wificonf ssid SSID - **wificonf stapass PASSWORD** Password of target AP. Example: wificonf stapass PASSWORD - **wificonf connect** Try to connect to the configured AP - **wificonf disconnect** Disconnect from the AP. - **wificonf scan** Scan Wi-Fi networks - **wificonf restore** Restore factory Wi-Fi settings. - **eth\_mac** - **eth\_mac help** Print the help message. - **eth\_mac default** Set device’s MAC address to factory-default one. - **eth\_mac set MAC\_ADDR** Set device’s MAC address to MAC\_ADDR. Accepts both dash and colon-separated formats. Example: eth\_mac set 01-02-03-04-05-06 Example: eth\_mac set 01:02:03:04:05:06 - **wifi\_mac** - **wifi\_mac help** Print the help message. - **wifi\_mac default** Set device’s MAC address to factory-default one. - **wifi\_mac set MAC\_ADDR** Set device’s MAC address to MAC\_ADDR. Accepts both dash and colon-separated formats. Example: eth\_mac set 01-02-03-04-05-06 Example: eth\_mac set 01:02:03:04:05:06 - **http\_port** - **http\_port help** Print the help message. - **http\_port PORT\_NUMBER** Set http port to PORT\_NUMBER. A PORT\_NUMBER value must be in range: 1-65535. Example: http\_port 80 - **http\_port status** Print current http port. Example: http\_port status A current http port is 80 - **telnet\_port** - **telnet\_port help** Print the help message. - **telnet\_port PORT\_NUMBER** Set Telnet port to PORT\_NUMBER. A PORT\_NUMBER value must be in range: 1-65535. Example: telnet\_port 23 - **telnet\_port status** Print current Telnet port. Example: telnet\_port status A current telnet port is 23 - **modbus\_tcp\_port** - **modbus\_tcp\_port help** Print the help message. - **modbus\_tcp\_port PORT\_NUMBER** Set http port to PORT\_NUMBER. A PORT\_NUMBER value must be in range: 1-65535. Example: modbus\_tcp\_port 502 - **modbus\_tcp\_port status** Print current Modbus port. Example: modbus\_tcp\_port status A current modbus port is 502 ##### Changing username or password To change username or password, use user command. Available commands: - **user help** Print the help message. - **user mod\_name USER\_NAME NEW\_NAME** Change the user name to NEW\_NAME. It fails if the name is used by another user. Example: user mod\_name admin NEW\_NAME - **user passwd USER\_NAME** Change USER\_NAME's password. Example: user passwd admin \*\*\*\*\*\* <- here is entered password, but '\*' appears instead Note: Everyone can change the password for themselves. ### Service mode ##### Procedure to enter service mode - Turn off the power of the device. - Connect Ethernet converter to the dedicated USB/UART converter via the microUSB port. - Connect the USB/UART converter to the PC. - Open the serial console (default baud rate is 115200 bps). - Press and hold the S1 button. - Turn on the power. - Wait until the ST indicator (red LED) lights up. - Release the S1 button. - If the process is successful, service commands can be typed into the terminal. #### List of commands in the service mode**Command** | **Description** |
help | Print the help. |
credits | Print current credits value for this device. |
dev\_ident | Print the device identification value. |
restart | Restart the system. |
serial\_num | Print the serial number of this device. |
version | Display the bootloader version. |
xmodem | Download image to the internal flash using xmodem. |
defaults | Reset application variables to defaults. |
ipconfig | Print or change the network configuration. |
flash\_read | Read bytes from flash memory. |
md | Read bytes from memory address. |
In the service mode, the “ipconfig” command can only show a last static IP address.
##### Factory reset To restore default settings, type “defaults”. After that, user will be asked for type “default network” to reset the network settings as well. Then user will be informed if the process is successful. Default login details: \- login: **admin** \- password: **admin123** \- IP: **192.168.100.100** ### Additional notes In order to avoid issues like connecting to host, type “help” to get more information. To get more details about every particular command, append “help” after each commands (example: "ipconfig help").