KevsRobots Learning Platform
55% Percent Complete
By Kevin McAleer, 5 Minutes
Third board, third firmware variant. The process is identical; the interesting part comes at first boot, when the firmware goes looking for sensors.
If there is no Sensor variant listed
Sensor support is compiled per board, and not every board gets a prebuilt sensor image. If your board has no sensor build:
- Check whether a newer firmware release has added one
- Consider a board that does have one - the RAK WisBlock and Seeed variants are common sensor platforms
- Or build it yourself from the MeshCore repository, enabling the sensor flags in
platformio.iniLesson 13 covers the custom build route in more detail.
Do this now, before you power it up properly. The firmware scans the I2C bus at boot. A sensor plugged in afterwards will not be noticed until the next reset.
The wiring is four wires, and lesson 11 walks through it properly. For now:
| Sensor pin | Heltec V3 pin |
|---|---|
| VCC / VIN | 3V3 |
| GND | GND |
| SDA | GPIO33 |
| SCL | GPIO34 |
Not GPIO17 and GPIO18. Those are the OLEDβs bus. The sensor firmware scans a separate bus - see lesson 2.
If you would rather flash first and wire later, that is fine - just remember to reboot afterwards.
Connect the console and check the basics:
ver
board
get role
get radio
Then ask what it found:
sensor list
This is the moment of truth. If your BME280 is wired correctly and supported by this build, it appears here. If the list is empty or shows only battery, the firmware did not find your sensor.
sensor list takes an optional starting index if you have more sensors than fit in one response:
sensor list 5
sensor get <key>
sensor set <key> <value>
sensor get reads a single value by its key, which is useful for checking one thing without pulling the whole telemetry set. sensor set adjusts a sensor setting - the classic example being turning a GPS module on or off at runtime.
The available keys depend entirely on what is attached, which is why sensor list is where you always start.
Same as every other node:
get radio
Expect 869.618 MHz, 62.5 kHz, SF8, CR8 - matching the rest of your mesh. If not:
set radio 869.618,62.5,8,8
reboot
set name Greenhouse-Sensor
set lat 53.4084
set lon -2.9916
set owner.info Kev - kevsrobots.com
Name it after where it is, not what it is. Greenhouse tells you something useful when the reading looks odd. Sensor-02 does not.
get tx
set tx 17
Full power makes sense for mains nodes. For a battery sensor, dropping from 22 to 17 dBm roughly halves the transmit current for about 40% of the range. If your sensor has a repeater within easy reach, that is a good trade; if it is right at the edge, keep the power up.
The valid range is 1 to 22 dBm.
advert
Your client will not know the sensor exists until it hears an advert. Plain advert floods across the mesh; advert.zerohop announces only to nodes in direct range.
sensor list with nothing wired up. What does it report? (Battery and uptime should still be there.)sensor list again. Compare the two.sensor list. Does it notice? Now reboot and check again. This tells you a lot about when detection actually happens.Problem: sensor list shows nothing but battery.
Solution: Check the wiring, confirm the sensor is on the supported list, then reboot so the I2C scan runs again.
Why: Detection happens at boot. A sensor connected after startup is invisible until the next reset.
Problem: sensor list is not a recognised command.
Solution: You are on repeater or companion firmware, or a build without sensors compiled in.
Why: The sensor commands only exist when sensor support is compiled into that firmware image.
Problem: I wired the sensor to GPIO17 and GPIO18 and nothing was detected.
Solution: Move it to GPIO33 and GPIO34, then reboot.
Why: GPIO17 and GPIO18 are the OLEDβs bus. The sensor firmware scans a second, separate bus - so a perfectly wired sensor on the wrong bus is invisible.
Problem: The sensor works on USB but not on battery.
Solution: Check the Vext rail. On the Heltec V3, GPIO36 controls power to the external 3V3 rail.
Why: Some power-saving configurations switch the external rail off, which cuts power to anything you have wired to 3V3.
You can use the arrows β β on your keyboard to navigate between lessons.
Comments