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 WARN. All logs are stored in /var/log/smartserver/smartserver-modbus.log.
- Open a terminal connection to SmartServer IoT.
Stop the Modbus driver by entering the following command:
ssctl stop modbus
A result similar to the following appears:
Example resultmodbus inactive since Tue 2024-07-09 12:27:24 EDT; 58ms ago
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.
Append the ExecStart= line with --log-level <level> where <level> is DEBUG, ERROR, INFO, or WARN.
ExampleExecStart=/usr/bin/apollo/modbus/echmodbus --log-level DEBUG
Enter the following reload command:
sudo systemctl daemon-reload
Restart the Modbus driver by entering the following command:
ssctl start modbus
A result similar to the following appears:
Example resultmodbus active since Tue 2024-07-09 12:47:48 EDT; 61ms ago