RAK4631 Sidewalk Start Kit Won’t Connect via LoRa

Hello,

I’ve purchased the RAK4631 Amazon Sidewalk Starter Kit for US915.

I’ve followed these instructions to get it up and running:
https://docs.rakwireless.com/Product-Categories/WisBlock/RAK4631/Sidewalk/#prerequisite

I’ve also reprogrammed the device using these instructions:
https://github.com/RAKWireless/RAK4630-Amazon-Sidewalk-Example

My issue is that when I build using this command, the module doesn’t successfully connect to Sidewalk via LoRa:
west build -p -b rak4631_nrf52840 app/rak4631_rak1901_demo/ – -DOVERLAY_CONFIG=“lora.conf”

However, when I build using this command, the module does successfully connect to Sidewalk via BLE:
west build -p -b rak4631_nrf52840 app/rak4631_rak1901_demo/

I’ve monitored the module’s behavior in the Serial Monitor in both cases, and I’ve noticed that when I build using the LoRa command the module stops responding within 10 or 15 seconds. To confirm this behavior, I’ve even gone as far as creating a while loop in the main function with a 1 second wait that prints out an incremented value each time, and can see it stop incrementing shortly after power on. I see no such issue when programming it with the – -DOVERLAY_CONFIG=“lora.conf” at the end.

I’ve also tried programming two entirely different RAK modules to ensure it’s not a hardware issue. The problem exists with both pieces of hardware.

I have an active Amazon Echo device less than 10 feet away to ensure no reception issues to the Sidewalk network.

Is there something I can tweak to get it to connect via LoRa?

Thank you!

Welcome to the forum @jose_ota

Can you share the logs please?
Are you testing within the Amazon coverage area?
Are you sure your Echo has Sidewalk enabled?

-DOVERLAY_CONFIG=“lora.conf” is enabling the connection through LoRa, without it the device would only connect through bluetooth.

Did you follow the guide and have done all steps including the creation of a device profile?

Is the LoRa antenna and BLE antenna connected?

Hi Beegee,

