Connect the BME280 STEMMA QT board to the Feather RP2040 Adalogger's STEMMA QT port with a STEMMA QT cable.
Add the Configuration File
Offline mode relies on a configuration file called config.json. This file contains information about the hardware and what's connected to it.
Below is an example configuration file for an RP2040 AdaLogger connected to a BME280 sensor. Save this file to your computer as config.json.
{ "exportedFromDevice": { "referenceVoltage": 3.3, "totalGPIOPins": 18, "totalAnalogPins": 4, "sd_cs_pin": 23, "statusLEDBrightness": 0.5 }, "components": [ { "name": "BME280 Sensor", "componentAPI": "i2c", "i2cDeviceName": "bme280", "period": 15, "i2cDeviceAddress": "0x77", "i2cDeviceSensorTypes": [ {"type": "relative-humidity"}, {"type": "ambient-temp"}, {"type": "ambient-temp-fahrenheit"}, {"type": "pressure"}, {"type": "altitude"} ] } ] }
Connect the RP2040 Adalogger Feather to your computer's USB. You should see the Adalogger Feather's pixel glow yellow.
On your computer, drag and drop the config.json file to the WIPPER drive.
Verify that WIPPER drive contains the following files:
- config.json
- secrets.json
- wipper_boot_out.txt
Then, press the RESET button on your board. The board should restart and "load" the new config.json file.
Once the Feather reboots, its status pixel should briefly blink the color green to indicate that the hardware has been successfully configured and data is logging into the MicroSD card.
A new .log file is created on the microSD card each time the Feather is rebooted.
Every 15 seconds, the Feather reads the BME280 sensor's data and writes this data to the MicroSD card. The Feather's LED blinks green every few minutes to indicate that it is still logging data.
Do not remove the microSD card while the Feather is connected to power.
Viewing the microSD Card's Data
When you are ready to view the logged data, first unplug the Feather from USB power. Then, remove the microSD card and insert it into your computer using a microSD card reader.
ALWAYS disconnect power from the Feather first, before removing the microSD card!
About the Log File
Each .log file uses the JSON Lines text file format. It's a great format for storing log files!
We opted to use JSONL instead of CSV files because if power is removed from the logger while it's logging, the file may become corrupted. Attempting to rescue a corrupted CSV file is very difficult and often requires guesswork to reconstruct the file. On the other hand, JSONL files are easy to read, each new line in the file is a JSON-encoded line of text. Each log line follows the previous line formatting, making it easy to see an error in a potentially corrupted file and reconstruct the line.
Reading the Log File
Each line of the log file corresponds to a different component within the config.json file.
For example, the config.json file on the board defines a BME280 sensor reading specific data.
... "components": [ { "name": "BME280 Sensor", "componentAPI": "i2c", "i2cDeviceName": "bme280", "period": 15, "i2cDeviceAddress": "0x77", "i2cDeviceSensorTypes": [ {"type": "ambient-temp"}, {"type": "ambient-temp-fahrenheit"}, {"type": "relative-humidity"}, {"type": "pressure"}, {"type": "altitude"} ] ...
While a few sensor type
s are listed above, a lot more are supported by WipperSnapper depending on what sensor you are using.
The sensor types we support are:
Environmental Measurements
- ambient-temp
- ambient-temp-fahrenheit
- pressure
- relative-humidity
- altitude
- co2
- eco2
- tvoc
- gas-resistance
- voc-index
- nox-index
Particulate Matter
- pm10-std
- pm25-std
- pm100-std
- pm10-env
- pm25-env
- pm100-env
Temperature
- object-temp
- object-temp-fahrenheit
Electrical
- voltage
- current
Motion & Position
- accelerometer
- gyroscope
- gravity
- orientation
- magnetic-field
- linear-acceleration
- rotation-vector
- proximity
Light & Color
- light
- lux
- color
Data Types
- raw
- unitless-percent
- bytes
- boolean
The corresponding log file for the config.json file above looks like the following:
{"i2c_address":"0x77","timestamp":0,"value":21.84,"si_unit":"C"} {"i2c_address":"0x77","timestamp":1,"value":71.312,"si_unit":"F"} {"i2c_address":"0x77","timestamp":2,"value":31.1377,"si_unit":"%"} {"i2c_address":"0x77","timestamp":3,"value":1001.109,"si_unit":"hPa"} {"i2c_address":"0x77","timestamp":4,"value":101.5793,"si_unit":"m"}
To visualize the data produced - you can convert the JSONLines file to a CSV or manually parse it in your favorite spreadsheet program (Excel, Google Sheets) or numeric computing program (MATLAB, Jupyter, etc.).
NOTE: This website only works for JSONL files <= 5MB.
Viewing USB-Serial Output
In addition to logging data to a microSD card, WipperSnapper also streams data over USB-serial. The data streamed over USB also uses the JSON Lines text file format.
To view the output, use a serial terminal client (such as PuTTY, TerraTerm, or even the Arduino IDE's serial monitor) to connect to the USB device, and set the terminal's baud rate to 115200 baud.
In your serial terminal, you should see the output begin with debugging info and then begin to record data:
Adding a Real-Time Clock (RTC)
The timestamp
field in the JSON log increments with each measurement taken, it does not reflect the "actual" time the measurement was taken. To get that, you'll need to connect an RTC module like the DS3231 Precision RTC to your board.
Once an RTC is connected and defined within config.json, the log file will automatically include a timestamp (in unix timestamp format) with the precise time each measurement was read and logged to the microSD card.
Don't forget that a Real Time Clock requires a battery backup to operate. A CR1220 size battery goes in the back, make sure the + symbol on the battery is visible when you insert it!
Connect the Adalogger to your computer, the WIPPER drive should appear.
Open the config.json file in a text editor and make the following modification to the exportedFromDevice
array to add a rtc
key/value pair.
{ "exportedFromDevice": { "referenceVoltage": 3.3, "totalGPIOPins": 18, "totalAnalogPins": 4, "sd_cs_pin": 23, "statusLEDBrightness": 0.5, "rtc": "DS3231" }, ...
Save the configuration file. Then, press the Adalogger's RESET button.
When the Adalogger boots back up, each line in the log file's timestamp will now reflect the actual time (as a UNIX timestamp):
{"i2c_address":"0x77","timestamp":1740661260,"value":22.11,"si_unit":"C"} {"i2c_address":"0x77","timestamp":1740661260,"value":71.798,"si_unit":"F"} {"i2c_address":"0x77","timestamp":1740661260,"value":31.82617,"si_unit":"%"} {"i2c_address":"0x77","timestamp":1740661260,"value":1000.35,"si_unit":"hPa"} {"i2c_address":"0x77","timestamp":1740661260,"value":107.9562,"si_unit":"m"}
Page last edited March 04, 2025
Text editor powered by tinymce.