Trying to get the LoRaWAN example to work

I’ve recently picked up an interest in LoRa and LoRaWAN, and have started experimenting with it a few weeks ago. Unfortunately, I’ve not have had much success so far…

I’ve been hesitant to open a new topic since there were already two other Lorawan topics active and maybe the answer to my problems would also pop up there, but unfortunately I think that is not the case. So another topic it is!

What hardware am I using?

I bought one Dragino Raspberry Pi hat running on an RPi2 and use it as a gateway to TheThingsNetwork.

I also bought a couple of devices that I intended to use as a node. One of them is this esp32 lorawan stick. If I’m not mistaken, this one is supported by RIOT under the name “esp32-heltec-lora32-v2”.

What works?

I installed the dual_chan_pkt_fwd software according to the Dragoni install guide. When I fill in the correct credentials it shows up on my TTN dashboard as “connected”. I flashed examples/lorawan on the heltec board (of course, again with the correct credentials). When I reset the board, I can see traffic in the dump of the gateway. Thus, the node is able to connect to the gateway. The TTN dashboard also confirms this: when I check the Traffic tab it shows two incoming Join requests (not sure why there’s two?) and a Join Accept message. So… the node is able to reach TTN through my gateway without any problems, and TTN also accepts its request to join the network. The Device page also confirms this: it shows one Activation package, and shows “Connected” as the device status. (Or something along the lines of “last seen: 10 seconds ago”) (See screenshots below)

Then what’s the problem?

Well… This is where the good news ends. Even though TTN reports a successful join, RIOT reports a failure:

 2021-02-08 22:00:49,293 # rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
2021-02-08 22:00:49,295 # configsip: 0, SPIWP:0xee
2021-02-08 22:00:49,301 # clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
2021-02-08 22:00:49,303 # mode:DOUT, clock div:2
2021-02-08 22:00:49,305 # load:0x3fff0018,len:4
2021-02-08 22:00:49,308 # load:0x3fff001c,len:4004
2021-02-08 22:00:49,310 # load:0x40078000,len:7304
2021-02-08 22:00:49,312 # load:0x40080000,len:7224
2021-02-08 22:00:49,314 # entry 0x40080350
2021-02-08 22:00:50,026 # RTC: Not found External 32 kHz XTAL. Switching to Internal 150 kHz RC chain
2021-02-08 22:00:50,078 # [rtt] 32.768 kHz crystal not used!
2021-02-08 22:00:50,078 # 
2021-02-08 22:00:50,081 # [rtt] 32.768 kHz crystal not used!
2021-02-08 22:00:50,086 # main(): This is RIOT! (Version: 2021.04-devel-229-g83201)
2021-02-08 22:00:50,089 # LoRaWAN Class A low-power application
2021-02-08 22:00:50,092 # =====================================
2021-02-08 22:00:50,096 # [semtech-loramac] initializing loramac
2021-02-08 22:00:50,152 # Starting join procedure
2021-02-08 22:00:50,156 # [semtech-loramac] Starting join procedure: 0
2021-02-08 22:00:50,158 # [semtech-loramac] loramac cmd msg
2021-02-08 22:00:50,162 # [semtech-loramac] starting OTAA join
2021-02-08 22:00:50,258 # [semtech-loramac] Transmission completed
2021-02-08 22:00:51,193 # [semtech-loramac] MAC timer timeout
2021-02-08 22:00:52,194 # [semtech-loramac] MAC timer timeout
2021-02-08 22:00:53,194 # [semtech-loramac] MAC timer timeout
2021-02-08 22:00:54,194 # [semtech-loramac] MAC timer timeout
2021-02-08 22:00:55,194 # [semtech-loramac] MAC timer timeout
2021-02-08 22:00:55,203 # [semtech-loramac] MAC timer timeout
2021-02-08 22:00:56,062 # [semtech-loramac] MAC timer timeout
2021-02-08 22:00:56,195 # [semtech-loramac] MAC timer timeout
2021-02-08 22:00:57,195 # [semtech-loramac] MAC timer timeout
2021-02-08 22:00:58,195 # [semtech-loramac] MAC timer timeout
2021-02-08 22:00:58,206 # [semtech-loramac] RX timer timeout
2021-02-08 22:00:59,195 # [semtech-loramac] MAC timer timeout
2021-02-08 22:00:59,198 # [semtech-loramac] MLME confirm event
2021-02-08 22:00:59,202 # [semtech-loramac] MLME confirm msg received
2021-02-08 22:00:59,205 # [semtech-loramac] join not successful
2021-02-08 22:00:59,207 # Join procedure failed

I’ve been trying to find the cause, but have thus far failed to do so…

Some screenshots of the TTN-dashboard:

Anyone have an idea what might be going wrong and how I can get it to work?

Hey,

Can you enable debug and flash ? Then post the entire log ? You can do a flash and then reset the board to see the complete log.

Are you sure that its one from heltec? There are quite a large number of OEM’s making similar ones with small changes to even replacing the radio chip with equivalent. In most cases, it an issue with the stack not getting a reply from radio. Please check DIO0 here , if not right you can do a remap.

BTW, please mask your keys while sharing screenshots :crazy_face:

Hi akshaim, thanks for your reply!

Can you enable debug and flash ? Then post the entire log ? You can do a flash and then reset the board to see the complete log.

Is it possible that debug was already enabled in the dump I pasted above? The debug prints are the ones prefixed with [semtech-loramac]. Unless there’s another debug you want me to enable?

Are you sure that its one from heltec?

It does have the Heltec logo all over the board, so I’m assuming it must be Heltec’s? Unless some other manufacturer stamped Heltec’s logo ontop of it for fraudulent reasons…

There are quite a large number of OEM’s making similar ones with small changes to even replacing the radio chip with equivalent. In most cases, it an issue with the stack not getting a reply from radio. Please check DIO0 here , if not right you can do a remap.

This does make a lot of sense, yes. Any suggestion on which pins are common? That way I can try those first, before brute forcing all options :slight_smile:

BTW, please mask your keys while sharing screenshots :crazy_face:

You’re right. I should have blurred them. I didn’t bother because they’re currently only used for testing and I will probably delete them and generate new ones once I have everything working. (However, the codes in the screenshots are not keys, but IDs. Keys are hidden by default on TTN. You have to click the eye-icon to unblur them). I’ll black’m out in the future though. Thanks for pointing it out!

EDIT: I found this online:

Apparently it’s called “Heltec Panda Board”. According to this schematic, DIO is indeed on Pin 26.

Hey,

Did you manage to make it work ?

If not, do you have any other LoRa/LoRaWAN node available with you ? If so can you test whether the node is able to receive packets using this test, use listen mode and see if you are able to view the raw packets transmitted by other nodes. If you are unable to receive packets its usually wiring problem

Hello @akshaim! My apologies for the very late reply. I tested the sx127x drivertest as per your suggestion in combination with the same raspberry Pi I use as a gateway, but this time as an example node.

At first it appeared like it didn’t receive anything, but after setting the channel correctly I received plenty of packets. It seems to me like the wiring is okay.

2021-03-06 01:03:57,203 # IN DIO0 ISR!!
2021-03-06 01:03:57,208 # {Payload: "HELLO" (5 bytes), RSSI: 179, SNR: 5, TOA: 37}
2021-03-06 01:03:57,210 # Data reception started
2021-03-06 01:04:02,205 # IN DIO0 ISR!!
2021-03-06 01:04:02,210 # {Payload: "HELLO" (5 bytes), RSSI: 182, SNR: 5, TOA: 37}
2021-03-06 01:04:02,212 # Data reception started