Thank you for the quick response!

  • Can you share the logs please?
    – I have pasted the log from the serial terminal at the bottom. I generated this using a fresh copy of the files from the RAK repository.
    – Logs are configured as follows (bottom 3 commented out at the moment since they seem to occasionally cause weird things for the serial terminal, I removed the # sign since it bolds it for forum posts):
    CONFIG_SIDEWALK_LOG_LEVEL_DBG=y
    CONFIG_SIDEWALK_CRYPTO_LOG_LEVEL_DBG=y
    (disabled) CONFIG_SPI_BUS_LOG_LEVEL_DBG=y
    (disabled) CONFIG_SPI_LOG_LEVEL_DBG=y
    (disabled) CONFIG_LOG_DEFAULT_LEVEL=4

  • Are you testing within the Amazon coverage area? Are you sure your Echo has Sidewalk enabled?
    – Yes, I’ve also been working with a Nordic Development Kit and can confirm that it successfully connects to Sidewalk via LoRa. I have attached an image from the sensor demo for reference.

  • Did you follow the guide and have done all steps including the creation of a device profile?
    – Yes, I made sure to follow all the steps. I’ve performed similar/identical steps with the Nordic kit.

  • Is the LoRa antenna and BLE antenna connected?
    – Yes, both antennas are connected.

An additional note:

  • I’ve deduced that it’s encountering a fatal error because when I enable CONFIG_RESET_ON_FATAL_ERROR=y the device reboots itself automatically endlessly

Please let me know if there’s any additional information I can provide and thanks in advance for your help!

Jose

Log:
[00:00:00.011,322] fs_nvs: data wra: 0, 64
[00:00:00.011,352] sid_crypto: sid_pal_crypto_init: Init success!
[00:00:00.011,383] sm_main: Sidewalk demo started!
[00:00:00.013,458] sm_task: Initializing sidewalk with BLE & LoRa link mask.
[00:00:00.014,038] sid_crypto: sid_pal_crypto_ecc_dsa: Key import success.
[00:00:00.029,541] sid_crypto: sid_pal_crypto_ecc_dsa: Key import success.
[00:00:00.044,799] sid_crypto: sid_pal_crypto_ecc_dsa: Key import success.
[00:00:00.059,875] sid_crypto: sid_pal_crypto_ecc_dsa: Key import success.
[00:00:00.075,347] sid_crypto: sid_pal_crypto_ecc_dsa: Key import success.
[00:00:00.090,454] sid_crypto: sid_pal_crypto_ecc_dsa: Key import success.
[00:00:00.144,012] sid_crypto: sid_pal_crypto_ecc_dsa: Key import success.
[00:00:00.198,333] sid_crypto: sid_pal_crypto_ecc_dsa: Key import success.
[00:00:00.252,380] sid_crypto: sid_pal_crypto_ecc_dsa: Key import success.
[00:00:00.310,394] sid_crypto: sid_pal_crypto_ecc_dsa: Key import success.
[00:00:00.415,222] sid_ble: Enable BT
[00:00:00.415,771] bt_sdc_hci_driver: SoftDevice Controller build revision:
e0 7e 2e c1 5e 05 85 23 46 15 dc fa 8e 29 7d 70 |.~…^…# F…)}p
10 93 a5 fc |…
[00:00:00.415,924] sm_task: Starting sidewalk_receive_task …
[00:00:00.419,830] bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.419,860] bt_hci_core: HW Variant: nRF52x (0x0002)
[00:00:00.419,891] bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 224.11902 Build 2231721665
[00:00:00.421,478] bt_hci_core: Identity: CB:6D:97:A9:E9:1C (random)
[00:00:00.421,539] bt_hci_core: HCI: version 5.4 (0x0d) revision 0x1077, manufacturer 0x0059
[00:00:00.421,569] bt_hci_core: LMP: version 5.4 (0x0d) subver 0x1077
[00:00:00.421,600] sid_ble: BT initialized
[00:00:00.476,593] sm_callbacks: Status changed: not ready
[00:00:00.476,654] sm_callbacks: Device Unregistered, Time Sync Fail, Link Status Mask = 0
[00:00:00.476,684] sm_task: Starting sidewalk_main_task …
[00:00:01.414,916] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:02.940,002] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:02.940,032] sid_ble_conn: BT Connected
[00:00:02.981,231] sid_ble_conn: Exchange MTU finished err status: 0
[00:00:03.352,508] sid_ble_ama_srv: ama_srv_notif_changed: Notification enabled
[00:00:03.352,691] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:03.393,737] sid_ble_srv: notification_sent: Notification sent.
[00:00:03.393,768] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:03.393,829] sid_ble_ama_srv: ama_srv_on_write: Data received for AMA_SERVICE [len=11].
[00:00:03.394,042] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:03.421,295] sid_ble_srv: notification_sent: Notification sent.
[00:00:03.421,325] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:03.421,417] sid_ble_ama_srv: ama_srv_on_write: Data received for AMA_SERVICE [len=11].
[00:00:03.421,447] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:03.462,493] sid_ble_srv: notification_sent: Notification sent.
[00:00:03.462,524] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:03.462,738] sid_ble_ama_srv: ama_srv_on_write: Data received for AMA_SERVICE [len=11].
[00:00:03.462,768] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:03.503,601] sid_ble_srv: notification_sent: Notification sent.
[00:00:03.503,662] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:10.413,116] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:20.413,391] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:30.413,635] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:33.462,951] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:33.529,418] sid_ble_ama_srv: ama_srv_notif_changed: Notification disabled
[00:00:33.529,479] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:33.529,541] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:33.529,571] sid_ble_conn: BT Disconnected Reason: 0x16
[00:00:33.531,799] sm_callbacks: Status changed: not ready
[00:00:33.531,860] sm_callbacks: Device Unregistered, Time Sync Fail, Link Status Mask = 0
[00:00:40.413,879] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:50.414,123] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:01:00.093,963] my_tasks: temp: 27.958723
[00:01:00.093,994] my_tasks: hum: 34.612038
[00:01:00.093,994] my_tasks: Sidewalk link is not ready!!!
[00:01:00.094,024] my_tasks: State: 0, Ready: 0
[00:01:00.414,367] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:01:10.414,733] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628

