## Configuration file template for rp2040-sen5x-air-quality-webui-monitor script ## All commented-out parameters below are optional, most that aren't are as well ## See top of the main.py script for all up-to-date option defaults [wifi-ap] ## (optional) Wi-Fi Access Point (AP) mode configuration ## Use DHCP server IP like http://192.168.4.1 to connect to WebUI on this AP. ## If ssid/key values are set in this section, [wifi-client] below won't be used. ## All AP parameters here are for micropython's WLAN.config() - ## see https://docs.micropython.org/en/latest/library/network.WLAN.html verbose = yes # Remove, comment or set those to empty values to use [wifi-client] below # and connect to an existing AP/router, instead of running an access point. ssid = RP2040 AQM key = grid exact riot thaw class # channel: it's a good practice to only use channels 1, 6 or 11 here channel = 6 # country: two-letter country code used for radio compliance, XX = unknown # See https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 for a list of these country = XX # security: one of wpa2-psk (default), wpa/wpa2-psk or wpa-psk #security = wpa/wpa2-psk pm = powersave #hostname = myrp2 #hidden = yes [wifi-client] ## (optional) Wi-Fi client mode (STA) configuration ## Configuration in this section is only used if ssid/key are unset in [wifi-ap]. ## Multiple networks can be defined and will fallback in same order as listed below. ## Settings before first ssid= option will be used as defaults for all APs, ## and settings after each ssid= line will only be applied to that specific AP. ## WiFi/AP options are same as in [wifi-ap] above for WLAN.config() - ## see https://docs.micropython.org/en/latest/library/network.WLAN.html # "country" and "verbose" parameters are always set for all APs country = XX verbose = yes # scan-interval: interval between ssid scans when not yet connected scan-interval = 20.56 # check-interval: how often to check if connection is still alive to do ssid rescan check-interval = 20 pm = powersave #hostname = myrp2 #hidden = yes # List of ssids and parameters specific to each one afterwards ssid = /ᐠ.ꞈ.ᐟ\ key = trunk yam blaze score boat ssid = Password is Password key = Password check-interval = 120 #pm = performance [sensor] ## Configuration for SEN5x sensor connection and data sampling ## Make sure I2C and GP numbers are correct here. ## sen5x has a bunch of tuning parameters for its algorithms. ## These are not exposed here, but are easy to send in the code. verbose = yes # i2c-* values are passed to micropython's machine.I2C() - # see https://docs.micropython.org/en/latest/library/machine.I2C.html i2c-n = 0 i2c-pin-sda = 0 i2c-pin-scl = 1 #i2c-addr = 105 - default 0x69 address for sen5x from datasheet #i2c-freq = 100_000 - for machine.I2C init, datasheet says 100kbps max #i2c-timeout = 50.0 - in milliseconds, for machine.I2C init #i2c-error-limit = 8 / 3m - abort on >8 i2c errs in 3 (m)ins (or (s)ecs, (h)ours, (d)ays) # sample-interval: interval between getting new sensor data, in seconds # sen5x have minimum 1s sampling interval, so shouldn't be lower than that. sample-interval = 60.0 # sample-count: how many most recent data samples to keep for export/display via webui # Data is stored in volatile RAM, and will be lost on reset/power-cycle, unless exported. # Samples are 16B in size, so 1K samples ~ 16 KiB, RP2040 has <264 KiB. sample-count = 1_000 # error-check-interval: seconds between polling sen5x status for warnings/errors # These are hw issues like fan/laser or electronics failure, should be very rare. #error-check-interval = 3701 # stop-on-exit: whether to stop sen5x measurement mode if script exits/crashes # sen5x devices need to be running for some time for better accuracy, # so can be useful to disable if script is started/stopped on-timer/demand, # to avoid winding the sensor down needlessly. Defaults to "yes". #stop-on-exit = yes # reset-on-start: send "reboot" command to sensor firmware on startup # This is same as power cycle, so shouldn't be useful if it starts w/ rp2040 anyway. #reset-on-start = no # temp-comp-*: temperature compensation parameters # Values don't need scale factor, e.g. "offset = -3.2" will apply negative 3.2°C T offset. # offset/slope are float values, time-const is integer (seconds). Set before all measurements. # See SEN5x datasheet and Sensirion "Temperature Acceleration (STAR Engine) # and Compensation Instructions for SEN5x" PDF for more details on how to use these values. #temp-comp-offset = 0 #temp-comp-slope = 0 #temp-comp-time-const = 0 [webui] ## Parameters for web/browser interface and http(s) data export verbose = yes #port = 80 #conn-backlog = 5 #title = RP2040 SEN5x Air Quality Monitor # url-prefix: string to add/strip for every URL, if these are behind some reverse-proxy #url-prefix = /sensor-A/ # marks-storage-bytes: fixed buffer size to allocate for graph-marks when first saving those # Each graph mark-line takes 6B + label, so shouldn't normally take too much memory. #marks-storage-bytes = 512 # d3-load-from-internet: whether to enable loading D3.js visualization library # from cdn.jsdelivr.net on the internet, instead from the device, same as other stuff. # Defaults to "no", i.e. everything in WebUI is only loaded from the device itself. # Can be useful to enable if device does not have flash space for it, for testing, # to always use latest supported version that way, or if loading it like this is faster. #d3-load-from-internet = no #d3-api = 7 [alerts] ## Options to send UDP over-threshold alert packets, default-disabled ## Not intended for serious alerting/monitoring, but for stuff like desktop notifications. verbose = yes # min/max-*: generate UDP alerts for values over threshold # If enabled and send-to ip:port specified too, when sample has values outside # of these min/max bounds, it will be sent via UDP packet to set destination(s). # Disabled if no min/max values are defined. All supported thresholds are listed below. #max-pm = 30 #max-voc = 300 #max-nox = 300 #min-t = 0 #max-t = 40 #min-rh = 0 #max-rh = 75 # send-to: destination(s) to send alert UDP-packets to # Multple space-separated IP:port values can be specified to send multiple packets. # Packet format: sen5x-sample || space-separated-over-threshold-keys || crc-16f/5 # Alert packet can get a response with time-delta to temporarily disable that alert for that host. #send-to = 10.1.2.3:4567 # bind-port: which port to send packets from and listen on for replies, defaults to 5683 # Space-separated keys from alerts can be sent back here to disable alerts for a time. # Such replies are intended to be used as a receiver confirmation mechanism. # If they are not used, alert packets will keep being sent for every processed data sample. # Expected packet format: time-delta-sec [double] || keys || crc-16f/5 #bind-port = 5683