Rak5010 issues chat_script init timed out

Per your website, the rak5010 should be a supported device,

I’ve copied Golioth Hello sample (golioth-firmware-sdk/examples/zephyr/hello at main · golioth/golioth-firmware-sdk · GitHub), flashed it to the Rak5010 but I keep getting modem_chat: quectel_bg95_init_chat_script: timed out, anything I can do to debug the problem? This is a rak5010 with the bg95-m3 modem onboard.

Hey @steverjuk, thanks for asking about this! We’re very excited about the RAK5010 board.

Could you tell us a little more about your issue?

  • What kind of SIM card are you using?
  • Has it successfully been used in any other product before? (say, a different dev board)
  • Could you post a screenshot of the entire boot sequence so we can see if there’s anything else odd in there?

It is possible to do some debugging and backtrace work on this part, but let’s make sure we get the basics down first. Appreciate you stopping by to ask about this!

I’ve tried two SIM cards hologram and o2(uk)

The entire boot info is
*** Booting Zephyr OS build v3.6.0 ***
[00:00:00.253,601] hello_zephyr: main: start hello sample
[00:00:00.253,631] golioth_samples: Bringing up network interface
[00:00:00.253,662] golioth_samples: Waiting to obtain IP address
[00:00:21.753,479] modem_chat: quectel_bg95_init_chat_script: timed out
[00:00:43.253,845] modem_chat: quectel_bg95_init_chat_script: timed out

OK, two other thoughts:

  1. Do you know if your area is covered by NB-IoT or LTE-M? Both of those service providers should have options in your country, but it will ultimately come down to local towers
  2. Could you post a photo of your setup to make sure it’s not something small like an antenna plug issue? I realize this sounds silly, but well…that’s the majority of my issues when it comes to something like this.

image

It’s strange how every version of Zephyr doesn’t work. It’s like the modem isn’t starting correctly.

Otherwise

Hi @steverjuk,

I think the BG95 is not getting a network connection. Your logs show two timeout messages. I expect the first one as the modem is not yet ready when the chat script first starts running, but I think the second one is a legitimate timeout when a connection is not established.

One way to test this theory out is to run the cellular_modem sample in the Zephyr tree. I added the approach I take for running that code. Please give it a try and let us know how it goes.

As Chris mentioned above, I’m also curious if your local cell carrier offers NB-IoT or LTE-M?

1. Checkout Zephyr v3.6.0

cd zephyr
git checkout v3.6.0

2. Add board files to enable USB serial

I added the following files to zephyr/samples/net/cellular_modem/boards:

rak5010_nrf52840.conf already exists but this adds to the two existing lines:

CONFIG_UART_ASYNC_API=y
CONFIG_MODEM_CELLULAR_APN="internet"

# USB
CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_DEVICE_PRODUCT="RAK5010 Zephyr"
CONFIG_USB_DEVICE_PID=0x0004
CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=y

CONFIG_UART_CONSOLE=y
CONFIG_UART_LINE_CTRL=y
CONFIG_LOG_BACKEND_RTT=n

Also add rak5010_nrf52840.overlay

/ {
  chosen {
    zephyr,console = &cdc_acm_uart0;
    zephyr,shell-uart = &cdc_acm_uart0;
  };

};

&zephyr_udc0 {
  cdc_acm_uart0: cdc_acm_uart0 {
    compatible = "zephyr,cdc-acm-uart";
  };
};

3. Build and flash

cd zephyr/samples/net/cellular_modem
west build -b rak5010_nrf52840
west flash

4. Reset and run

This is the output I get from a successful run:

*** Booting Zephyr OS build v3.6.0 ***
Powering on modem
Bring up network interface
Waiting for L4 connected
Waiting for DNS server added
Retrieving cellular info
IMEI: <your_imei_here>
MODEL_ID: BG95-M3
MANUFACTURER: Quectel
SIM_IMSI: <your_imsi_here>
FW_VERSION: BG95M3LAR02A03
Performing DNS lookup of test-endpoint.com
Opening UDP socket
Socket opened
Echo transmit time 541ms
Echo transmit time 549ms
Echo transmit time 585ms
Echo transmit time 592ms
Echo transmit time 644ms
Echo transmit time 579ms
Echo transmit time 610ms
Echo transmit time 647ms
Echo transmit time 644ms
Echo transmit time 636ms
Echo transmit time 673ms
Echo transmit time 607ms
Echo transmit time 673ms
Echo transmit time 655ms
Echo transmit time 584ms
Echo transmit time 601ms
Successfully sent 16 packets of 16 packets
Average time per echo: 613 ms
Close UDP socket
Opening UDP socket
Socket opened
Sending 128 packets
Awaiting response from server
Server received 128 packets
Server dropped 0 packets
Time elapsed sending packets 16912ms
Throughput 7750 bytes/s
Close UDP socket
Restart modem
Opening UDP socket
Socket opened
Echo transmit time 688ms
Echo transmit time 534ms
Echo transmit time 610ms
Echo transmit time 601ms
Echo transmit time 599ms
Echo transmit time 714ms
Echo transmit time 736ms
Echo transmit time 647ms
Echo transmit time 599ms
Echo transmit time 558ms
Echo transmit time 756ms
Echo transmit time 684ms
Echo transmit time 596ms
Echo transmit time 636ms
Echo transmit time 707ms
Echo transmit time 608ms
Successfully sent 16 packets of 16 packets
Average time per echo: 642 ms
Close UDP socket
Powering down modem
Sample complete
*** Booting Zephyr OS build v3.6.0 ***
Powering on modem
Bring up network interface
Waiting for L4 connected
L4 was not connected in time

CONFIG_MODEM_CELLULAR_APN=“hologram” and it’s got a hologram Sim in it.

Tried with an O2 sim as well same error

I had it connect once, randomly after resetting it a few times, but that was once in a million may have had something to do with me pressing the modem power button as well.

So after many hours of debugging it seems if the jlink is attached then I can’t get the modem to work, if I disconnect the jlink it works fine.

@mike Thanks for the help, it’s 100% the Jlink, very strange. If I have the JLINK connected the bg95 modem stop responding. I’ve got one question per the documentation CHG_DET and BAT_SET could be connected to
image
p1.08 and p1.09 but when I read them as GPIOs, they don’t change if I plug the usb in or not. Am I missing something RAK5010-M WisTrio NB-IoT Tracker Datasheet | RAKwireless Documentation Center ?

Well that was a good find! Could you confirm that your overlay file is the same as the sample?

Yep exactly the same