Here is an additional log with the following settings. Unfortunately it seems to have dropped 12 messages. If I enable the fourth option the module stops being able to connect to the serial terminal for some reason.
CONFIG_SIDEWALK_LOG_LEVEL_DBG=y
CONFIG_SIDEWALK_CRYPTO_LOG_LEVEL_DBG=y
CONFIG_SPI_BUS_LOG_LEVEL_DBG=y
CONFIG_SPI_LOG_LEVEL_DBG=y
(disabled) CONFIG_LOG_DEFAULT_LEVEL=4

[00:00:00.418,945] spi_nrfx_spim: spi_context_buffers_setup: tx_bufs 0x20015d90 - rx_bufs 0x20015da0 - 1
[00:00:00.418,975] spi_nrfx_spim: spi_context_buffers_setup: current_tx 0x20015d88 (1), current_rx 0x20015d98 (1), tx buf/len 0x2000e620/2, rx buf/len 0x2000e620/2
[00:00:00.419,006] spi_nrfx_spim: spi_context_update_tx: tx buf/len (nil)/0
[00:00:00.419,036] spi_nrfx_spim: spi_context_update_rx: rx buf/len (nil)/0
[00:00:00.419,067] spi_nrfx_spim: finish_transaction: Transaction finished with status 0
[00:00:00.419,647] sid_ble: Enable BT
[00:00:00.420,227] bt_sdc_hci_driver: SoftDevice Controller build revision:
e0 7e 2e c1 5e 05 85 23 46 15 dc fa 8e 29 7d 70 |.~…^…# F…)}p
10 93 a5 fc |…
[00:00:00.420,379] sm_task: Starting sidewalk_receive_task …
[00:00:00.424,255] bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.424,285] bt_hci_core: HW Variant: nRF52x (0x0002)
[00:00:00.424,316] bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 224.11902 Build 2231721665
[00:00:00.452,301] sid_crypto: sid_pal_crypto_aes_crypt: Mac calculate success.
[00:00:00.452,484] sid_crypto: sid_pal_crypto_hmac: Key load success.
[00:00:00.452,636] sid_crypto: sid_pal_crypto_hmac: psa_mac_sign_setup success.
[00:00:00.452,636] sid_crypto: sid_pal_crypto_hmac: psa_mac_update success.
[00:00:00.453,033] sid_crypto: sid_pal_crypto_hmac: psa_mac_sign_finish success. [hmac length=32]
[00:00:00.481,231] sm_callbacks: Status changed: not ready
[00:00:00.481,292] sm_callbacks: Device Is registered, Time Sync Fail, Link Status Mask = 4
[00:00:00.481,353] sm_callbacks: Link mode cloud, on lora
[00:00:00.481,384] sm_task: Starting sidewalk_main_task …
[00:00:01.419,311] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:01.451,843] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:01.452,270] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:01.452,697] sid_crypto: sid_pal_crypto_hmac: Key load success.
[00:00:01.452,819] sid_crypto: sid_pal_crypto_hmac: psa_mac_sign_setup success.
[00:00:01.452,850] sid_crypto: sid_pal_crypto_hmac: psa_mac_update success.
[00:00:01.453,216] sid_crypto: sid_pal_crypto_hmac: psa_mac_sign_finish success. [hmac length=32]
[00:00:02.452,362] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:03.452,575] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:04.452,758] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:04.586,395] sid_crypto: sid_pal_crypto_aes_crypt: Key import success
[00:00:04.586,730] sid_crypto: sid_pal_crypto_aes_crypt: Mac calculate success.
[00:00:04.586,791] sid_crypto: sid_pal_crypto_aes_crypt: Key import success
[00:00:04.587,127] sid_crypto: sid_pal_crypto_aes_crypt: Mac calculate success.
[00:00:04.587,402] sid_crypto: sid_pal_crypto_hmac: Key load success.
[00:00:04.587,524] sid_crypto: sid_pal_crypto_hmac: psa_mac_sign_setup success.
[00:00:04.587,554] sid_crypto: sid_pal_crypto_hmac: psa_mac_update success.
[00:00:04.587,921] sid_crypto: sid_pal_crypto_hmac: psa_mac_sign_finish success. [hmac length=32]
[00:00:05.452,880] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:05.892,120] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:05.892,181] sid_ble_conn: BT Connected
[00:00:05.960,083] sid_ble_conn: Exchange MTU finished err status: 0
[00:00:06.332,641] sid_ble_ama_srv: ama_srv_notif_changed: Notification enabled
[00:00:06.332,824] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:06.347,503] sid_ble_srv: notification_sent: Notification sent.
[00:00:06.347,534] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:06.354,949] sid_ble_ama_srv: ama_srv_on_write: Data received for AMA_SERVICE [len=11].
[00:00:06.354,980] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:06.386,383] sid_ble_srv: notification_sent: Notification sent.
[00:00:06.386,413] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:06.400,115] sid_ble_ama_srv: ama_srv_on_write: Data received for AMA_SERVICE [len=11].
[00:00:06.400,177] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:06.441,406] sid_ble_srv: notification_sent: Notification sent.
[00:00:06.441,436] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:06.441,650] sid_ble_ama_srv: ama_srv_on_write: Data received for AMA_SERVICE [len=11].
[00:00:06.441,680] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:06.453,033] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:06.468,750] sid_ble_srv: notification_sent: Notification sent.
[00:00:06.468,780] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:06.482,666] sid_ble_ama_srv: ama_srv_on_write: Data received for AMA_SERVICE [len=62].
[00:00:06.482,757] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:06.483,551] sid_crypto: sid_pal_crypto_hmac: Key load success.
[00:00:06.483,673] sid_crypto: sid_pal_crypto_hmac: psa_mac_sign_setup success.
— 12 messages dropped —
[00:00:06.483,703] sid_crypto: sid_pal_crypto_hmac: psa_mac_update success.
[00:00:06.523,925] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:06.537,658] sid_ble_ama_srv: ama_srv_notif_changed: Notification disabled
[00:00:06.537,719] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:06.537,780] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:06.537,811] sid_ble_conn: BT Disconnected Reason: 0x16
[00:00:06.538,818] sid_crypto: sid_pal_crypto_aes_crypt: Key import success
[00:00:06.539,093] sid_crypto: sid_pal_crypto_aes_crypt: Mac calculate success.
[00:00:06.539,154] sid_crypto: sid_pal_crypto_aes_crypt: Key import success
[00:00:06.539,459] sid_crypto: sid_pal_crypto_aes_crypt: Mac calculate success.
[00:00:06.539,520] sid_crypto: sid_pal_crypto_aes_crypt: Key import success
[00:00:06.539,825] sid_crypto: sid_pal_crypto_aes_crypt: Mac calculate success.
[00:00:06.540,008] sid_crypto: sid_pal_crypto_hmac: Key load success.
[00:00:06.540,161] sid_crypto: sid_pal_crypto_hmac: psa_mac_sign_setup success.
[00:00:06.540,161] sid_crypto: sid_pal_crypto_hmac: psa_mac_update success.
[00:00:06.540,527] sid_crypto: sid_pal_crypto_hmac: psa_mac_sign_finish success. [hmac length=32]
[00:00:06.540,740] sid_crypto: sid_pal_crypto_hmac: Key load success.
[00:00:06.540,863] sid_crypto: sid_pal_crypto_hmac: psa_mac_sign_setup success.
[00:00:06.540,924] sid_crypto: sid_pal_crypto_hmac: psa_mac_update success.
[00:00:06.541,290] sid_crypto: sid_pal_crypto_hmac: psa_mac_sign_finish success. [hmac length=32]
[00:00:06.541,473] sid_crypto: sid_pal_crypto_hmac: Key load success.
[00:00:06.541,625] sid_crypto: sid_pal_crypto_hmac: psa_mac_sign_setup success.
[00:00:06.541,656] sid_crypto: sid_pal_crypto_hmac: psa_mac_update success.
[00:00:06.542,053] sid_crypto: sid_pal_crypto_hmac: psa_mac_sign_finish success. [hmac length=32]
[00:00:06.543,548] sm_callbacks: Status changed: ready
[00:00:06.543,609] sm_callbacks: Device Is registered, Time Sync Success, Link Status Mask = 4
[00:00:06.543,670] sm_callbacks: Link mode cloud, on lora
[00:00:06.543,701] sm_task: EVENT_SET_DEVICE_PROFILE_LINK_TYPE_2
[00:00:06.543,884] sm_task: Device profile Link type 3 set success
[00:00:07.453,369] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:08.453,552] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:08.482,147] sid_crypto: sid_pal_crypto_aes_crypt: Key import success
[00:00:08.482,513] sid_crypto: sid_pal_crypto_aes_crypt: Mac calculate success.
[00:00:08.483,215] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:08.543,914] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:08.544,281] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:09.483,306] sm_callbacks: cb_sid_event: Event from ISR, context 0x20000628
[00:00:09.585,998] sid_crypto: sid_pal_crypto_aes_crypt: Key import success
[00:00:09.586,364] sid_crypto: sid_pal_crypto_aes_crypt: Mac calculate success.

