update readme

feature/frontend-charts
Kenneth Barbour 2024-09-14 11:46:40 -04:00
parent 2c1466c466
commit b9cb94b736
1 changed files with 65 additions and 23 deletions

View File

@ -1,30 +1,72 @@
<h1>uWeather Firmware</h1> # uWeather Firmware
Firmware for a small Arduino/ESP8266 + BME280 Weather Station
# Features Firmware for a small Arduino/ESP8266 + BME280 Weather Station.
## Weather over HTTP ## Features
See live weather data over a small webapp running on the weather station. Connect over mDNS or directly to the station's IP address if mDNS is not configured or supported.
## MQTT Data ### Weather Over HTTP
The station can send JSON encoded weather data to a configured MQTT Host. Currently, only communication over the standard port without TLS or authentication is supported. 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.
# Build/Install ### MQTT Data (Experimental)
`pio run -t upload`, then `pio run -t uploadfs` to build and upload code and filesystem for the first time, while connected over USB/Serial. 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.
If station is connected to wifi, uploading over the air is preferred: ## Build and Install
`pio run -t upload --upload-port 192.168.1.72` (substituting the station's IP address)
# Initial Station Setup 1. **Building and Uploading via USB/Serial:**
After installing firmware and booting for the first time: - Connect the ESP8266 to your computer via USB.
1) Using a smartphone or laptop, connect to the station's WiFi Access Point - Use PlatformIO to build and upload the firmware:
2) Access the setup page from 192.168.1.4/setup
3) Enter WiFi configuration and station settings
4) Optionally commit config settings to EEPROM(WiFi is automatically committed) by POST-ing to /config/commit for the settings to persist after a restart.
# TODO ```sh
* ~~Implement /wifi/scan~~ pio run --target upload
* Shutdown web server ```
* Configurable MQTT update interval
* Deep sleep - For the first time setup, also upload the filesystem:
* Remotely disable deep sleep
```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