- Baud rate 115200.
- Data bits: 8.
- Return key: CR.
Overview of all commands
This overview should be printed whenAT+HELP
is issued.
Custom commands
It’s allowed to add custom commands. For example, these commands are implemented in the Edge Impulse firmware for the ST B-L475E-IOT01A, but are not used by the serial daemon.System commands
AT+CLEARCONFIG
Clears the complete configuration, and resets the system. Has no return value. Example:AT+RESET
Restarts the system, but leaves all configuration intact. Has no return value. Example:Full configuration
AT+CONFIG?
Lists all configuration options, grouped by category. Lines with category names start and end with=====
. Lines with configuration options follow key: value
, with arbitrary whitespace between :
and the value. Example:
Device information commands
AT+DEVICEINFO?
Returns information about the device and the firmware. TheID
here should be a globally unique ID (like a MAC address). If the device does not have a globally unique ID set this to 00:00:00:00:00:00
and implement the AT+DEVICEID
command. The serial daemon will then use the MAC address of the USB controller instead.
The Data Transfer Baudrate
is the baud rate that the device can switch to when offloading data for functions like AT+BUFFER
. If the device does not support switching to a higher baud rate set this to 115200
. See “Switching to higher baud rates” later on this page for the protocol.
Example:
AT+DEVICEID
Sets the device ID. This is only required for devices that do not have a globally unique ID (seeAT+DEVICEINFO?
).
Example:
AT+SENSORS?
Lists sensors on the device that can be used to collect data. One sensor per line, with Name, Max sample length, and Frequencies listed. The name that you list here will be passed back toAT+SAMPLESTART=
to indicate which sensor should be used. Example:
AT+SNAPSHOT?
Lists whether the device has a camera, whether the device supports snapshot streaming, and the resolutions of the camera. If the device does not have a camera setHas snapshot
to 0
and omit the other options. The color depth should be either Grayscale
or RGB
. Example:
File system commands
No file system? The serial daemon can also use a scratch buffer instead, e.g. on external or internal flash. For this you need to implement theAT+READBUFFER
function and follow the instructions under AT+SAMPLESTART
.
AT+LISTFILES
Lists all files on the file system, one file per line. Example:AT+READFILE
Read a single file from file system, returns the full file in base64 format. This function takes two parameters: 1) the name of the file, 2) whether to switch to the ‘Data transfer baud rate’ (y/n
). Example:
AT+UNLINKFILE
Removes a single file from file system. Returns nothing if the file was unlinked successfully. Example:AT+UPLOADFILE
Uploads a file to Edge Impulse. This uses the upload settings (seeAT+UPLOADSETTINGS?
) to specify where the file will be sent. Once uploading is completed, the device should respond with File uploaded
. Example:
AT+CLEARFILES
Clears all files on the underlying file system, except the config file. Example:AT+READBUFFER
Read part of the scratch buffer, and returns this data in base64 format. This function takes three parameters: 1) the start offset, 2) the end offset, 3) whether to switch to the ‘Data transfer baud rate’ (y/n
). Example:
WiFi
Security values
An integer is used to specify the security mode for a WiFi network, according to this list:- 0 - Open access point
- 1 - WEP
- 2 - WPA
- 3 - WPA2
- 4 - WPA/WPA2
- 5 - PPP authentication context
- 6 - PPP authentication context
- 7 - EAP-TLS
- 8 - PEAP
- 255 - Unknown
AT+SCANWIFI
Scans for nearby WiFi networks. Returns one network per line. Example:AT+WIFI?
Lists current WiFi credentials, MAC address, and whether the device is connected. Example:0
for ‘Present’ and leave the other fields empty. The serial daemon will then no longer prompt to connect the development board to WiFi.
AT+WIFI=
Sets WiFi credentials. Takes three parameters: SSID, password, and security mode (integer). After calling this function the device connects to the WiFi network, gets NTP info, and connects to the remote management service (if the remote management settings are set). Returns OK when done. Example:Sample settings
AT+SAMPLESETTINGS?
Lists the current sample settings, such as the label to use, the interval, the length and the HMAC key. Example:AT+SAMPLESETTINGS=
Sets the current sample settings. This either takes three parameters (label, interval, length) or four parameters (label, interval, length, HMAC key). Returns OK. Example:Upload settings
AT+UPLOADSETTINGS?
Lists the current upload settings, such as the API Key (used to authenticate to the ingestion service, but also used for connecting to the remote management service). Example:AT+UPLOADSETTINGS=
Sets the upload and remote management API key and sets the path (two parameters). Returns OK. Example:AT+UPLOADHOST=
Sets the upload host. Returns OK. Example:Management settings
AT+MGMTSETTINGS?
Lists the current settings and state for the remote management service. Note that the API key used to authenticate to the service is set byAT+UPLOADSETTINGS=
. If the device is not connected, the Last error
field can be used to indicate why the connection failed. Example:
AT+MGMTSETTINGS=
Sets the management URL. After this value is changed the device should not disconnect from the current remote management service - this only happens after re-connecting to WiFi or when restarting the device. Returns OK. Example:Start sampling
AT+SAMPLESTART=
Starts sampling according to the parameters inAT+SAMPLESETTINGS?
, and then uploads the file (if connected to WiFi) according to the parameters in AT+UPLOADSETTINGS?
. Takes one parameter, the name of the sensor (one of the sensors listed in AT+SENSORS?
).
If the upload succeeds, you can unlink the file to save space. If the device is not connected to WiFi it should print the string Not uploading file
. The serial daemon will then use AT+READFILE
with the file name specified earlier to read the file back.
If you have stored the file in a scratch buffer - e.g. on external flash - without a file system, you need to print: Not uploading file. Used buffer, from=0, to=310.
(where 0 and 310 are parameters that will be passed in to AT+READBUFFER
).
The sample interval from AT+SAMPLESETTINGS?
may be ignored, e.g. if this is set to a value that the sensor does not support.
While sampling you can print the following lines to give feedback about the sampling status. These messages are intercepted by the daemon and used to set UI updates in the studio.
Sampling...
- sampling has started, currently recording data from the sensor.Done sampling
- sampling has finished.Processing...
- if the sample requires post-processing (e.g. signing the file, or copying the file over), send this event.Done processing
- post-processing was done.Uploading...
- uploading has started.OK
- full process is done.
Not uploading file
, and don’t emit OK
.
Prior to starting, please print out a line that starts with File name:
and lists where the file will be stored.
Example:
AT+SNAPSHOT
Makes a photo and prints the frame buffer as a base64 encoded string. This function takes three parameters: 1) the width of the snapshot, 2) the height of the snapshot, 3) whether to switch to the ‘Data transfer baud rate’ (y/n
). The content of the base64 buffer should be a uint8_t
array, with one value per pixel when in grayscale mode, or three values per pixel in RGB mode. E.g. an 2x1 image with a black and a white pixel would be:
- Grayscale:
[ 0x00, 0xff ]
(pixel 1, pixel 2). - RGB:
[ 0x00, 0x00, 0x00, 0xff, 0xff, 0xff ]
(pixel 1 red, pixel 1 green, pixel 1 blue, pixel 2 red, pixel 2 green, pixel 2 blue).
edge-impulse-framebuffer2jpg
tool which is part of the Edge Impulse CLI. Write the base64 string to a file called features.txt
and then invoke:
framebuffer.jpg
with the decoded content.
AT+SNAPSHOTSTREAM
Constantly snaps photos and prints the frame buffer as a base64 encoded string, untilb
is received on stdin. This function takes three parameters: 1) the width of the snapshot, 2) the height of the snapshot, 3) whether to switch to the ‘Data transfer baud rate’ (y/n
). The format is the same as AT+SNAPSHOT
, but every snapshot should be on a new line.
Example:
Switching to higher baud rates
For commands that allow switching to a higher baud rate (AT+READFILE
, AT+READBUFFER
, AT+SNAPSHOT
, AT+SNAPSHOTSTREAM
) you’ll need to follow this procedure:
- When
n
is passed in for the ‘use max rate’ property:- Do nothing, just print as usual.
- When
y
is passed in for the ‘use max rate’ property:- Print
\r\nOK
on baud rate 115,200. - Wait 100ms and switch to the max. baud rate. This gives the serial daemon time to switch the rate.
- Print the result of the command.
- Print
\r\nOK
(on the max. baud rate). - Wait 100ms. and switch back to baud rate 115,200.
- Print a new REPL start line (
\r\n>
).
- Print
Version history
- 1.2.0 - switch the return type of
AT+READFILE
from hex to base64. - 1.3.0 - implement
AT+READBUFFER
and thePresent
field for WiFi. - 1.4.0 - add snapshot mode and the data transfer baud rate property.
- 1.5.0 - add snapshot streaming mode.
- 1.6.0 - allow explicit switching to higher baud rates.