I’ve been wrestling with trying to get an ESP32 to talk to TTN for a few days, and getting nowhere.
For my device, I have a TTGO ESP32 LoRa (v 1.1 I think). I connect to my TTN sandbox account as device in an application, and try to connect using Arduino LMIC library; specifically this example.
I don’t have my own gateway (well, I do have a couple of surplus RPis with RAK2287 hats but can’t get them to work as gateways - another issue). So I think I’m going through some local open gateway. That might be my issue. But the handshake works, so the gateway might not be the problem.
I set #define CFG_us915 2 in lmic_project_cfg.h because I understand that TTN works in block 2 of the US frequencies.
Then my device tries to connect via OTAA and things seem to almost work.
The console log of the ESP32 says:
9542103: EV_TXSTART
9885018: EV_JOINED
netid: 19
devaddr: 26xxxxxx
AppSKey: xx-xx-xx-xx..
NwkSKey: xx-xx-xx-xx..
9892765: EV_TXCOMPLETE (includes waiting for RX windows)
17392794: EV_TXSTART
Packet queued
17784180: EV_TXCOMPLETE (includes waiting for RX windows)
25284205: EV_TXSTART
Packet queued
25675591: EV_TXCOMPLETE (includes waiting for RX windows)
33175615: EV_TXSTART
Packet queued
And the console at TTN says:
17:30:42 Forward join-accept message
17:30:41 Successfully processed join-request
17:30:41 Accept Join Request
But the ‘hello world’ packets that this code sends out every 60s don’t get recorded; there’s the esp32’s EV_TXSTART but nothing to indicate receipt.
I think TTN should be getting my “hello world” and sending back an ACK that my esp32 console prints out.
Something is working, because the connection worked (and a matching device address appeared on both ends). But after the handshake, nothing.
I also try to generate a synthetic uplink message using TTN console’s ‘Messaging’ feature, but it never triggers the EV_RXCOMPLETE case in the esp32 code.
Does anyone have any suggestions what might be happening? Apologies for my cluelessness; this is all rather new to me.