uweather_firmware/README.markdown

73 lines
2.6 KiB
Markdown

# uWeather Firmware
Firmware for a small Arduino/ESP8266 + BME280 Weather Station.
## Features
### Weather Over HTTP
Access live weather data via a web app running on the weather station. Connect using mDNS (`weather.local`) or directly to the station's IP address if mDNS is not configured or supported.
### MQTT Data (Experimental)
The station can send JSON-encoded weather data to a configured MQTT host. Currently, it supports communication only over the standard port without TLS or authentication.
## Build and Install
1. **Building and Uploading via USB/Serial:**
- Connect the ESP8266 to your computer via USB.
- Use PlatformIO to build and upload the firmware:
```sh
pio run --target upload
```
- For the first time setup, also upload the filesystem:
```sh
pio run --target uploadfs
```
2. **Uploading Over the Air (OTA):**
- If the station is already connected to WiFi, OTA uploads are preferred:
```sh
pio run --target upload --upload-port <station_ip_address>
```
- Replace `<station_ip_address>` with the actual IP address of the station (e.g., `192.168.1.72`).
## Initial Station Setup
After installing the firmware and booting for the first time:
1. Connect to the station's WiFi Access Point using a smartphone or laptop.
2. Open the setup page at `http://192.168.1.4/setup`.
3. Enter the WiFi configuration and station settings.
4. Optionally commit config settings to EEPROM (WiFi settings are automatically saved). To persist other settings after a restart, POST to `/config/commit`.
**Note:** There are known issues with the initial WiFi connection process. As a workaround, temporarily set WiFi credentials manually in the code to ensure they are written to EEPROM.
## Monitoring via Serial UART
- Monitor the serial output at 74880 baud to see logs and debug information:
```sh
pio device monitor -b 74880
```
## Web Server Usage
- The web server is accessible via plain HTTP. By default, it responds at `weather.local` using mDNS. Alternatively, use the station's IP address if mDNS is not available.
## Known Issues and Troubleshooting
- **Initial WiFi Connection:** There are issues with connecting to WiFi for the first time. Manually setting the WiFi credentials in the code is a recommended workaround to write them to EEPROM.
- **MQTT:** The MQTT functionality is still experimental and may have limited support or issues. Currently, it does not support TLS or authentication.
## TODO
- ~~Implement /wifi/scan~~
- Shutdown web server
- Configurable MQTT update interval
- Deep sleep functionality
- Remotely disable deep sleep