Skip to content

Commit 3ac95df

Browse files
authored
Merge pull request genestealer#87 from genestealer/copilot/fix-readme-formatting-issue
Fix malformed README list structure in bottom configuration/advanced sections
2 parents 95c629a + 1d316dc commit 3ac95df

1 file changed

Lines changed: 61 additions & 73 deletions

File tree

README.md

Lines changed: 61 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -531,84 +531,76 @@ Both MQTT and ESPHome modes expose a **history sensor** containing 12 months of
531531
### Local Development Setup
532532

533533
1. **Install Required Tools**
534-
- Download and install [Visual Studio Code](https://code.visualstudio.com/).
535-
- Install the [PlatformIO extension for VS Code](https://platformio.org/).
536-
This will install all required dependencies and may require restarting VS Code.
534+
- Download and install [Visual Studio Code](https://code.visualstudio.com/).
535+
- Install the [PlatformIO extension for VS Code](https://platformio.org/).
536+
- This will install all required dependencies and may require restarting VS Code.
537537

538538
2. **Prepare Configuration Files**
539-
- Copy `include/private.example.h` to `include/private.h`.
540-
- Update the following details in `private.h`:
541-
- Wi-Fi and MQTT credentials.
542-
If your MQTT setup does not require a username and password, comment out those lines using `//`.
543-
- **Meter Code** - Copy the code under the barcode (ignore the manufacturing date):
544-
- Label format: `YY-SSSSSSS-NNN` (example: `23-1875247-234`)
545-
- Set `METER_CODE` to the same value **with dashes** — suffix `-NNN` is optional
546-
- Year is parsed from the first 2 digits (`YY`)
547-
- Serial is parsed from the middle section (`SSSSSSS`) and used in topics/entity prefixes
548-
- Last 3 digits (`NNN`), if present, are ignored by the radio protocol
549-
550-
Example:
551-
```cpp
552-
// Label text: 23-1875247-234 (with suffix, 12 digits)
553-
#define METER_CODE "23-1875247-234"
554-
555-
// Same meter, without suffix (9 digits — also valid)
556-
#define METER_CODE "23-1875247"
557-
558-
// Label with leading zeros in serial: 23-0123456-234
559-
#define METER_CODE "23-0123456-234"
560-
```
561-
![Cyble Meter Label](docs/images/meter_label.jpg)
562-
- **Wi-Fi PHY Mode**: To enable 802.11g Wi-Fi PHY mode, set `ENABLE_WIFI_PHY_MODE_11G` to `1` in the `private.h` file.
563-
By default, it is set to `0` (disabled).
564-
- Radio debug: control verbose CC1101/RADIAN debug output with `DEBUG_CC1101` in `private.h`.
565-
- `#define DEBUG_CC1101 1` enables verbose radio debugging (default in the example file).
566-
- `#define DEBUG_CC1101 0` disables verbose radio debugging.
539+
- Copy `include/private.example.h` to `include/private.h`.
540+
- Update the following details in `private.h`:
541+
- Wi-Fi and MQTT credentials. If your MQTT setup does not require a username and password, comment out those lines using `//`.
542+
- **Meter Code** - Copy the code under the barcode (ignore the manufacturing date):
543+
- Label format: `YY-SSSSSSS-NNN` (example: `23-1875247-234`)
544+
- Set `METER_CODE` to the same value **with dashes** — suffix `-NNN` is optional
545+
- Year is parsed from the first 2 digits (`YY`)
546+
- Serial is parsed from the middle section (`SSSSSSS`) and used in topics/entity prefixes
547+
- Last 3 digits (`NNN`), if present, are ignored by the radio protocol
548+
- Example:
549+
```cpp
550+
// Label text: 23-1875247-234 (with suffix, 12 digits)
551+
#define METER_CODE "23-1875247-234"
552+
553+
// Same meter, without suffix (9 digits — also valid)
554+
#define METER_CODE "23-1875247"
555+
556+
// Label with leading zeros in serial: 23-0123456-234
557+
#define METER_CODE "23-0123456-234"
558+
```
559+
- ![Cyble Meter Label](docs/images/meter_label.jpg)
560+
- **Wi-Fi PHY Mode**: To enable 802.11g Wi-Fi PHY mode, set `ENABLE_WIFI_PHY_MODE_11G` to `1` in the `private.h` file. By default, it is set to `0` (disabled).
561+
- Radio debug: control verbose CC1101/RADIAN debug output with `DEBUG_CC1101` in `private.h`.
562+
- `#define DEBUG_CC1101 1` enables verbose radio debugging (default in the example file).
563+
- `#define DEBUG_CC1101 0` disables verbose radio debugging.
567564

568565
3. **Select Your Board Environment**
569-
- Use the PlatformIO status bar at the bottom of VS Code to select your board:
570-
- `env:huzzah` - Adafruit HUZZAH ESP8266 (USB upload)
571-
- `env:huzzah-ota` - Adafruit HUZZAH ESP8266 (OTA upload)
572-
- `env:d1_mini` - WeMos D1 Mini (USB upload)
573-
- `env:d1_mini-ota` - WeMos D1 Mini (OTA upload)
574-
- `env:d1_mini_pro` - WeMos D1 Mini Pro (USB upload)
575-
- `env:d1_mini_pro-ota` - WeMos D1 Mini Pro (OTA upload)
576-
- `env:nodemcuv2` - NodeMCU v2 (USB upload)
577-
- `env:nodemcuv2-ota` - NodeMCU v2 (OTA upload)
578-
- `env:esp32dev` - ESP32 DevKit (USB upload)
579-
- `env:esp32dev-ota` - ESP32 DevKit (OTA upload)
580-
- **For first-time setup**: Use the standard environment (without `-ota`)
581-
- **For OTA updates**: After your device is running on Wi-Fi, use the `-ota` environment and update the IP address in `platformio.ini`
582-
- See the "Quick Start" section above for detailed build and upload instructions
566+
- Use the PlatformIO status bar at the bottom of VS Code to select your board:
567+
- `env:huzzah` - Adafruit HUZZAH ESP8266 (USB upload)
568+
- `env:huzzah-ota` - Adafruit HUZZAH ESP8266 (OTA upload)
569+
- `env:d1_mini` - WeMos D1 Mini (USB upload)
570+
- `env:d1_mini-ota` - WeMos D1 Mini (OTA upload)
571+
- `env:d1_mini_pro` - WeMos D1 Mini Pro (USB upload)
572+
- `env:d1_mini_pro-ota` - WeMos D1 Mini Pro (OTA upload)
573+
- `env:nodemcuv2` - NodeMCU v2 (USB upload)
574+
- `env:nodemcuv2-ota` - NodeMCU v2 (OTA upload)
575+
- `env:esp32dev` - ESP32 DevKit (USB upload)
576+
- `env:esp32dev-ota` - ESP32 DevKit (OTA upload)
577+
- **For first-time setup**: Use the standard environment (without `-ota`)
578+
- **For OTA updates**: After your device is running on Wi-Fi, use the `-ota` environment and update the IP address in `platformio.ini`
579+
- See the "Quick Start" section above for detailed build and upload instructions
583580

584581
4. **Perform Frequency Discovery (First-Time Setup)**
585-
- On the very first boot (or anytime there is no stored frequency offset), the firmware automatically launches a wide scan while `AUTO_SCAN_ENABLED` is set to `1` (default).
586-
- If you need to skip the scan during development (for example, when you already know the meter's frequency), add `#define AUTO_SCAN_ENABLED 0` to your `include/private.h`.
587-
- Compile and upload the code to your ESP device using PlatformIO. Use **PlatformIO > Upload and Monitor**.
588-
- **Keep the device connected to your computer during this process.** The serial monitor will display debug output as the device scans frequencies in the 433 MHz range.
589-
- **Important**: During the initial scan (first boot with no stored frequency offset), the device performs a wide frequency scan that takes approximately 2 minutes **before** connecting to MQTT.
590-
You will see no MQTT/Home Assistant activity during this time - this is normal.
591-
Monitor the serial output to see the scan progress.
592-
Once the scan completes and the optimal frequency is found, the device will connect to MQTT and publish telemetry data.
593-
- Once the correct frequency is identified, update the `FREQUENCY` value in `private.h` if needed (the automatic scan stores the offset, so manual adjustment is usually not required).
594-
- To re-run the wide scan later, either set `CLEAR_EEPROM_ON_BOOT` to `1` for a single boot cycle or re-enable `AUTO_SCAN_ENABLED`.
595-
- For best results, perform this step during local business hours when the meter is most likely to transmit.
596-
Refer to the "Frequency Adjustment" section below for additional guidance.
582+
- On the very first boot (or anytime there is no stored frequency offset), the firmware automatically launches a wide scan while `AUTO_SCAN_ENABLED` is set to `1` (default).
583+
- If you need to skip the scan during development (for example, when you already know the meter's frequency), add `#define AUTO_SCAN_ENABLED 0` to your `include/private.h`.
584+
- Compile and upload the code to your ESP device using PlatformIO. Use **PlatformIO > Upload and Monitor**.
585+
- **Keep the device connected to your computer during this process.** The serial monitor will display debug output as the device scans frequencies in the 433 MHz range.
586+
- **Important**: During the initial scan (first boot with no stored frequency offset), the device performs a wide frequency scan that takes approximately 2 minutes **before** connecting to MQTT. You will see no MQTT/Home Assistant activity during this time - this is normal. Monitor the serial output to see the scan progress. Once the scan completes and the optimal frequency is found, the device will connect to MQTT and publish telemetry data.
587+
- Once the correct frequency is identified, update the `FREQUENCY` value in `private.h` if needed (the automatic scan stores the offset, so manual adjustment is usually not required).
588+
- To re-run the wide scan later, either set `CLEAR_EEPROM_ON_BOOT` to `1` for a single boot cycle or re-enable `AUTO_SCAN_ENABLED`.
589+
- For best results, perform this step during local business hours when the meter is most likely to transmit. Refer to the "Frequency Adjustment" section below for additional guidance.
597590

598591
5. **Build and Upload**
599-
- Follow the build and upload instructions in the "Quick Start" section above.
600-
- For first-time setup, use USB upload with the standard environment (e.g., `env:huzzah`).
601-
- Keep the device connected to your computer during USB upload.
592+
- Follow the build and upload instructions in the "Quick Start" section above.
593+
- For first-time setup, use USB upload with the standard environment (e.g., `env:huzzah`).
594+
- Keep the device connected to your computer during USB upload.
602595

603596
6. **Verify Meter Data**
604-
- After WiFi and MQTT connection is established (or after the initial frequency scan completes), the meter data should appear in the terminal (bottom panel) and be pushed to MQTT.
605-
- If Frequency Discovery is still enabled, its output will also be displayed during this step.
606-
- **Note**: On first boot with no stored frequency offset, there will be a ~2 minute delay before any MQTT activity while the wide frequency scan runs.
607-
This is normal - monitor the serial output to see progress.
597+
- After WiFi and MQTT connection is established (or after the initial frequency scan completes), the meter data should appear in the terminal (bottom panel) and be pushed to MQTT.
598+
- If Frequency Discovery is still enabled, its output will also be displayed during this step.
599+
- **Note**: On first boot with no stored frequency offset, there will be a ~2 minute delay before any MQTT activity while the wide frequency scan runs. This is normal - monitor the serial output to see progress.
608600

609601
7. **Automatic Meter Query**
610-
- The device will automatically query the meter once every 24 hours.
611-
If the query fails, it will retry every hour until successful.
602+
- The device will automatically query the meter once every 24 hours.
603+
- If the query fails, it will retry every hour until successful.
612604

613605
<details>
614606
<summary>Continuous Integration (for contributors)</summary>
@@ -710,11 +702,8 @@ The firmware auto-calibrates the CC1101 frequency. The base frequency is configu
710702
#### How it works
711703

712704
1. **Base frequency**: Set with `FREQUENCY` in `private.h` (e.g., `#define FREQUENCY 433.82`).
713-
2.
714-
**Default**: If `FREQUENCY` is not defined, it defaults to **433.82 MHz** (RADIAN center frequency for EverBlu).
715-
A warning is logged.
716-
3.
717-
**Calibration**: CC1101 synthesizer calibration runs automatically; the firmware also triggers a manual calibration during init.
705+
2. **Default**: If `FREQUENCY` is not defined, it defaults to **433.82 MHz** (RADIAN center frequency for EverBlu). A warning is logged.
706+
3. **Calibration**: CC1101 synthesizer calibration runs automatically; the firmware also triggers a manual calibration during init.
718707
4. **FOC**: Frequency Offset Compensation is enabled to handle small drift during reception.
719708
5. **Not published to MQTT**: It’s a low-level setting and already visible in the serial startup log.
720709

@@ -746,8 +735,7 @@ The effective frequency is printed at startup:
746735
To handle CC1101 crystal tolerance, the firmware can adapt over time:
747736

748737
1. **Wide scan (first boot)**: If no offset is stored, scans ±100 kHz around the base frequency (~1–2 minutes).
749-
2.
750-
**Tracking**: After successful reads, averages frequency error and updates the stored offset when it’s consistently off.
738+
2. **Tracking**: After successful reads, averages frequency error and updates the stored offset when it’s consistently off.
751739
3. **FOC tuned**: CC1101 FOC is configured for EverBlu/RADIAN frames.
752740

753741
#### When to clear EEPROM

0 commit comments

Comments
 (0)