another update
This commit is contained in:
No files matched your search
@@ -1,8 +1,6 @@
|
||||
# ESP32-H2 POCSAG Receiver
|
||||
|
||||
An experimental ESP-IDF 6.0 receiver for 1200-baud POCSAG using an ESP32-H2, CC1101, and 128x64 SPI SSD1306 OLED. The CC1101 is configured for a 26 MHz crystal and 435 MHz by default. Reception is decoded in firmware from the CC1101 asynchronous GDO0 output.
|
||||
|
||||
This project is receive-only. It does not implement POCSAG transmission.
|
||||
An experimental ESP-IDF 6.0 pager tool for 1200-baud POCSAG using an ESP32-H2, CC1101, and 128x64 SPI SSD1306 OLED. The CC1101 is configured for a 26 MHz crystal and 435 MHz by default. Reception is decoded from its asynchronous GDO0 output. A preset-driven test transmitter is available from the UI.
|
||||
|
||||
## Hardware Pins
|
||||
|
||||
@@ -44,13 +42,13 @@ BAT+ ---- Rtop ----+---- GPIO2 (ADC1_CH1)
|
||||
GND ---------------+---- ESP32-H2 GND
|
||||
```
|
||||
|
||||
The defaults in `main/main.c` are `Rtop = 100 kOhm` and `Rbottom = 100 kOhm`, so 4.2 V at the battery produces about 2.1 V at the ADC pin. Use the actual installed resistor values in `BATTERY_DIVIDER_TOP_OHMS` and `BATTERY_DIVIDER_BOTTOM_OHMS`; the firmware calculates:
|
||||
The defaults in `main/pager_config.h` are `Rtop = 100 kOhm` and `Rbottom = 100 kOhm`, so 4.2 V at the battery produces about 2.1 V at the ADC pin. Use the actual installed resistor values in `BATTERY_DIVIDER_TOP_OHMS` and `BATTERY_DIVIDER_BOTTOM_OHMS`; the firmware calculates:
|
||||
|
||||
```text
|
||||
battery_mV = adc_pin_mV * (Rtop + Rbottom) / Rbottom
|
||||
```
|
||||
|
||||
After wiring and checking that the ADC pin voltage stays below the ESP32-H2 ADC limit, set `BATTERY_MONITOR_ENABLE` to `1`. The firmware uses ADC one-shot mode with IDF calibration, samples every five seconds, logs millivolts, and shows the voltage on the live screen. It is disabled by default because this board revision has no built-in voltage-sense circuit.
|
||||
After wiring and checking that the ADC pin voltage stays below the ESP32-H2 ADC limit, set `BATTERY_MONITOR_ENABLE` to `1`. The firmware uses calibrated ADC one-shot readings every five seconds and shows an estimated state of charge on Live. The estimate maps 3.3 V to 0% and 4.2 V to 100%; it is only a rough Li-ion indicator, not a fuel gauge. Battery reading remains disabled by default because this board revision has no built-in voltage-sense circuit.
|
||||
|
||||
## Controls and Menu
|
||||
|
||||
@@ -62,8 +60,10 @@ With the added buttons:
|
||||
|
||||
The menu contains:
|
||||
|
||||
- **Filter:** Private mode is the default and stores/displays only `MY_RIC`. Monitor mode stores/displays all decoded RICs. Switching modes clears the in-memory history.
|
||||
- **Filter:** Monitor mode is the current default and stores/displays all decoded RICs. Private mode stores/displays only the selected own RIC. Switching modes clears saved history.
|
||||
- **Frequency:** opens the receive-only tuner.
|
||||
- **My RIC:** cycles the current own address through the RIC presets in `main/pager_presets.c`; the choice is stored in NVS and drives private filtering and own-page alerts.
|
||||
- **TX test presets:** opens the transmitter screen.
|
||||
- **Live display:** returns to the main screen.
|
||||
- **Message history:** shows the eight most recent saved messages.
|
||||
- **Return:** goes back to the previous screen.
|
||||
@@ -74,6 +74,20 @@ The live screen updates while a message is decoded. Messages up to 159 character
|
||||
|
||||
Pages addressed to `MY_RIC` (default `1234567`) flash the normal LED on GPIO13 and NeoPixel on GPIO8 for approximately three seconds.
|
||||
|
||||
## TX Test Presets
|
||||
|
||||
Edit `ric_presets[]` and `tx_message_presets[]` in `main/pager_presets.c`. The same RIC list is used for the own-RIC selector and TX destination selector. The supplied list contains `MY PAGER` (`1234567`) and an example `TEST RIC 1` (`1234568`). Replace/add entries for pagers in your test setup.
|
||||
|
||||
`POCSAG_TX_ENABLE` in `main/pager_config.h` is enabled. The TX screen selects a destination with Up/Down and cycles the message with Select or BOOT tap. A long hold of Select or BOOT sends one short POCSAG alpha page. Presets include `POCSAG TEST`, `HELLO FROM H2`, and a generated `SYSTEM STATE` snapshot containing frequency, detected baud, history count, and battery percentage if battery sensing is enabled. The sender limits text to 32 characters, emits three batches, sets the CC1101 PATABLE entry from `TX_PATABLE_VALUE`, pauses sampling while transmitting, restores RX afterward, and enforces a 10-second minimum interval between sends.
|
||||
|
||||
## Source Modules
|
||||
|
||||
- `pager_config.h`: board pins and build-time radio, battery, and TX settings.
|
||||
- `pager_presets.c` / `pager_presets.h`: editable RIC and outbound message lists.
|
||||
- `pager_tx.c` / `pager_tx.h`: CC1101 asynchronous POCSAG test framing and RX restoration.
|
||||
- `pocsag_bch.c` / `pocsag_bch.h`: POCSAG BCH/parity correction.
|
||||
- `main.c`: application startup, receiver bitstream/state machine, NVS history, display, controls, and module coordination.
|
||||
|
||||
## Persistent Message History
|
||||
|
||||
The firmware stores the eight-entry message ring in the default NVS partition. Saved messages are restored after reboot or power loss. Private mode saves only `MY_RIC`; Monitor mode saves all decoded RICs. Changing the filter mode clears the stored history. NVS is initialized automatically on startup; if its metadata is incompatible or out of free pages, ESP-IDF recovery may erase the NVS partition and the saved messages.
|
||||
@@ -84,16 +98,18 @@ The ESP32-H2 has 4 MB of flash, and `sdkconfig` now sets the ESP image header fl
|
||||
|
||||
## Configuration
|
||||
|
||||
Important definitions are near the top of `main/main.c`:
|
||||
Important hardware and feature definitions are in `main/pager_config.h`:
|
||||
|
||||
- `RF_FREQ_HZ`: startup receive frequency.
|
||||
- `TUNE_MIN_HZ`, `TUNE_MAX_HZ`, `TUNE_STEP_HZ`: menu tuner range and step.
|
||||
- `MY_RIC`: private-mode address and own-page alert address.
|
||||
- `MY_RIC`: default own address and first RIC preset; edit `ric_presets[]` for other choices.
|
||||
- `POCSAG_TX_ENABLE`: enables the explicit TX menu action.
|
||||
- `TX_MIN_INTERVAL_MS`, `TX_MAX_MESSAGE_CHARS`, `TX_PATABLE_VALUE`: TX interval, size, and CC1101 power-table entry.
|
||||
- `BATTERY_MONITOR_ENABLE`: battery voltage reading, disabled by default.
|
||||
- `BATTERY_DIVIDER_TOP_OHMS`, `BATTERY_DIVIDER_BOTTOM_OHMS`: installed divider resistor values.
|
||||
- `OLED_IDLE_OFF_MS`: OLED timeout.
|
||||
|
||||
The firmware assumes a 26 MHz CC1101 crystal. Confirm the crystal and signal frequency for your hardware. The frequency tuner only changes the receiver frequency.
|
||||
The firmware assumes a 26 MHz CC1101 crystal. Confirm the crystal and signal frequency for your hardware. The frequency tuner changes the receiver and transmitter frequency.
|
||||
|
||||
## Build and Flash
|
||||
|
||||
@@ -105,8 +121,8 @@ idf.py -p PORT flash
|
||||
idf.py -p PORT monitor
|
||||
```
|
||||
|
||||
The component dependencies include the ESP-IDF GPIO, SPI, GPTimer, ADC, NVS, and Espressif LED-strip drivers.
|
||||
The component dependencies include the ESP-IDF GPIO, SPI, GPTimer, ADC, NVS, ROM timing, and Espressif LED-strip drivers.
|
||||
|
||||
## Limitations
|
||||
|
||||
This is a proof of concept, not a certified pager or radio product. Reception quality depends on CC1101 configuration, antenna, RF environment, and signal timing. The firmware does not transmit pages or save menu settings across reboot.
|
||||
This is a proof of concept, not a certified pager or radio product. Reception quality depends on CC1101 configuration, antenna, RF environment, and signal timing. The TX path has not been validated over the air against every CC1101 module/crystal/antenna combination. Own-RIC selection and message history persist in NVS; menu modes and tuned frequency do not persist across reboot.
|
||||
Reference in New Issue
Block a user