LoRa E5 HF module, AT+KEY=APPKEY command

Hi,
I develop a custom device based on LoRa E5 HF module. Its firmware version is as follows:

Tx: AT+VER
Rx:+VER: 4.0.11

According to Seeed Wiki, module should reply ti AT+KEY command as follows

Tx: AT+KEY=APPKEY,"2B7E151628AED2A6ABF7158809CF4F3C"
Rx: +KEY: APPKEY 2B7E151628AED2A6ABF7158809CF4F3C

But when I send AT+KEY=APPKEY command to the module, there is no reply from module.

So far I have problems to join TTN network with that module. After AT+JOIN command I always recieve

AT+JOIN
+JOIN: Start
+JOIN: NORMAL
+JOIN: Join failed
+JOIN: Done

TTN console indicates “MIC mismatch”.

Well the AT+KEY=APPKEY command is to change the session key in device and you have to pass as parameter the new key so if you send command without parameters it won’t do anything !
If you want to read the default keys in device you have to use the AT+ID=DevAddr commands and similar :wink:
Have you created the device in TTN console ?

As described above, I’ve sent this command with parameters, as per Seeed Wiki:

AT+KEY=APPKEY,"2B7E151628AED2A6ABF7158809CF4F3C"

But I did not have any reply from the LoRa E5 module.

I’ve tried other variants:
– with spaces between bytes, such as AT+KEY=APPKEY,"2B 7E 15 16 28 AE D2 A6 AB F7 15 88 09 CF 4F 3C"
– with more than 16 bytes of data

In all those cases LoRa E5 module did not respond to those commands. This behaviour does not match description in the document “AT Command Specification rev 1.0”.

It responds if I sent less than 16 bytes:

 AT+KEY=APPKEY,"1234567890"
+KEY: ERROR(-1)

Also it responds is there is no data:

AT+KEY=APPKEY
+KEY: ERROR(-1)

Yes, I created device in TTN console. This is where I see the response “MIC mismatch”.

I’ve created and deleted device in TTN console about 10 times with different parameters: with different APPKEY, with different DevEUI, with MAC rev 1.0.2 and MAC rev 1.0.3, selected channels 1,2,8, etc. I always get “MIC mismatch” response from TTN console.

"data": {
    "@type": "type.googleapis.com/ttn.lorawan.v3.ErrorDetails",
    "namespace": "pkg/joinserver",
    "name": "mic_mismatch",
    "message_format": "MIC mismatch",
    "correlation_id": "6202256415f746c6913676f776740e94",
    "code": 3
  },

Quite strange your problem :frowning: What terminal do you use to connect with the E5 module ? I suspect a bad encoding in your terminal emulation software…

I use PuTTY. However, there is a microcontroller and a FT200XD chip between PuTTY and LoRa E5.

Thank you for the clue. I’ve checked the microcontroller’s code one more time and found that Tx buffer to LoRa E5 was too small, only 32 bytes. I’ve increased it to 64 bytes, and now I get proper response from LoRa E5

AT+KEY=APPKEY,"2B7E151628AED2A6ABF7158809CF4F3C"
+KEY: APPKEY 2B7E151628AED2A6ABF7158809CF4F3C

Good :wink: your problems clearly showed a problem of communication or bad/ not properly configured terminal emulation :smiley: Have fun with E5 !

Thanks a lot! Finally I was able to join network.

PS: By the way, by default LoRa E5 VER: 4.0.11 has MAC rev 1.0.3, while Seeed Wiki connection example prompts to select MAC rev 1.0.2.

Also for Australia one should select AU915 and channel 1.

It would be nice to make corrections to Wiki.

Excellent :ok_hand:

Send modifications at Seeed Support, they should be able to update it for you :wink: Unhappy no Seeed staff monitors these forums although reminded them few times :frowning: