Unable to connect Wio-E5-dev kit to TTN using STM32CubeIDE

Summary
We tested LoRa wio e-5 using AT factory firmware initially and it worked fine.Now after erasing AT firmware and using STM32CubeIDE we are trying to connect wio-e5 dev kit to the things network LNS with our sensecap m2 gateway which is also connected to TTN and sending data, but our wio-e5 is not connecting to TTN application server. We followed the seeed studio’s github documentation for this. We have set our dev eui, join eui, and appkey in the macros of se-identity.h file in STM32CubeIDE according to our generated TTN application server details.
LoRa wio-e5 configuration:
STM32 configuration:

Package: Lorawan_endnode_main (with HAL for STM32WLE)
Mode: OTAA
Region: EU868
Low power mode: disabled

TTN end device configuration:

Frequency plan: Europe 863-870 MHz (SF9 for RX2 - recommended)
LoRaWAN version: LoRaWAN Specification 1.0.2
Regional Parameters version: RP001 Regional Parameters 1.0.2 revision B

We didn’t modify anything in the se-identity.h other than the above mentioned EUI id’s.

Logs
Wio e-5 is not joining the TTN network even after correctly following all the steps mentioned in the seeed studio’s github documentation

14:34:37.496 → APP_VERSION: V1.1.0
14:34:37.496 → MW_LORAWAN_VERSION: V2.3.0
14:34:37.496 → MW_RADIO_VERSION: V1.1.0
14:34:48.480 → ###### OTAA ######
14:34:48.782 → ###### AppKey: E1:5E:40:34:76:81:F5:16:07:60:00:CC:37:00:35:10
14:34:48.782 → ###### NwkKey: E1:5E:40:34:76:81:F5:16:07:60:00:CC:37:00:35:10
14:34:48.782 → ###### ABP ######
14:34:48.782 → ###### AppSKey: 21:7E:15:16:28:41:D7:A6:74:F7:E1:88:01:CF:4F:3C
14:34:48.782 → ###### NwkSKey: 21:7E:15:16:28:41:D7:A6:74:F7:E1:88:01:CF:4F:3C
14:34:59.915 → ###### DevEui: 2C:F1:F5:20:41:20:AB:8C
14:35:00.226 → ###### AppEui: 52:51:20:69:2E:54:48:26
14:35:00.226 → ###### DevAddr: 15:F9:45:F1
14:35:10.379 → 32s894:TX on freq 868100000 Hz at DR 0
14:35:32.175 → 54s676:MAC txTimeOut
14:35:33.910 →
14:35:33.910 → ###### = JOIN FAILED
14:35:58.169 → 80s677:temp= 27
14:35:58.169 → 80s677:VDDA= 254
14:36:04.850 → 87s350:TX on freq 868500000 Hz at DR 0
14:36:26.633 → 109s140:MAC txTimeOut
14:36:28.341 →
14:36:28.341 → ###### = JOIN FAILED
14:36:28.385 → 110s892:temp= 26
14:36:28.385 → 110s892:VDDA= 254
14:36:35.036 → 117s564:TX on freq 868100000 Hz at DR 0
14:36:56.816 → 139s346:MAC txTimeOut
14:36:58.567 →
14:36:58.567 → ###### = JOIN FAILED
14:36:58.567 → 141s098:temp= 26
14:36:58.567 → 141s098:VDDA= 254
14:37:05.236 → 147s769:TX on freq 868500000 Hz at DR 0
14:37:27.040 → 169s564:MAC txTimeOut
14:37:28.759 →
14:37:28.759 → ###### = JOIN FAILED
14:37:28.759 → 171s316:temp= 27
14:37:28.759 → 171s316:VDDA= 254
14:37:35.472 → 177s988:TX on freq 868500000 Hz at DR 0
14:37:57.225 → 199s786:MAC txTimeOut

Hardware
Seeed studio’s LoRa Wio E-5 dev board with STM32WLE5J, Seeed studio’s Sensecap m2 gateway.

Which .ioc did you use to generate the files - or if you used some pre-made files, where did you get them from?

Please format all logs / serial output with the </> tool, you can edit your post to do so.

I didn’t use cubemx to configure the device but directly changed the macros in the se-identity.h and lora_app.h files. I got the package from the official seeed studio lorawan node repository.

The LW version needs to be 1.0.3 - you can edit the device setup in Settings → Network layer.

Does the device Join Request appear in the gateway console?

How close to the gateway is the device - forum search will reveal much about having them too close!

I’ve tried every possible combination of configurations for the end device which includes having 1.0.3 LoRa version, nothing worked. And I can’t see anything in the gateway console too related to the end device’s join request. They are kept apart just less than 1 metre. I mean it did work with factory AT when they were kept the same distance apart.

Please search the forum about spacing & join requests & shouting at the gateway & overloading the RF and and and … :wink:

TL;DR: Long Range needs 10m & a brick wall away.

The version set & even the EUI’s / Keys don’t matter until you’ve got the gateway hearing the Join Request.

Hi, after you said I had tried connecting it at more than 10m distance with a wall in between, but it still doesn’t join the network, and I also can’t see any join requests showing up in the gateway live data in TTN.

Does the log on the gateway show it hearing the device, even if its not then relayed up to TTN?

Note, this is NOT the TTN console - its the log on the gateway.

No, even on the Sensecap local gateway console I am unable to see any join requests or anything related to the end device.

Is the device transmitting on the right frequencies? Looking at the join attempts it is using EU868. Is your gateway set to EU868 as well? (Setup at the gateway, not the TTN console)

As well as the wisdom of @kersing, I see you’ve linked to a branch of the Seeed code rather than main.

They provide the AT command project as well, so you can, in theory, return the Wio-E5 to it’s original state, log the serial output and share it here so we can do a compare & contrast.

From the provided log It looks like that the end-device is not properly transmitting.

The end-device stack indicates that a Tx timeout occurred.
Such timeout is triggered if the radio TxDone interrupt does not fire within specified time.

Most of time such issue is due to improper definition of the GPIOs controlling the radio device.

3 Likes

Probably best to use this:

I do, used it all day yesterday, used it for three years since release - its still based on ST’s variant of LoRaMac-node so you can’t just hack on it like it was Arduino so no escaping the wonders of learning CubeIDE / ST HAL etc

Have you come across the AT command project? If so can you send me the repository link?

It’s in the Seeed repro you’ve linked to, just use Main and not the branch

Sorry for the delay, even after trying with the main repo files we got the same results. Anyways we got it successfully working with LoRa E5 AT command library in arduino ide using ESP32 for our application.