Difference between revisions of "Serial commands"

From bcmeter.org
Jump to navigation Jump to search
(Wiki update: sync with manual and dev docs (2026-03))
 
(Update: V1/V2 naming, remove ESP32/Pi distinction)
 
Line 1: Line 1:
== Serial Commands (ESP32) ==
== Serial Commands ==


The ESP32-based bcMeter provides a USB serial debug interface for hardware diagnostics and manual control. Connect via USB-C at 115200 baud.
The bcMeter provides a USB serial debug interface for hardware diagnostics and manual control. Connect via USB-C at 115200 baud.
 
'''Note:''' This applies to the '''ESP32 firmware''' only. The open-source [https://github.com/dahljo/bcmeter-dev bcmeter-dev] implementation uses standard Linux tools instead.


=== Available Commands ===
=== Available Commands ===
Line 10: Line 8:
! Command !! Description
! Command !! Description
|-
|-
| <code>led &lt;ch&gt; &lt;duty&gt;</code> || Set LED brightness. Channel 0–2 (880/520/370nm), duty 0–255.
| <code>led <ch> <duty></code> || Set LED brightness. Channel 0–2 (880/520/370nm), duty 0–255.
|-
|-
| <code>pump &lt;duty&gt;</code> || Set pump PWM duty cycle (0–255).
| <code>pump <duty></code> || Set pump PWM duty cycle (0–255).
|-
|-
| <code>adc</code> || Test ADS1220 ADC detection and read current values.
| <code>adc</code> || Test ADS1220 ADC detection and read current values.
Line 20: Line 18:
| <code>gps</code> || GPS position report (lat, lon, altitude, satellites, HDOP).
| <code>gps</code> || GPS position report (lat, lon, altitude, satellites, HDOP).
|-
|-
| <code>modem &lt;AT command&gt;</code> || Send raw AT command to SIM7080G modem.
| <code>modem <AT command></code> || Send raw AT command to SIM7080G modem.
|-
|-
| <code>modemscan</code> || Detect modem UART configuration.
| <code>modemscan</code> || Detect modem UART configuration.
Line 30: Line 28:
| <code>scan</code> || Scan for nearby WiFi networks.
| <code>scan</code> || Scan for nearby WiFi networks.
|-
|-
| <code>connect &lt;ssid&gt; &lt;password&gt;</code> || Save WiFi credentials and connect.
| <code>connect <ssid> <password></code> || Save WiFi credentials and connect.
|-
|-
| <code>ap</code> || Switch to access point (hotspot) mode.
| <code>ap</code> || Switch to access point (hotspot) mode.
|-
|-
| <code>storage</code> || Show storage usage summary (LittleFS + SD card).
| <code>storage</code> || Show storage usage summary (internal + SD card).
|-
|-
| <code>export</code> || Export all logs to SD card.
| <code>export</code> || Export all logs to SD card.

Latest revision as of 14:21, 8 March 2026

Serial Commands

The bcMeter provides a USB serial debug interface for hardware diagnostics and manual control. Connect via USB-C at 115200 baud.

Available Commands

Command Description
led <ch> <duty> Set LED brightness. Channel 0–2 (880/520/370nm), duty 0–255.
pump <duty> Set pump PWM duty cycle (0–255).
adc Test ADS1220 ADC detection and read current values.
sps30 Quick read from particulate matter sensor.
gps GPS position report (lat, lon, altitude, satellites, HDOP).
modem <AT command> Send raw AT command to SIM7080G modem.
modemscan Detect modem UART configuration.
modemon / modemoff Power control for the modem.
wifi Current WiFi status and IP address.
scan Scan for nearby WiFi networks.
connect <ssid> <password> Save WiFi credentials and connect.
ap Switch to access point (hotspot) mode.
storage Show storage usage summary (internal + SD card).
export Export all logs to SD card.
reset Reboot the device.
help List all available commands.

Usage Example

# Connect via screen (macOS/Linux)
screen /dev/tty.usbmodem* 115200

# Or via minicom
minicom -D /dev/ttyACM0 -b 115200

# Check sensor readings
> adc
ADS1220 detected at SPI
Ch0 (Sen 880): 2.341V
Ch1 (Ref 880): 2.518V

# Manually control pump
> pump 80
Pump duty set to 80/255

# Check GPS
> gps
Fix: valid
Lat: 52.4631, Lon: 13.3069
Sats: 7, HDOP: 1.2
Alt: 48.3m, Speed: 0.0 km/h