A balcony weather station built with Pico W microcontrollers and the C SDK
Find a file
2025-04-08 19:31:01 +02:00
old_micro_python_code init converting project from micro python to c 2025-04-06 13:01:48 +02:00
.gitignore init converting project from micro python to c 2025-04-06 13:01:48 +02:00
bme280.c read raw bme280 values 2025-04-08 19:31:01 +02:00
bme280.h read raw bme280 values 2025-04-08 19:31:01 +02:00
CmakeLists.txt init bme_280 lib 2025-04-08 18:57:41 +02:00
flash.sh create helper scripts 2025-04-08 18:49:39 +02:00
LICENSE.md add LICENSE 2023-08-10 10:18:47 +02:00
node1.c read raw bme280 values 2025-04-08 19:31:01 +02:00
notes.txt get mqtt working with bem 280 sensor 2023-07-26 15:21:51 +02:00
pico_sdk_import.cmake init converting project from micro python to c 2025-04-06 13:01:48 +02:00
README.md clean up rocketry code and update readme with dev instructions 2025-04-06 13:14:48 +02:00
screen.sh create helper scripts 2025-04-08 18:49:39 +02:00

Balcony Weather Station

A DIY weather station on my balcony that is hooked up to Home Assistant.

The source code started as CircuitPython following many of the patterns I learned in creating an aquarium controller. I have since switch to using C.

Capabilities

Right now the station is fairly limited measuring only temperature, humidity, and atmospheric pressure. I have plans to expand the project to in the end measure:

  • tempature
  • humidity
  • atmospheric pressure
  • noise levels
  • wind speed
  • wind direction
  • rain fall
  • light

Hardware

Sensors:

MCs:

Other:

Note: I would not recommend buying from pimoroni from EU as shipping tax is huge!

Dev

Env Setup

From build folder run:

$ cmake -DPICO_BOARD=pico_w ..

This creates the needed makefiles

Build

This turns the test.c file in the root dir into .elf and .uf2 files:

$ make node1

Flash

Once you have the .uf2 file you can transfer it to the pico by putting the pico in bootsel mode (hold button and plug it into pc) or you can flash the .elf file to the pico using openocd:

openocd -f interface/cmsis-dap.cfg -f target/rp2040.cfg -c "adapter speed 5000" -c "program node1.elf verify reset exit"

note: after flashing with openocd the program will be paused. To unpause connect and run "continue"

Shell

You screen

$ fd tty.usb /dev
/dev/tty.usbmodem102
$ screen /dev/tty.usbmodem102 115200

Exit shell Ctrl+A Ctrl+|

Open debug connection

$ openocd -f interface/cmsis-dap.cfg -f target/rp2040.cfg -c "adapter speed 5000"

then in another window

$ lldb ./test.elf

Once in lldb you can do a bunch of stuff, see https://web.navan.dev/posts/2024-08-08-openocd-macos-lldb.html.

(lldb) platform select remote-gdb-server
...
(lldb) process connect connect://localhost:3333

Set breakpoint:

(lldb) breakpoint set --hardware --name main
(lldb) continue # Continue execution
(lldb) step     # Step in
(lldb) next     # Step over
(lldb) finish   # Step out

Check vars:

(lldb) frame variable
(lldb) print variable_name

Restarting the program:

(lldb) process plugin packet monitor reset run