Wersja polska / Polish version
| - |
ESP-igate v3 aka the iGate that finally talks to an iPhoneThe iGate firmware for dsTNCv2 has some history behind it. The first version was written by Krzysiek SP9SKP for the ESP01 module and served well for years - unfortunately the sources got lost and only the binaries remained. So I rewrote the whole thing from scratch, and since I was already deep in that code, I also moved it to something newer than the ESP01: the Seeed XIAO ESP32-C6. The module is the size of a fingernail, costs about as much as two coffees, and brings WiFi, BLE 5, 4 MB of flash and its own USB. The real reason was more specific than "because it's newer", though. Android users have APRSDroid and Bluetooth Classic SPP - that has worked forever. But iOS does not expose SPP at all, so there is no way to talk to an iPhone that way, neither through an HC-05 nor through any other BT module. The only route is Bluetooth Low Energy. The ESP01 has no BLE, the ESP32-C6 does - hence this version. The iGate exposes KISS over BLE as a Nordic UART Service, and the phone sees it as an ordinary TNC. Resources got more comfortable along the way. On the ESP01 the modem occupied the only UART, so the diagnostic log had to go out over the network. On the C6 the USB is a separate piece of hardware, the modem has its own UART, and I can watch the console over the cable and over UDP at the same time. The configuration moved from a hand-calculated flash sector into NVS, so there is no more guessing where the SDK keeps its own data.
Note: this is a fresh release, straight after the port. If you hit something odd - drop me a line and I'll fix it.
Everything at 3V3 levels, common ground, 19200 8N1. Three wires plus ground:
XIAO D6 (GPIO16) ----> dsTNCv2 modem RX
XIAO D7 (GPIO17) <---- dsTNCv2 modem TX
XIAO D3 (GPIO21) <---- modem CTS (HIGH = ready, LOW = busy)
* input with an internal pull-up *
GND ----- GND
CTS is pulled up, so if you forget that wire the iGate will consider the modem permanently ready and transmit blindly. Better to connect it - the dsPIC drops a frame if a second one enters its UART while the first is still being transmitted.
Three independent switches on the APRS tab. Only the first one is enabled by default, so BLE behaves like an ordinary TNC:
That last direction is the reason this exists at all: a phone with no cellular coverage gets the full APRS-IS traffic through the iGate, over BLE. The iGate filters out echoes so the same frame does not land on the map twice - once from the air, once from the network.
The archive holds two bin files: factory (bootloader + partition table + application, flashed from zero) and app (application only, for updates without touching the configuration), a flash.sh script and a short README.
How do I flash the firmware?
esptool.py --chip esp32c6 --port /dev/ttyACM0 --baud 460800 \
write_flash -z 0x0 esp-igate_v3.0_factory.bin
An update, without touching the bootloader:
esptool.py --chip esp32c6 --port /dev/ttyACM0 --baud 460800 \
write_flash -z 0x10000 esp-igate_v3.0_app.bin
If the board refuses to be caught, enter the bootloader by hand: hold B, click R, release B.
What is the WiFi password and how do I set it up?
Can I use WiFi and BLE at the same time?
How do I connect an iPhone? service 6E400001-B5A3-F393-E0A9-E50E24DCCA9E RX 6E400002-B5A3-F393-E0A9-E50E24DCCA9E (write - phone to iGate) TX 6E400003-B5A3-F393-E0A9-E50E24DCCA9E (notify - iGate to phone)Those are the standard NUS UUIDs, so in most apps it is enough to pick the ready-made "Nordic UART" preset instead of typing anything in by hand. I use my own iOS app, still polishing it - once it is fit for other people, I will add a link here.
Why not a plain ESP32 with Bluetooth Classic, so APRSDroid works?
Can I hook this up to a radio with a built-in TNC, without a dsTNCv2? What you do have to sort out is level shifting to 3V3. The COM port on Kenwoods is RS-232 with real RS-232 levels, so something like a MAX3232 is needed; if the radio has a 5 V logic port, a level shifter or a divider is enough. The critical direction is the one into the ESP: 5 V, let alone 12 V from RS-232, applied straight to a C6 pin ends with replacing the module. The other way round is gentler, since 3V3 out of the ESP is usually enough for the radio input to read as a high. There is nothing to connect the CTS line to in such a setup, and nothing needs to be - the input is pulled up, so the iGate will treat the transmitter as permanently ready. For a receive-only iGate that makes no difference. If you turn on the digipeater or gating of APRS-IS messages out to RF, keep in mind that without CTS the iGate has no idea when the radio's TNC is transmitting and may push a frame into it mid-transmission. The dsTNCv2 does have that line, which is why it is the safer pairing.
Does the old ESP01 stop working?
On-board or external antenna?
My configuration disappeared after an update - what happened?
Where do I get the module? If you have questions - feel free to drop me a mail. Keep in mind though that I have plenty on my plate and may answer with some delay :-) 73! DE Tomek, SP9UOB.
|
- |