uThing::MNL Configuration¶
The uThing::MNL device can be configured through its serial interface using two distinct modes: Interactive and JSON.
Configuration Modes¶
Interactive Mode
The interactive mode is designed for simplicity and ease of use directly from a serial terminal. All commands are a single character followed by the Enter key.
For example, to send the C command via a Linux/macOS terminal, you would use:
$ printf 'C\n' > /dev/ttyACM0
JSON Mode
The JSON mode is intended for programmatic control. Commands are sent as a valid JSON object string. You can combine multiple commands into a single JSON object.
For example, to enable the LED, set the reporting period to 30 seconds, and change the format to CSV all at once, you would send:
{"led":true,"reportingPeriod":30,"format":"CSV"}
Note
For both modes, the device returns a status report after every command to confirm that it was received and processed correctly.
Commands¶
Below are the available commands to configure the uThing::MNL.
Reporting Format¶
This command changes the format of the periodic data output.
| Command | Format |
|---|---|
J |
JSON |
C |
CSV |
M |
Human-Readable |
| Command | Format |
|---|---|
{"format":"json"} |
JSON |
{"format":"csv"} |
CSV |
{"format":"human"} |
Human-Readable |
Reporting Period¶
This command changes how often the device sends a data report. In some cases, like when performing data collection for long periods of time (weeks, months), it's convenient to reduce the reporting frequency and avoid overloading a database with unneeded granularity.
| Command | Reporting Period |
|---|---|
1 |
1 second (default) |
2 |
10 seconds |
3 |
30 seconds |
4 |
1 minute |
5 |
10 minutes |
6 |
30 minutes |
7 |
1 hour |
| Command | Reporting Period |
|---|---|
{"reportingPeriod":<seconds>} |
An integer from 1 to 3600. |
LEDs¶
This command enables or disables the onboard status LEDs.
| Command | State |
|---|---|
E |
Enabled |
D |
Disabled |
| Command | State |
|---|---|
{"led":true} |
Enabled |
{"led":false} |
Disabled |
Save Configuration¶
This command saves the current settings to the device's permanent flash memory. The saved configuration will be retained after the device is unplugged and reconnected. This command is only available in JSON mode.
| Command | Detail |
|---|---|
{"saveConfig":true} |
Stores the current configuration in Flash memory. |
Status¶
This command retrieves the device's current configuration and status.
| Command | Detail |
|---|---|
S |
Retrieves device info, configuration, and uptime. |
Example Response:
--------------------------------------------------------
*** Device: "uThing::MNL rev.A" -- Status:
Reporting period: 1 sec, Format: JSON, Uptime: 2189513 ms, Serial #: 28AE9B978CFE249B, FW: v1.0.3
--------------------------------------------------------
| Command | Detail |
|---|---|
{"status":true} |
Retrieves the current configuration and uptime. |
Example Response:
{
"status": {
"reportingPeriod": 1,
"format": "JSON",
"upTime": 1802065
}
}
Device Info¶
This command retrieves static information about the device hardware, firmware, and serial number. This command is only available in JSON mode.
Interactive Mode
In Interactive mode, this information is already included in the Status command (S).
| Command | Detail |
|---|---|
{"info":true} |
Retrieves device hardware, firmware, and serial number. |
Example Response:
{
"info": {
"device": "uThing::MNL rev.A",
"serial": "28AE9B978CFE249B",
"firmware": "1.0.3"
}
}
Help & Commands Summary¶
Invalid Command Response¶
In interactive mode, sending an invalid character (e.g., h) will print a help message summarizing the available commands.
-------------------------------------------------------
*** Invalid option.
Use: [m] Human readable, [j] JSON, [c] CSV, [s] Status, [e/d] enable/disable LED
Reporting Period: [1] 1 sec, [2] 10 sec, [3] 30 sec, [4] 1 min, [5] 10 min, [6] 30 min, [7] 1 hour.
--------------------------------------------------------
Commands Summary Table¶
The table below summarizes the commands available in firmware v1.0.3.
| Command | Interactive | JSON | Description |
|---|---|---|---|
| Format | J, C, M |
{"format":"<string>"} |
Change reporting format (JSON, CSV, HUMAN) |
| Period | 1-7 |
{"reportingPeriod":<integer>} |
Change reporting period |
| LEDs | E, D |
{"led":<boolean>} |
Enable / Disable LEDs |
| Save Config | n/a | {"saveConfig":true} |
Save configuration parameters to flash |
| Status | S |
{"status":true} |
Show current configuration and uptime |
| Device Info | (S) |
{"info":true} |
Show device hardware, firmware, and serial |