-
Notifications
You must be signed in to change notification settings - Fork 0
Debugging
This page explains how to debug a system running with PSEC.
In order to activate the debugging facilities, the file /etc/default/grub must be modified.
Add the sequence DEBUG=ON (with a space before if needed) at the end of the line GRUB_CMDLINE_LINUX_DEFAULT.
Disabling the splash screen might be necessary to see boot messages. In this case add the option nosplash to the kernel command line in GRUB during the boot or in the
file /etc/default/grub at the end of the line GRUB_CMDLINE_LINUX_DEFAULT.
The main debugging channel uses the RS-232 serial port of the system when it has one. Otherwise an USB-serial device can be used as long as its chipset is recognized by the kernel embedded in the sys-usb DomD.
After connecting a serial cable (RS-232 or USB), a serial connection can be opened with the following settings:
- speed: 9 600 bps
- bits : 8
- parity : none
- stop bits: 1
After opening a serial connection a login prompt is opened.
If no login has been provided in the topology file the session can be opened as root.
After logging in the system, the MQTT broker can be queried using the command mosquitto_sub and connect it on the local MQTT socket located at /vr/run/mqtt_msg_local.sock.
For example:
$ mosquitto_sub --unix /var/run/mqtt_msg_local.sock -t '#' --pretty -v
PSEC provides scripts for messages debugging:
-
/usr/lib/psec/bin/show-messages.shconnects to the MQTT broker and displays all the messages with their payload. -
/usr/lib/psec/bin/show-logs.shconnects to the MQTT broker and displays all the logging messages (and only them).
When in debug mode the following log files are created:
| Location | Description |
|---|---|
| /var/log/psec/messages.log | This log contains all MQTT messages. |
There are two ways of knowing whether debug is activated:
- On Dom0 :
$ grep -i debug=on /proc/cmdline - Using the Api :
Api().request_system_info(). The JSON returned containscore.debug_onwhich is a boolean. Example :
{
"core": {
"version": "2.0.0",
"debug_on": true
}
}