Starting Modbus with Debug Level Tracing Enabled

With SmartServer 4.4 and higher, you can start the Modbus driver with debug level tracing enabled by following the steps below. Debug levels are DEBUG, ERROR, INFO (which is more verbose than WARN, but less verbose than DEBUG) and WARNAll logs are stored in /var/log/smartserver/smartserver-modbus.log.

  1. Open a terminal connection to SmartServer IoT.

  2. Stop the Modbus driver by entering the following command:

    ssctl stop modbus

    A result similar to the following appears:

    Example result
    modbus                             inactive since Tue 2024-07-09 12:27:24 EDT; 58ms ago
  3. Open the smartserver-modbus.service file by entering the following command:

    sudo nano /lib/systemd/system/smartserver-modbus.service

    The smartserver-modbus.service file appears.



  4. Append the ExecStart= line with --log-level <level> where <level> is DEBUG, ERRORINFO, or WARN.

    Example
    ExecStart=/usr/bin/apollo/modbus/echmodbus --log-level DEBUG
    


  5. Enter the following reload command:

    sudo systemctl daemon-reload


  6. Restart the Modbus driver by entering the following command:

    ssctl start modbus

    A result similar to the following appears:

    Example result
    modbus                             active since Tue 2024-07-09 12:47:48 EDT; 61ms ago