Thanks for the logs and clarification.

I pushed this to our R&D team.

We do not see any crash in your logs.

What we see is that the device is not registered:

This is the log from same code on our device:

Hi Beegee,

In my second log post above I can see that the device does register in the same way that yours does.

However, even after I see that message the device still becomes unresponsive and I don’t see it successfully communicate with AWS.

I’m fairly certain it’s crashing or at least restarting itself. When I enable the CONFIG_RESET_ON_FATAL_ERROR=y the device just restarts endlessly. When I disable that option the device doesn’t restart endlessly.

I’ve been trying to get some sort of printout during its crash to get more info on it, but haven’t been successful. Would you happen to have any information on ways to try that? I’ve been doing a fair bit of searching to try to use the RAKDAP1 and pyocd to do this but haven’t had any luck.

Jose

I managed to get a log of the crash! I ran the RTT logger via pyocd and the RAKDAP1 adapter and got the following:

Here’s some additional info I got after I enabled CONFIG_LOG_MODE_IMMEDIATE=y and
CONFIG_RTT_CONSOLE=y

Thanks for the logs, I forwarded it to our R&D.

I just had an interesting finding. I opened up a third RAK Sidewalk kit that I had purchased to find out if for some reason I had 2 bad units. Instead of programming the unit immediately, I left the current software on it intact. I only uploaded the Nordic_MFG.hex file that contains the AWS registration info so it can connect.

