Configuration by the Serial Console
Another way to configure the device is via a serial console. In case of the G01 - G03 Modbus gateways an additional USB/UART converter is needed.
For G01 - G03 gateways{{@177#bkmrk-procedure-to-enter-s}}
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 (orangeLED) 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 commands can be typed into the terminal.
{{@177#bkmrk-turn-off-the-power-o}}
For G14 - G16 gateways{{@177#bkmrk-procedure-to-enter-s-1}}
InstallSTM32 Virtual COM Port Driver.Turn off the power of the device.Connect Ethernet converter directly to the PC (the dedicated USB/UART converter is not obligatory).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 (yellowLED) lights up.Release the S1 button.Login using user’s personal credentials or default login details.If the process is successful, configuration commands can be typed into the terminal.
{{@177#bkmrk-install-stm32-virtua}}
List of all commands
{{@175#bkmrk-list-of-all-commands}}
{{@176#bkmrk-modbus-ports-configu}}
| {{@176#bkmrk-port_number-is-a-num}}
|
---|---|
{{@176#bkmrk-network-settings}}
| {{@176#bkmrk-changing-username-or}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Modbus ports configuration commands
modbusmodbus helpPrint command help.modbus int_addr VALUESet internal Modbus address.Example:modbus int_addr 5modbus idlet VALUEShow or set the idle TIME (in seconds) of the TCP connection after which the TCP connection is terminated by the converter and the TCP socket is released.Example:modbus idlet 720If a subcommand that normally sets a value is not given an argument, it will print the current value.Example:modbus idletSet idle time is 5000
modbus_portsmodbus_ports helpPrint command help, does not require com_number.modbus_ports PORT_NUMBER add_slaves [SLAVE_ADDR ;/- SLAVE_ADDR, *]Set all addresses of slaves connected to com_port. A star in value means fill rest free slaves. It means all slaves that are not set to other ports will be set to this one.Example:modbus_ports 1 addslaves 124Example:modbus_ports 1 addslaves 12-124Example:modbus_ports 1 addslaves 12;14;18Example:modbus_ports 1 addslaves 12;14-17;150-200Example:modbus_ports 1 addslaves 12;14-17;150-200, *modbus_ports PORT_NUMBER show_slavesShow addresses of slaves connected to com_port.Example:modbus_ports 1 showslavesmodbus_ports PORT_NUMBER mode [ascii/rtu]Set Modbus port mode to ASCII or RTU.Example:modbus_ports 2 mode asciimodbus_ports PORT_NUMBER baud [RATE]Set the baud rate to RATE. For a list of acceptable baud rates, please refer to the manual.Example:modbus_ports 1 baud 9600modbus_ports PORT_NUMBER bits [CPS]Set bit count to C, parity to P, and stop bits to S. Valid values are:C: 7, 8 or 9P: N, E or O (N- none, E- even, O- odd)S: 1 or 2Example:modbus_ports 1 bits 8N1Example:modbus_ports 2 bits 7O1modbus_ports PORT_NUMBER state [GATEWAY/ROUTER/DISABLE]Enable or disable uart functionality.Example:modbus_ports 1 state GATEWAYExample:modbus_ports 2 state DISABLEmodbus_ports PORT_NUMBER termination [on/off]Enable or disable termination on RS485 port.Example:modbus_ports 1 termination onmodbus_ports PORT_NUMBER slave_response_timeout TIMEOUTSet response timeout (serial slave) in ms. When this timeout expires, delayed frames are dropped.Example:modbus_ports 1 slave_response_timeout 2000If a subcommand that normally sets a value is not given an argument, it will print the current value.Example:modbus_ports 2 baudSet baud rate is 115200
PORT_NUMBER is a number of ports in modbus gateway and it is counted from 0.{{@176#bkmrk-user-helpprint-the-h}}
modbus_routingmodbus_routing helpPrint routing's help.modbus_routing showDisplay all active routing table in system.[LP]: [SLAVES NUMBERS] [IP/HOSTNAME] [PORT] [TIMEOUT]modbus_routing add SLAVE_ADDR HOSTNAME PORT TIMEOUTSLAVE_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 2000Example:modbus_routing add 18;25 192.168.0.10 502 2000Example:modbus_routing add 18-25 192.168.0.10 502 2000Example:modbus_routing add 18-25;* 192.168.0.10 502 2000Example:modbus_routing add 18-25 modbus.local 502 2000modbus_routing remove [HOSTNAME_NUMBER/all]Remove Modbus Routing Table record. HOSTNAME_NUMBER is line number from /show/ command.Example:modbus_routing remove 2Example:modbus_routing remove all
{{@177#bkmrk-service-mode}}
{{@177#bkmrk-procedure-to-enter-s-2}}
{{@177#bkmrk-turn-off-the-power-o-1}}
{{@177#bkmrk-procedure-to-enter-s-3}}
{{@177#bkmrk-install-stm32-virtua-1}}
Network settings{{@175#bkmrk-list-of-commands-in-}}
The following commands might be helpful to change network settings according to target LAN parameters,
ipconfigipconfig addr ADDRESSSet IP address to ADDRESS.Example:ipconfig addr 192.168.0.10ipconfig mask NETMASKSet subnet mask to NETMASK (in dot-decimal format).Example:ipconfig mask 255.255.255.0ipconfig mask BIT_COUNTSet subnet mask to BIT_COUNT bits.Example:ipconfig mask 24ipconfig gateway GATEWAY_IPSet network gateway to GATEWAY_IP.Example:ipconfig gateway 192.168.0.1ipconfig dhcp [enable/disable]Enable or disable DHCP client.Example:ipconfig dhcp enableipconfig dns1 ADDRESSSet primary DNS to ADDRESS, disable getting DNS from DHCP if enabled.Example:ipconfig dns1 192.168.100.1ipconfig dns2 ADDRESSSet secondary DNS to ADDRESS, disable getting DNS from DHCP if enabled.Example:ipconfig dns2 1.1.1.1
eth_maceth_mac helpPrint the help message.eth_mac defaultSet device’s MAC address to factory-default one.eth_mac set MAC_ADDRSet device’s MAC address to MAC_ADDR. Accepts both dash and colon-separated formats.Example:eth_mac set 01-02-03-04-05-06Example:eth_mac set 01:02:03:04:05:06
http_porthttp_port helpPrint the help message.http_port PORT_NUMBERSet http port to PORT_NUMBER. A PORT_NUMBER value must be in range: 1-65535.Example:http_port 80http_port statusPrint current http port.Example:http_port statusA current http port is 80
telnet_porttelnet_port helpPrint the help message.telnet_port PORT_NUMBERSet Telnet port to PORT_NUMBER. A PORT_NUMBER value must be in range: 1-65535.Example:telnet_port 23telnet_port statusPrint current Telnet port.Example:telnet_port statusA current telnet port is 23
modbus_tcp_portmodbus_tcp_port helpPrint the help message.modbus_tcp_port PORT_NUMBERSet http port to PORT_NUMBER. A PORT_NUMBER value must be in range: 1-65535.Example:modbus_tcp_port 502modbus_tcp_port statusPrint current Modbus port.Example:modbus_tcp_port statusA current modbus port is 502
Changing username or password
To change username or password, use user command.{{@175#bkmrk-command-description--1}}
Available commands:
user helpPrint the help message.user mod_name USER_NAME NEW_NAMEChange the user name to NEW_NAME. It fails if the name is used by another user.Example:user mod_name admin NEW_NAMEuser passwd USER_NAMEChange USER_NAME's password.Example:user passwd admin****** <- here is entered password, but '*' appears insteadNote: Everyone can change the password for themselves.
Service mode
Procedure to enter service mode for G01 - G03 gateways
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 (redLED) lights up.Release the S1 button.If the process is successful, service commands can be typed into the terminal.
Procedure to enter service mode for G14 - G16 gateways
InstallSTM32 Virtual COM Port Driver(if it was not done before).Turn off the power of the device.Connect Ethernet converter directly to the PC (the dedicated USB/UART converter is not obligatory).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 (redLED) lights up.Release the S1 button.If the process is successful, service commands can be typed into the terminal.
List of commands in service mode
|
|
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
In the service mode, the “ipconfig” command can only show a last static IP address.{{@175#bkmrk-in-the-service-mode%2C}}
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.
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)help").