diff --git a/README.markdown b/README.markdown index e38084c..4a01f46 100644 --- a/README.markdown +++ b/README.markdown @@ -1,30 +1,72 @@ -

uWeather Firmware

-Firmware for a small Arduino/ESP8266 + BME280 Weather Station +# uWeather Firmware -# Features +Firmware for a small Arduino/ESP8266 + BME280 Weather Station. -## Weather over HTTP -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. +## Features -## MQTT Data -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. +### 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. -# Build/Install -`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. +### 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. -If station is connected to wifi, uploading over the air is preferred: -`pio run -t upload --upload-port 192.168.1.72` (substituting the station's IP address) +## Build and Install -# Initial Station Setup -After installing firmware and booting for the first time: -1) Using a smartphone or laptop, connect to the station's WiFi Access Point -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. +1. **Building and Uploading via USB/Serial:** + - Connect the ESP8266 to your computer via USB. + - Use PlatformIO to build and upload the firmware: -# TODO -* ~~Implement /wifi/scan~~ -* Shutdown web server -* Configurable MQTT update interval -* Deep sleep -* Remotely disable deep sleep \ No newline at end of file + ```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 + ``` + + - Replace `` 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