5 Commits

Author SHA1 Message Date
gballan 6acdc6c7f8 [Issue #7] - Added config.go setting to allow setting the hostname
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
2026-09-12 02:01:02 -04:00
gballan a23507b2ca [Issue #6] - added config option to enable/disable icmp packets
ci/woodpecker/push/woodpecker Pipeline was successful
2026-09-12 01:58:24 -04:00
gballan 6e2882dc8d Updating repository information to point to Bit Goblin
ci/woodpecker/push/woodpecker Pipeline was successful
2026-09-07 01:26:45 -04:00
gballan af084ea33f Updating README with information about the hardware used
ci/woodpecker/push/woodpecker Pipeline was successful
2026-09-07 01:21:24 -04:00
gballan 6cc457c958 Adding a version badge via shields.io
ci/woodpecker/push/woodpecker Pipeline is running
2026-09-07 01:10:02 -04:00
5 changed files with 39 additions and 6 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
Copyright (c) 2026 gballan.
Copyright (c) 2026 Bit Goblin.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+28 -3
View File
@@ -1,18 +1,43 @@
# Pico Weather
![Woodpecker CI badge](https://builds.metaunix.net/api/badges/92/status.svg)
![shields.io version badge](https://img.shields.io/gitea/v/release/BitGoblin/pico-weather?gitea_url=https://git.metaunix.net)
Raspberry Pi Pico app to read BME280 sensor data and send it to Home Assistant.
Made in Go with [TinyGo](https://tinygo.org/).
## Requirements
## Hardware
The following hardware is what I used for a deployment:
* Raspberry Pi Pico 2 W: https://www.amazon.com/dp/B0DRJXPPWL
* The **W** is VERY important, as without networking it can't reach Home Assistant!
* Also a Raspberry Pi Pico W *should* work too, but I haven't tested it yet
* Waveshare Bosch BME280 sensor: https://www.amazon.com/dp/B07Q47DFXS
* Elegoo SSD1306 LCD: https://www.amazon.com/dp/B0FSRQG23K
Most (or all?) of these components can be swapped for equivalent components. You just need to make sure the code is compatible with whatever board you choose (not likely), is a genuine BME280 sensor, and an SSD1306 display.
Support for other hardware types may come in the future, but if there's a specific sensor or board you're in submit an issue or pull request!
### Prototyping
To help with debugging/testing deployments, I also used these components:
* Elegoo 400-pin Breadboard: https://www.amazon.com/dp/B01EV640I6
* Freenove Raspberry Pi Pico Breakout Board: https://www.amazon.com/dp/B0BFB53Y2N
* Elegoo 20cm Jumper Cables 120 count: https://www.amazon.com/dp/B01EV70C78
## Software Deployment
### Requirements
* [TinyGo](https://tinygo.org/getting-started/install/) - TinyGo installation guide
## Deployment
### Steps
1. Clone this git repository `git clone https://git.metaunix.net/gballan/pico-weather`.
1. Clone this git repository `git clone https://git.metaunix.net/BitGoblin/pico-weather`.
2. Copy `config.go.example` to `config.go` and modify the values to match your environment.
3. Hold down the **BOOTSEL** button on your Raspberry Pi Pico 2W.
4. Plug in your Pico to a USB port on your PC.
+4
View File
@@ -8,6 +8,10 @@ const (
WifiSSID = "My Wifi Name"
WifiPass = "SecretWifiPassword"
// Networking settings
Hostname = "pico2w-bme280"
EnableICMP = true
MQTTHost = "192.168.1.50" // Must be an IP address; DNS resolution is not supported currently
MQTTPort = "1883"
MQTTUser = "" // Leave empty if not required
+1 -1
View File
@@ -1,4 +1,4 @@
module git.metaunix.net/gballan/pico-weather
module git.metaunix.net/BitGoblin/pico-weather
go 1.25.2
+5 -1
View File
@@ -115,16 +115,20 @@ func InitNetwork(ssid, pass string) (*NetworkStack, error) {
stack := &xnet.StackAsync{}
err = stack.Reset(xnet.StackConfig{
Hostname: "pico2w-bme280",
Hostname: Hostname,
RandSeed: time.Now().UnixNano(),
MaxActiveTCPPorts: 2,
MTU: uint16(framelen - ethernet.MaxOverheadSize),
HardwareAddress: hwaddr,
ICMPQueueLimit: 4,
})
if err != nil {
return nil, fmt.Errorf("stack config reset: %w", err)
}
// Enable network pings if configured
_ = stack.EnableICMP(EnableICMP)
// Start background frame pump
ctx := context.Background()
go stackLoop(ctx, stack, adapter)