# Commands

##### Modbus ports configuration commands

- **modbus**
    - **modbus help**  
        Print command help.
    - **modbus int\_addr VALUE**  
        Set internal Modbus address.  
          
        Example:  
        modbus int\_addr 5
    - **modbus idlet VALUE**  
        Show 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 720  
          
        If a subcommand that normally sets a value is not given an argument, it will print the current value.  
          
        Example:  
        modbus idlet  
        Set idle time is 5000
- **modbus\_ports**
    - **modbus\_ports help**  
        Print 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 124  
          
        Example:  
        modbus\_ports 1 addslaves 12-124  
          
        Example:  
        modbus\_ports 1 addslaves 12;14;18  
          
        Example:  
        modbus\_ports 1 addslaves 12;14-17;150-200  
          
        Example:  
        modbus\_ports 1 addslaves 12;14-17;150-200, \*
    - **modbus\_ports PORT\_NUMBER show\_slaves**  
        Show addresses of slaves connected to com\_port.  
          
        Example:  
        modbus\_ports 1 showslaves
    - **modbus\_ports PORT\_NUMBER mode \[ascii/rtu\]**  
        Set Modbus port mode to ASCII or RTU.  
          
        Example:  
        modbus\_ports 2 mode ascii
    - **modbus\_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 9600
    - **modbus\_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 9  
        P: N, E or O (N- none, E- even, O- odd)  
        S: 1 or 2  
          
        Example:  
        modbus\_ports 1 bits 8N1  
          
        Example:  
        modbus\_ports 2 bits 7O1
    - **modbus\_ports PORT\_NUMBER state \[GATEWAY/ROUTER/DISABLE\]**  
        Enable or disable uart functionality.   
          
        Example:  
        modbus\_ports 1 state GATEWAY  
          
        Example:  
        modbus\_ports 2 state DISABLE
    - **modbus\_ports PORT\_NUMBER termination \[on/off\]**  
        Enable or disable termination on RS485 port.   
          
        Example:  
        modbus\_ports 1 termination on
    - **modbus\_ports PORT\_NUMBER slave\_response\_timeout TIMEOUT**  
        Set response timeout (serial slave) in ms. When this timeout expires, delayed frames are dropped.  
          
        Example:  
        modbus\_ports 1 slave\_response\_timeout 2000  
          
        If a subcommand that normally sets a value is not given an argument, it will print the current value.  
          
        Example:  
        modbus\_ports 2 baud  
        Set baud rate is 115200

<p class="callout info">PORT\_NUMBER is a number of ports in modbus gateway and it is counted from 0.</p>

- **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
- **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
- **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  
    \*\*\*\*\*\* &lt;- here is entered password, but '\*' appears instead  
      
    Note: Everyone can change the password for themselves.