To my surprise, the unit connected flawlessly to AWS via LoRa!

It seems that the the code that is on the unit from the factory works correctly (with the small exception of some higher than usual temp measurements hehe). It wasn’t until I reprogrammed the unit with the code from the repo that it started showing the behavior where it stops responding. I also tried the changes that were uploaded to the repo 17 hours ago, but still having no luck with it connecting via LoRa.

Hi @jose_ota
The crash logs are showing the different crashing location, I’m not sure which part is actually crash the whole system, can you do the following steps for testing? Besides, can you check your image version?

pyocd erase -t nrf52840 --chip                       //erase all chip, chip might retain RAK4631 firmware.
pyocd flash -t nrf52840 YOUR_CUSTOM_FIRMWARE.hex
pyocd flash -t nrf52840 YOUR_PROVISIONING_KEY.hex

Our image version should be following pic.
image

Hi @Evan

I performed the steps you suggested and still have the issue.

It looks like I am in fact using a different version, mine doesn’t say “-dirty” at the end. Not sure how I ended up with that. As far as I can tell I followed all the instructions. Any idea how I can get the correct version?

Hi @jose_ota
The dirty means having changes inside repo.
We do have patches for sidewalk repo and it is for RAK4631 compatible.
The file is in the sidewalk folder.
sidewalk/subsys/config/common/src/app_subGHz_config.c
Can you modify this file as same as this pic?


Normally it should be patched right after command “west patch”.

@Evan

I’m embarrassed to admit this, but I just realized that I may have accidentally skipped the patch step. I went back to do the entire setup process over again and get this error while running “west patch” that I haven’t seen before.

@jose_ota
Not sure why you get this error.
Maybe try
git am --abort
then try again
west patch
or manually modify this file.

@Evan

I’m happy to report that after modifying the file the RAK module finally connects via LoRA!!! :smiley:

Thank you so so so much for your help!

Also, when I ran the git am --abort, it didn’t seem to fix the issue. But I hope our conversation above can help other if they run into this!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.