BrickPico uses "SCPI like" command set. Command syntax should be mostly SCPI and IEE488.2 compliant, to make it easier to control and configure Fanpico units.
BrickPico supports following commands:
- *IDN?
- *RST
- CONFigure?
- CONFigure:DEFault:PWM
- CONFigure:DEFault:STAte
- CONFigure:DELete
- CONFigure:Read?
- CONFigure:SAVe
- CONFigure:OUTPUTx:NAME
- CONFigure:OUTPUTx:NAME?
- CONFigure:OUTPUTx:EFFect
- CONFigure:OUTPUTx:EFFect?
- CONFigure:OUTPUTx:MINpwm
- CONFigure:OUTPUTx:MINpwm?
- CONFigure:OUTPUTx:MAXpwm
- CONFigure:OUTPUTx:MAXpwm?
- CONFigure:OUTPUTx:PWM
- CONFigure:OUTPUTx:PWM?
- CONFigure:OUTPUTx:STAte
- CONFigure:OUTPUTx:STAte?
- CONFigure:TIMERS?
- CONFigure:TIMERS:ADD
- CONFigure:TIMERS:DEL
- MEASure:Read?
- MEASure:OUTPUTx?
- MEASure:OUTPUTx:Read?
- MEASure:OUTPUTx:PWM
- Read?
- SYStem:ERRor?
- SYStem:DEBug
- SYStem:DEBug?
- SYStem:GAMMA
- SYStem:GAMMA?
- SYStem:LOG
- SYStem:LOG?
- SYStem:SYSLOG
- SYStem:SYSLOG?
- SYStem:DISPlay
- SYStem:DISPlay?
- SYStem:DISPlay:LAYOUTR
- SYStem:DISPlay:LAYOUTR?
- SYStem:DISPlay:LOGO
- SYStem:DISPlay:LOGO?
- SYStem:DISPlay:THEMe
- SYStem:DISPlay:THEMe?
- SYStem:ECHO
- SYStem:ECHO?
- SYStem:FLASH?
- SYStem:OUTputs?
- SYStem:LED
- SYStem:LED?
- SYStem:LFS?
- SYStem:LFS:FORMAT
- SYStem:MEM
- SYStem:MEM?
- SYStem:MQTT:SERVer
- SYStem:MQTT:SERVer?
- SYStem:MQTT:PORT
- SYStem:MQTT:PORT?
- SYStem:MQTT:USER
- SYStem:MQTT:USER?
- SYStem:MQTT:PASSword
- SYStem:MQTT:PASSword?
- SYStem:MQTT:SCPI
- SYStem:MQTT:SCPI?
- SYStem:MQTT:TLS
- SYStem:MQTT:TLS?
- SYStem:MQTT:HA:DISCovery
- SYStem:MQTT:HA:DISCcovery?
- SYStem:MQTT:INTerval:STATus
- SYStem:MQTT:INTerval:STATus?
- SYStem:MQTT:INTerval:TEMP
- SYStem:MQTT:INTerval:TEMP?
- SYStem:MQTT:INTerval:PWM
- SYStem:MQTT:INTerval:PWM?
- SYStem:MQTT:TOPIC:STATus
- SYStem:MQTT:TOPIC:STATus?
- SYStem:MQTT:TOPIC:COMMand
- SYStem:MQTT:TOPIC:COMMand?
- SYStem:MQTT:TOPIC:RESPonse
- SYStem:MQTT:TOPIC:RESPonse?
- SYStem:MQTT:TOPIC:ERRor
- SYStem:MQTT:TOPIC:ERRor?
- SYStem:MQTT:TOPIC:WARNing
- SYStem:MQTT:TOPIC:WARNing?
- SYStem:MQTT:TOPIC:TEMP
- SYStem:MQTT:TOPIC:TEMP?
- SYStem:MQTT:TOPIC:PWM
- SYStem:MQTT:TOPIC:PWM?
- SYStem:NAME
- SYStem:NAME?
- SYStem:PWMfreq
- SYStem:PWMfreq?
- SYStem:SERIAL
- SYStem:SERIAL?
- SYStem:SPI
- SYStem:SPI?
- SYStem:TELNET:SERVer
- SYStem:TELNET:SERVer?
- SYStem:TELNET:AUTH
- SYStem:TELNET:AUTH?
- SYStem:TELNET:PORT
- SYStem:TELNET:PORT?
- SYStem:TELNET:RAWmode
- SYStem:TELNET:RAWmode?
- SYStem:TELNET:USER
- SYStem:TELNET:USER?
- SYStem:TELNET:PASSword
- SYStem:TELNET:PASSword?
- SYStem:TIME
- SYStem:TIME?
- SYStem:TIMEZONE
- SYStem:TIMEZONE?
- SYStem:TLS:CERT
- SYStem:TLS:CERT?
- SYStem:TLS:PKEY
- SYStem:TLS:PKEY?
- SYStem:UPTIme?
- SYStem:UPGRADE
- SYStem:VERsion?
- SYStem:WIFI?
- SYStem:WIFI:AUTHmode
- SYStem:WIFI:AUTHmode?
- SYStem:WIFI:COUntry
- SYStem:WIFI:COUntry?
- SYStem:WIFI:HOSTname
- SYStem:WIFI:HOSTname?
- SYStem:WIFI:IPaddress
- SYStem:WIFI:IPaddress?
- SYStem:WIFI:MODE
- SYStem:WIFI:MODE?
- SYStem:WIFI:NETMASK
- SYStem:WIFI:NETMASK?
- SYStem:WIFI:GATEWAY
- SYStem:WIFI:GATEWAY?
- SYStem:WIFI:NTP
- SYStem:WIFI:NTP?
- SYStem:WIFI:SYSLOG
- SYStem:WIFI:SYSLOG?
- SYStem:WIFI:MAC?
- SYStem:WIFI:SSID
- SYStem:WIFI:SSID?
- SYStem:WIFI:STATus?
- SYStem:WIFI:STATS?
- SYStem:WIFI:PASSword
- SYStem:WIFI:PASSword?
- WRIte:OUTPUTx
- WRIte:OUTPUTx:PWM
- WRIte:OUTPUTx:STAte
Additionally unit will respond to following standard SCPI commands to provide compatibility in case some program unconditionally will send these:
- *CLS
- *ESE
- *ESE?
- *ESR?
- *OPC
- *OPC?
- *SRE
- *SRE?
- *STB?
- *TST?
- *WAI
Identify device. This returns string that contains following fields:
<manufacturer>,<model number>,<serial number>,<firmware version>
Example:
*IDN?
TJKO Industries,BRICKPICO-16,e660c0d1c768a330,1.0
Reset unit. This triggers BrickPico to perform (warm) reboot.
*RST
Commands for configuring the device settings.
Display current configuration in JSON format. Same as CONFigure:Read?
Example:
CONF?
Copy current output PWM (brightess) settings to power-on default PWM settings. Alternative to this command is to set default PWM for each port using CONF:OUTPUTx:PWM command.
Configuration must be saved after running this command.
Example:
CONF:DEFAULT:PWM
CONF:SAVE
Copy current output states (ON/OFF) to power-on default states. Alternative to this command is to set default power on state using CONF:OUTPUTx:DEFAULT command.
Configuration must be saved after running this command.
Example:
CONF:DEFAULT:STATE
CONF:SAVE
Delete current configuration saved into flash. After unit has been reset it will be using default configuration.
Example:
CONF:DEL
*RST
Display current configuration in JSON format.
Example:
CONF:READ?
Save current configuration into flash memory.
Example:
CONF:SAVE
OUTPUTx commands are used to configure specific output port. Where x is a number for the output port.
For example:
CONFIGURE:OUTPUT8:NAME Interrior Lights
Set name for output port.
For example:
CONF:OUTPUT1:NAME Front Lights
Query name of a output port.
For example:
CONF:OUTPUT1:NAME?
Front Lights
Configure active effect for an ouput channgel.
Effect | Description | Arguments | Argument Descriptions | Default | Notes |
---|---|---|---|---|---|
none | No effect | ||||
fade | Fade in/out when channgel is toggled on/off. | fade_in_time,fade_out_time | Fade-in and fade-out times in seconds. | fade,1.0,1.0 | |
blink | Blink output at specified rate. | on_time,off_time | Light on and off times in seconds. | blink,0.5,1.5 | |
pulse | Pulse output | fade_in_time,on_time,fade_out_time,off_time | Define duration of each 4 sections of a pulse "cycle" inseconds. | fade,2.0,0.5,2.0,0.5 |
For example (configur blinking using defaults):
CONF:OUTPUT1:EFF blink
For example (configure blinking with custom parameters):
CONF:OUTPUT1:EFF blink,1.0,2.5
Display currently active effect for an output.
Format: effect,arg_1,arg_2,...arg_n
For example:
CONF:OUTPUT1:EFF?
blink,0.500000,1.500000
Set absolute minimum PWM duty cycle (%) for given output port. This can be used to make sure that output never sees a lower duty cycle (overriding the normal signal).
Default: 0 %
Example: Set minimum PWM duty cycle to 20% for OUTPUT1
CONF:OUTPUT1:MIN 20
Query current minimum PWM duty cycle (%) configured on a output port.
Example:
CONF:OUTPUT1:MIN?
20
Set absolute maximum PWM duty cycle (%) for given output port. This can be used to make sure that output never sees higher duty cycle than given value (overriding the normal output signal).
Default: 100 %
Example: Set maximum PWM duty cycle to 95% for OUTPUT1
CONF:OUTPUT1:MAX 95
Query current maximum PWM duty cycle (%) configured on a output port.
Example:
CONF:OUTPUT1:MAX?
95
Set default PWM duty cycle (%) for given output port. This is value set when unit boots up and normally defaults to 100% (full brightness).
Default: 100%
Example: Set default PWM duty cycle to 50% for OUTPUT1
CONF:OUTPUT1:PWM 50
Query current default PWM duty cycle for an output port.
Example:
CONF:OUTPUT1:PWM?
50
Controls whether output is ON or OFF state when unit boots up.
Values: ON, OFF
Default: OFF
Example: Set Output 5 to be ON when system boots up.
CONF:OUTPUT5:STATE ON
Query whether output is set to default to ON or OFF when unit boots up.
Example:
CONF:OUTPUT1:STATE?
OFF
List currently configured timers (events).
Output format:
<#>: <minute> <hour> <weekdays> <action> <outputs> <comment>
Example:
CONF:TIMERS?
1: 00 18 1-5 ON 1-6 turn on lights during the week
1: 00 17 6-7 ON 1-6 turn on lights on the weekends
2: 30 05 0-6 OFF 1-16 turn off lights in the morning
Add new timer entry.
Timer entry format:
<minute> <hour> <weekdays> <action> <outputs> [<comment>]
Field | Valid Values | Description |
---|---|---|
minute | 00..59 | Minute |
hour | 00.23 | Hour (24h clock) |
weekdays | 0..6 | 0=Sunday, 1=Monday, 2=Tuesday, ... 6=Saturday |
action | ON, OFF | |
outputs | 1..n | Outputs that the event affects. |
Specifying weekdays and outputs:
Notation | Description |
---|---|
* | Match all |
1,3,5 | List |
1-5 | Range |
Example:
CONF:TIMERS:ADD 00 18 1-5 ON 1-6 Turn on during the week
CONF:TIMERS:ADD 00 17 6-7 ON 1-8 Turn on during weekends
CONF:TIMERS:ADD 00 06 * OFF * Turn everything off in the morning
Remove timer event. Command takes the event number as parameter. Currently configured timer events along with their numbers can be viewed using: CONF:TIMERS?
Example (remove second timer event):
CONF:TIMERS:DEL 2
These commands are for reading (measuring) the current output values on ports.
This command returns current output settings on all OUTPUT ports. (This is same as: Read?)
Response format:
output<n>,"<name>",<output duty cycle>,<output state>
Example:
MEAS:READ?
output1,"Output 1",100.0,OFF
output2,"Output 2",50.00,OFF
output3,"Output 3",50.00,ON
output4,"Output 4",25.00,ON
...
Return current output PWM signal duty cycle (%) for a output.
Response format:
<duty_cycle>
Example:
MEAS:OUTPUT1?
100.00
Return current output PWM signal duty cycle (%) for a output.
This is same as: MEASure:OUTPUTx?
Return current output PWM signal duty cycle (%) for a output.
This is same as: MEASure:OUTPUTx?
This command returns all setting for all OUTPUT ports. (This is same as: MEASure:Read?)
Response format:
output<n>,"<name>",<output duty cycle>
Example:
MEAS:READ?
output1,"Output 1",100.0
output2,"Output 2",50.00
output3,"Output 3",50.00
output4,"Output 4",0.00
...
Display status from last command.
Example:
SYS:ERR?
0,"No Error"
Set the system debug level. This controls the logging to the console.
Default: 0 (do not log any debug messages)
Example: Enable verbose debug output
SYS:DEBUG 2
Display current system debug level.
Example:
SYS:DEBUG?
0
Set system PWM output mapping (Lightness/Gamma correction).
Light output from LED lights normally does not correlate linearly to PWM duty cycle. PWM output mapping can be used to "correct" this to produce more linear light (output) compared to PWM duty cycle.
Value | Description | Value Range | Example |
---|---|---|---|
<number> | Gamma correction factor (valid range 1.0 - 10.0) | 2.5 | |
cie | CIE (1931) Lightness algorithm | N/A | cie |
<blank> | Use default correction | N/A |
Default: (use default correction method; currently CIE 1931)
Example: Set output PWM mapping to use Gamma 2.2 correction factor
SYS:GAMMA 2.2
Display current system PWM output mapping (Lightness/Gamma correction).
Value | Description |
---|---|
1.0 | Gamma correction factor 1.0 (no correction) |
2.2 | Gamma correction factor 2.2 (slightly under corrected) |
2.5 | Gamma correction factor 2.5 (normal correction) |
cie | Use CIE 1931 Lightness algorithm |
<blank> | Use default correction (currently "cie") |
Example:
SYS:GAMMA?
2.5
Set the system logging level. This controls the level of logging to the console.
Default: WARNING
Log Levels:
Level | Name |
---|---|
0 | EMERG |
1 | ALERT |
2 | CRIT |
3 | ERR |
4 | WARNING |
5 | NOTICE |
6 | INFO |
7 | DEBUG |
Example: Enable verbose debug output
SYS:LOG DEBUG
Display current system logging level.
Example:
SYS:LOG?
NOTICE
Set the syslog logging level. This controls the level of logging to a remote syslog server.
Default: ERR
Log Levels:
Level | Name |
---|---|
0 | EMERG |
1 | ALERT |
2 | CRIT |
3 | ERR |
4 | WARNING |
5 | NOTICE |
6 | INFO |
7 | DEBUG |
Example: Enable logging of NOTICE (and lower level) message:
SYS:LOG NOTICE
Display current syslog logging level.
Example:
SYS:SYSLOG?
ERR
Set display (module) parameters as a comma separated list.
This can be used to set display module type if cannot be automatically detected. Additionally this can be used to set some display parameters like brightness.
Default: default
Currently supported values:
Value | Description | Notes |
---|---|---|
default | Use default settings (auto-detect). | |
128x64 | OLED 128x64 module installed. | OLED |
128x128 | OLED 128x128 module installed. | OLED |
132x64 | OLED 132x64 installed (some 1.3" 128x64 modules need this setting!) | OLED |
flip | Flip display (upside down) | OLED |
invert | Invert display | OLED |
brightness=n | Set display brightness (%) to n (where n=0..100) [default: 50] | OLED |
Example: 1.3" (SH1106) module installed that doesn't get detected correctly
SYS:DISP 132x64
Example: Invert display and set brightnes to 30%
SYS:DISP default,invert,brightness=30
Display current display module setting.
Example:
SYS:DISP?
132x64,flip,invert,brightness=75
Configure (OLED) Display layout for the right side of the screen.
Layout is specified as a comma delimited string describing what to display on each row (8 rows available if using 128x64 OLEd module, 10 rows available with 128x128 pixel modules).
Syntax: ,,...
Where tow specifications can be one of the following:
Type | Description | Notes |
---|---|---|
Mn | MBFan input n | n=1..4 |
Sn | Sensor input n | n=1..3 |
Vn | Virtual Sensor input n | n=1..8 |
- | Horizontal Line | |
Ltext | Line with "text" | Max length 9 characters. |
Default:
When this setting is not set following defaults are used based on the OLED module size:
Screen Size | Available Rows | Default Configuration |
---|---|---|
128x64 | 8 | M1,M2,M3,M4,-,S1,S2,S3 |
128x128 | 10 | LMB Inputs,M1,M2,M3,M4,-,LSensors,S1,S2,S3 |
Example: configure custom theme (for 128x64 display):
SYS:DISP:LAYOUTR M1,M2,-,S1,S2,S3,V1,V2
Display currently configured (OLED) Display layout for the right side of the screen.
Example:
SYS:DISP:THEME?
M1,M2,-,S1,S2,S3,V1,V2
Configure (LCD) Display boot logo.
Currently available logos:
Name | Description |
---|---|
default | Default FanPico boot logo. |
custom | Custom boot logo (only available if firmware has been compiled with custom logo included). |
Example: configure custom logo
SYS:DISP:LOGO custom
Display currently configured (LCD) Display boot logo.
Example:
SYS:DISP:LOGO?
default
Configure (LCD) Display theme to use.
Default: default
Example: configure custom theme
SYS:DISP:THEME custom
Display currently configured (LCD) display theme name.
Example:
SYS:DISP:THEME?
default
Enable or disaple local echo on the console. This can be useful if interactively programming BrickPico.
Value | Status |
---|---|
0 | Local Echo disabled. |
1 | Local Echo enabled. |
Default: 0
Example: enable local echo
SYS:ECHO 1
Example: disable local echo
SYS:ECHO 0
Display local echo status:
Example:
SYS:ECHO?
0
Returns information about Pico flash memory usage.
Example:
SYS:FLASH?
Flash memory size: 2097152
Binary size: 683520
LittleFS size: 262144
Unused flash memory: 1151488
Display number of OUTPUT output ports available.
Example:
SYS:OUTPUTS?
8
Set system indicator LED operating mode.
Supported modes:
mode | description |
---|---|
0 | LED blinking slowly [default] |
1 | LED on (continuously) |
2 | LED off |
Default: 0
Example to set LED to be on continuously:
SYS:LED 1
Query current system LED operating mode.
Example:
SYS:LED?
0
Display information about the LittleFS filesystem in the flash memory.
Example:
SYS:LFS?
Filesystem size: 262144
Filesystem used: 24576
Filesystem free: 237568
Number of files: 3
Number of subdirectories: 0
Format flash filesystem. This will erase current configuration (including any TLS certificates saved in flash).
Example (format filesystem and save current configuration):
SYS:LFS:FORMAT
CONF:SAVE
Test how much available (heap) memory system currently has. This does simple test to try to determine what is the largest block of heap memory that is currently available as well as try allocating as many as possible small block of memory to determine roughly the total available heap memory.
This command takes optional 'blocksize' parameter to specify the memory block size to use in the tests. Default is 1024 bytes.
Example:
SYS:MEM 512
Largest available memory block: 114688 bytes
Total available memory: 111104 bytes (217 x 512bytes)
Returns information about heap and stack size. As well as information about current (heap) memory usage as returned by mallinfo() system call.
Note, mallinfo() doesn't "see" all of the available heap memory, unless SYS:MEM
command
has been run first.
Example:
SYS:MEM?
Core0 stack size: 8192
Core1 stack size: 4096
Heap size: 136604
mallinfo:
Total non-mmapped bytes (arena): 136604
# of free chunks (ordblks): 2
# of free fastbin blocks (smblks): 0
# of mapped regions (hblks): 0
Bytes in mapped regions (hblkhd): 0
Max. total allocated space (usmblks): 0
Free bytes held in fastbins (fsmblks): 0
Total allocated space (uordblks): 21044
Total free space (fordblks): 115560
Topmost releasable block (keepcost): 114808
BrickPico has MQTT Client that can be configured to publish (send) periodic status updates to a topic. Additionally MQTT Client support subscribing to a "command" topic to listen for commands. This allows remotely controlling BrickPico.
To enable MQTT at minimum server must be configured. To explicitly disbable MQTT set server to empty string.
Set MQTT server to connect to. This parameter expects a DNS name as argument.
Default: (when this setting is empty string, MQTT is explicitly disabled)
Example (configure MQTT server name):
SYS:MQTT:SERVER io.adafruit.com
Example (disable MQTT):
SYS:MQTT:SERVER
Query currently set MQTT server name.
Example:
SYS:MQTT:SERVER?
io.adafruit.com
Set MQTT server (TCP) port. This setting is needed when MQTT server is not using standard port. If this setting is not set (value is left to default "0"), then standard MQTT port is used.
- Secure (TLS) Port = 8883
- Insecure Port = 1883
Default: 0 (when this setting is 0 use default MQTT ports)
Example:
SYS:MQTT:PORT 9883
Query currently set MQTT (TCP) port.
If return value is zero (0), then default MQTT port is being used.
Example:
SYS:MQTT:PORT?
0
Set MQTT username to use when connecting to MQTT server.
Default:
Example:
SYS:MQTT:USER myusername
Query currently set MQTT username.
Example:
SYS:MQTT:USER?
myusername
Set MQTT password to use when connecting to MQTT server.
Default:
Example:
SYS:MQTT:PASS mymqttpassword
Query currently set MQTT password.
Example:
SYS:MQTT:PASS?
mymqttpassword
Configure if SCPI commands will be accepted via MQTT. This is potentially "dangerous" feature so only enable if you understand the potential risks allowing device to be remotely configured.
Default: OFF
Example:
SYS:MQTT:SCPI ON
Query whether SCPI commands are allowed via MQTT.
Example:
SYS:MQTT:SCPI?
OFF
Enable/disable use of secure connection mode (TLS/SSL) when connecting to MQTT server. Default is TLS on to protect MQTT credentials (usename/password).
Default: ON
Example:
SYS:MQTT:TLS OFF
Query whether TLS is enabled or disabled for MQTT.
Example:
SYS:MQTT:TLS?
ON
Configure Home Assistant MQTT Discovery prefix. This must be set to enable Home Assistant support/integration in BrickPico.
If this is left to empty (string), then Home Assistant support is disabled.
Default:
Example (enable Home Assistant support using default prefix):
SYS:MQTT:HA:DISC homeassistant
Query currently set Home Assistant MQTT Discovery prefix.
Note, if this is empty, then Home Assistant support is disabled.
Example:
SYS:MQTT:HA:DISC?
homeassistant
Configure how often unit will publish (send) status message to status topic. Set this to 0 (seconds) to disable publishing status updates. Recommended values are 60 (seconds) or higher.
Default: 600 (every 10 minutes)
Example:
SYS:MQTT:INT:STAT 3600
Query currently set frequency for publishing unit status information.
Example:
SYS:MQTT:INT:STAT?
3600
Configure how often unit will publish (send) status message to temp topic. Set this to 0 (seconds) to disable publishing temperature updates. Recommended values are 60 (seconds) or higher.
Default: 60 (every 60 seconds)
Example:
SYS:MQTT:INT:TEMP 180
Query currently set frequency for publishing unit temperature information.
Example:
SYS:MQTT:INT:TEMP?
180
Configure how often unit will publish (send) status message to PWM topic. Set this to 0 (seconds) to disable publishing PWM updates. Recommended values are 60 (seconds) or higher.
Default: 600 (every 10 minutes)
Example:
SYS:MQTT:INT:PWM 300
Query currently set frequency for publishing unit PWM information.
Example:
SYS:MQTT:INT:PWM?
300
Configure topic to publish unit status information periodically. If this is left to empty (string), then no status information is published to MQTT server.
Default:
Example:
SYS:MQTT:TOPIC:STAT musername/feeds/brickpico1
Query currently set topic for publishing unit status information to.
Example:
SYS:MQTT:TOPIC:STAT?
myusername/feeds/brickpico1
Configure topic to subscribe to to wait for commands to control outputs. If this is left to empty (string), then unit won't subcrible (and accept) any commands from MQTT.
Default:
Example:
SYS:MQTT:TOPIC:COMM musername/feeds/cmd
Query currently set topic for subscribing to wait for commands.
Example:
SYS:MQTT:TOPIC:COMM?
myusername/feeds/cmd
Configure topic to publish responses to commands received from the command topic. If this is left to empty, then unit won't send response to any commands.
Default:
Example:
SYS:MQTT:TOPIC:RESP musername/feeds/response
Query currently set topic for publishing responses to commands.
Example:
SYS:MQTT:TOPIC:RESP?
myusername/feeds/response
Configure topic to subscribe to for receiving error messages from MQTT broker.
Default:
Example:
SYS:MQTT:TOPIC:ERR mysername/errors
Query currently set topic for subscribing to receive error messages from MQTT broker.
Example:
SYS:MQTT:TOPIC:ERR?
myusername/errors
Configure topic to subscribe to for receiving warning messages from MQTT broker.
Default:
Example:
SYS:MQTT:TOPIC:WARN mysername/throttle
Query currently set topic for subscribing to receive warning messages from MQTT broker.
Example:
SYS:MQTT:TOPIC:WARN?
myusername/throttle
Configure topic to publish unit temperature data to.
Default:
Example:
SYS:MQTT:TOPIC:TEMP mysername/feeds/brickpico_temp
Query currently set topic for publishing temperature data.
Example:
SYS:MQTT:TOPIC:TEMP?
myusername/feeds/brickpico_temp
Configure topic to publish output port PWM status to.
This is a template string where %d
should be used to mark the output port number.
Default:
Example:
SYS:MQTT:TOPIC:PWM mysername/feeds/brickpico_output%d
Query currently set topic for publishing PWM data.
Example:
SYS:MQTT:TOPIC:PWM?
myusername/feeds/brickpico_output%d
Set name of the system. (Default: fanpico1)
Example:
SYS:NAME HomeServer
Get name of the system.
Example:
SYS:NAME?
HomeServer
Set PWM frequency for the outputs. Supported range 10Hz - 100kHz. When changing the frequency, chang will take effect after unit has been rebooted.
Default: 1000 (1kHz)
Example, set PWM frequency to 1.5kHz:
SYS:PWM 1500
CONF:SAVE
*RST
Get current PWM frequency for the outputs.
Example:
SYS:PWM?
1000
Enable or disable TTL Serial Console. This is enabled by default if board has this connector. Reason to disable this could be to use the second I2C bus that is sharing pins with the UART.
Example (disable serial console):
SYS:SERIAL 0
Return status of TTL Serial Console.
Status | Description |
---|---|
1 | Enabled |
0 | Disabled |
Example:
SYS:SERIAL?
1
Enable or disable SPI bus (on connector J18). When SPI bus is enabled I22 (OLED display) and Serial TTL connectors cannot be used as these share pins with the SPI bus. Reason to enable SPI bus would be to connect LCD panel on the J18 connector.
Example (enable SPI bus):
SYS:SPI 1
Return status of SPI bus.
Status | Description |
---|---|
1 | Enabled |
0 | Disabled |
Example:
SYS:SPI?
0
Control whether Telnet server is enabled or not. After making change configuration needs to be saved and unit reset.
Default: OFF
Example:
SYS:TELNET:SERV ON
Display whether Telnet server status.
Example:
SYS:TELNET:SERV?
OFF
Toggle Telnet server authentication mode. When enabled then Telnet server will prompt user for login/password. When off, no authentication is needed.
Default: ON
Example:
SYS:TELNET:AUTH OFF
Display whether Telnet server authentication is enabled or not.
Example:
SYS:TELNET:AUTH?
ON
Set TCP port where Telnet server will listen on. If this setting is not set then default port will be used.
Default: 23 (default Telnet port)
Example:
SYS:TELNET:PORT 8000
Display currently configured port for Telnet server.
(if port is set to 0, then default Telnet port will be used)
Example:
SYS:TELNET:PORT?
8000
Configure Telnet server mode. By default Telnet server uses Telnet protocol, but setting this option causes Telnet protocol to be disabled. And server uses "raw TCP" mode.
Default: OFF
Example:
SYS:TELNET:RAW ON
Display if "raw TCP" mode is enabled or not.
Example:
SYS:TELNET:RAW?
OFF
Configure username that is allowed to login to this server using Telnet.
Default:
Example:
SYS:TELNET:USER admin
Display currently configured telnet user (login) name.
Example:
SYS:TELNET:USER?
admin
Configure password for the telnet user. Password is hashed using SHA-512 Crypt algorithm.
Default:
Example:
SYS:TELNET:PASS mypassword
Display currently configured telnet user password hash.
Example:
SYS:TELNET:PASS?
$6$QvD5AkWSuydeH/EB$UsYA0cymsCRSse78fN4bMb5q0hM5B7YUNSFd3zJfMDbTG7DOH8iuMufVjsvqBOxR9YCJYSHno4CFeOhLtTGLx.
Set system Real-Time Clock (RTC) time.
This command expects time in following format: YYYY-MM-DD HH:MM:SS
Example:
SYS:TIME 2022-09-19 18:55:42
Return current Real-Time Clock (RTC) time. This is only available if using Pico W and it has successfully gotten time from a NTP server or RTC has been initialized using SYStem:TIME command.
Command returns nothing if RTC has not been initialized.
Example:
SYS:TIME?
2022-09-19 18:55:42
Set POSIX timezone to use when getting time from a NTP server. If DHCP server does not supply POSIX Timezone (DHCP Option 100), then this command can be used to specify local timezone.
This command takes POSIX timezone string as argument (or if argument is blank, then it clears existinh timezone setting).
Example (set Pacific Standard time as local timezone):
SYS:TIMEZONE PST8PDT7,M3.2.0/2,M11.1.0/02:00:00
Example (clear timezone setting):
SYS:TIMEZONE
Return current POSIX timezone setting.
Command returns nothing if no timezone has been set.
Example:
SYS:TIMEZONE?
PST8PDT7,M3.2.0/2,M11.1.0/02:00:00
Upload or delete TLS certificate for the HTTP server. Note, both certificate and private key must be installed before HTTPS server will activate (when system is restarted next time).
When run without arguments this will prompt to paste TLS (X.509) certificate in PEM format. When run with "DELETE" argument currently installed certificate will be deleted.
Example (upload/paste certificate):
SYS:TLS:CERT
Paste certificate in PEM format:
Example (delete existing certificate from flash memory):
SYS:TLS:CERT DELETE
Display currently installed certificate.
Example:
SYS:TLS:CERT?
Upload or delete (TLS Certificate) Private key for the HTTP server. Note, both certificate and private key must be installed before HTTPS server will activate (when system is restarted next time).
When run without arguments this will prompt to paste private key in PEM format. When run with "DELETE" argument currently installed private key will be deleted.
Example (upload/paste private key):
SYS:TLS:PKEY
Paste private key in PEM format:
Example (delete existing private key from flash memory):
SYS:TLS:PKEY DELETE
Display currently installed private key.
Example:
SYS:TLS:CERT?
Return time elapsed since unit was last rebooted.
Example:
SYS:UPTIME?
up 4 days, 22 hours, 27 minutes
Reboot unit to USB (BOOTSEL) mode for firmware upgrade. This command triggers fanpico to reboot and enter USB "mode", where new firmware can simply be copied to the USB drive that appears. After file has been copied, fanpico will automatically reboot to new firmware image.
Example:
SYS:VER?
Display software version and copyright information.
Example:
SYS:VER?
Check if the unit support WiFi networking. This should be used to determine if any other "WIFI" commands will be available.
Return values:
0 = No WiFi support (Pico). 1 = WiFi supported (Pico W).
Example:
SYS:WIFI?
1
Set Wi-Fi Authentication mode.
Following modes are currently supported:
Mode | Description | Notes |
---|---|---|
default | Use system default | Currently default is WPA2 |
WPA3_WPA2 | Use WPA3/WPA2 (mixed) mode | |
WPA3 | Use WPA3 only | |
WPA2 | Use WPA2 only | |
WPA2_WPA | Use WPA2/WPA (mixed) mode | |
WPA | Use WPA only | |
OPEN | Use "Open" mode | No authentication. |
Example:
SYS:WIFI:AUTH WPA3_WPA2
Return currently configured Authentication mode for the WiFi interface.
Example:
SYS:WIFI:AUTH?
default
Set Wi-Fi Country code. By default, the country setting for the wireless adapter is unset. This means driver will use default world-wide safe setting, which can mean that some channels are unavailable.
Country codes are two letter (ISO 3166) codes. For example, Finland = FI, Great Britain = GB, United States of Americ = US, ...
Example:
SYS:WIFI:COUNTRY US
Return currently configured country code for the Wi-Fi interface.
Codes used are the ISO 3166 standard two letter codes ('XX' means unset/worldwide setting).
Example:
SYS:WIFI:COUNTRY?
US
Set system hostname. This will be used with DHCP and SYSLOG. If hostname is not defined then system will default to generating hostname as follows: BrickPico-xxxxxxxxxxxxxxxx
(where "xxxxxxxxxxxxxxxx" is the BrickPico serial number)
Example:
SYS:WIFI:HOSTNAME fanpico1
Return currently configured system hostname.
Example:
SYS:WIFI:HOSTNAME?
fanpico1
Set staticlly configured IP address.
Set address to "0.0.0.0" to enable DHCP.
Example:
SYS:WIFI:IP 192.168.1.42
Display currently configured (static) IP address. If no static address is configured, DHCP will be used.
Set address to "0.0.0.0" to enable DHCP.
Example:
SYS:WIFI:IP?
0.0.0.0
Set WiFi connection mode. Normally this setting is not needed with modern APs.
However, if FanPico is failing to connect to WiFi network, this couldbe due to old firmware on the AP (upgrading to latest firmware typically helps). If firmware update did not help or there is no updated firmware available, setting connection mode to synchronous can help (however this could cause FanPico to "hang" for up to 60 seconds during boot up).
Mode | Description |
---|---|
0 | Asynchronous connection mode (default) |
1 | Synchronous connection mode |
Default: 0
Example:
SYS:WIFI:MODE 1
Display currently configured WiFi connection mode?
Example:
SYS:WIFI:MODE?
0
Set statically configured netmask.
Example:
SYS:WIFI:NETMASK 255.255.255.0
Display currently configured (static) netmask.
Example:
SYS:WIFI:NETMASK?
255.255.255.0
Set statically configured default gateway (router).
Example:
SYS:WIFI:GATEWAY 192.168.1.1
Display currently configured default gateway (router).
Example:
SYS:WIFI:GATEWAY?
192.168.1.1
Configure IP for NTP server to use.
Set to "0.0.0.0" to use server provided by DHCP.
Example:
SYS:WIFI:NTP 192.168.1.10
Display currently configure NTP server.
Note, "0.0.0.0" means to use DHCP.
Example:
SYS:WIFI:NTP?
192.168.1.10
Configure IP for Syslog server to use.
Set to "0.0.0.0" to use server provided by DHCP.
Example:
SYS:WIFI:SYSLOG 192.168.1.20
Display currently configured Syslog server.
Note, "0.0.0.0" means to use DHCP.
Example:
SYS:WIFI:SYSLOG?
192.168.1.20
Display WiFi adapter MAC (Ethernet) address.
Example:
SYS:WIFI:MAC?
28:cd:c1:01:02:03
Set Wi-Fi network SSID. FanPico will automatically try joining to this network.
Example
SYS:WIFI:SSID mynetwork
Display currently configured Wi-Fi network SSID.
Example:
SYS:WIFI:SSID?
mynetwork
Display WiFi Link status.
Return value: linkstatus,current_ip,current_netmask,current_gateway
Link Status:
Value | Description |
---|---|
0 | Link is down. |
1 | Connected to WiFi. |
2 | Connected to WiFi, but no IP address. |
3 | Connected to WiFi with and IP address. |
-1 | Connection failed. |
-2 | No matching SSID found(could be out of range, or down). |
-3 | Authentication failed (wrong password?) |
Example:
SYS:WIFI:STAT?
1,192.168.1.42,255.255.255.0,192.168.1.1
Display TCP/IP stack (LwIP) statistics.
NOTE, this command only works on "Debug" builds of the firmware currently.
Example
SYS:WIFI:STATS?
Set Wi-Fi (PSK) password/passrase.
Example
SYS:WIFI:PASS mynetworkpassword
Display currently configured Wi-Fi (PSK) password/passphrase.
Example:
SYS:WIFI:PASS?
mynetworkpassword
These commands are for turning output ports ON/OFF and for adjusting output PWM duty cycle.
Turn output on or off.
Example: Turn OUTPUT1 on.
WRITE:OUTPUT1 ON
Example: Turn OUTPUT1 off.
WRITE:OUTPUT1 OFF
Set output PWM duty cycle. Valid values are from 0 to 100.
Example: Set OUTPUT2 to 25% duty cycle.
WRITE:OUTPUT2:PWM 25
Turn output on or off. This is same as WRIte:OUTPUTx command.
Example: Turn OUTPUT1 on.
WRITE:OUTPUT1:STATE ON
Example: Turn OUTPUT1 off.
WRITE:OUTPUT1:STATE OFF