guild icon
Toit
#Help with debugging modem example problem
Thread channel in help
Rikke
Rikke 03/31/2023 12:15 PM
Hello, I'm trying out this example cellular/examples/monarch.toit. I removed the soracom.io because my previous experience says it will find the correct one anyway. I've also entered the correct pins, which I can confirm works when talking to the modem with a separate uart testcode, to ask simple AT commands. However when I run the example, I can not create a cellular network. I'm using the same setup as last time, the only difference is the alpha version 44 -> alpha 69 and I'm using a different sim card.
[toit] INFO: starting <v2.0.0-alpha.69> [monarch] INFO: opening network ****************************************************************************** Decoding by `jag`, device has version <2.0.0-alpha.69> ****************************************************************************** EXCEPTION error. cellular unavailable 0: open <sdk>/net/cellular.toit:47:19 1: main ../src/sequans_modem/modem2/monarch.toit:37:14 ******************************************************************************
Rikke
Rikke 03/31/2023 12:17 PM
When I use my other uart testcode, I can talk with modem:
[toit] INFO: starting <v2.0.0-alpha.69> [toit] DEBUG: clearing RTC memory: invalid checksum +CEREG: 1,"36xx","027B6xx0",7 +SYSSTART Got systart, starting modem OK OK +CEREG: 2 +CEREG: 1,"36xx","02A54xx0",7
(edited)
Rikke
Rikke 03/31/2023 12:19 PM
The testcode looks like this
task:: r := ? while true: sleep --ms=1 r = ModemUart.readData if r and not r[0] == 255: e := catch: try: y := r.to_string print "$y" if (y.contains "+SYSSTART"): task:: print "Got systart, starting modem" ModemUart.writeData "AT\n\r".to_byte_array sleep --ms=4_000 ModemUart.writeData "AT+CFUN=1\n\r".to_byte_array //sleep --ms=6_000 //ModemUart.writeData "AT+PING=\"www.google.com\"\n\r".to_byte_array finally: //print r if e: print "EXC: $e" else: //print r
Rikke
Rikke 03/31/2023 12:33 PM
+SYSSTART Got systart, starting modem OK OK +CEREG: 2 +CEREG: 1,"36xx","02A54xx0",7 +PING: 1,142.250.74.68,60,56 +PING: 2,142.250.74.68,130,56 +PING: 3,142.250.74.68,120,56 +PING: 4,142.250.74.68,110,56 OK
Pinging works too
(edited)
bitphlipphar
bitphlipphar 03/31/2023 01:41 PM
Did you start the Monarch service? It looks like we can't find it at runtime.
bitphlipphar
bitphlipphar 03/31/2023 01:41 PM
(maybe it is as simple as installing the right container)
bitphlipphar
bitphlipphar 03/31/2023 01:41 PM
(maybe the example used to do it)
bitphlipphar
bitphlipphar 03/31/2023 01:42 PM
Contribute to toitware/cellular development by creating an account on GitHub.
Rikke
Rikke 03/31/2023 02:02 PM
Oh I think i forgot that, I dont use jaguar for it. I should able to install the monarch in my envelope.
bitphlipphar
bitphlipphar 03/31/2023 02:08 PM
Indeed!
bitphlipphar
bitphlipphar 03/31/2023 02:09 PM
We've had to solve this for Artemis and we ended up putting the description of what goes into the firmware image in a file (fully declarative).
bitphlipphar
bitphlipphar 03/31/2023 02:10 PM
"containers": { "cellular": { "entrypoint": "src/modules/sequans/monarch.toit", "git": "https://github.com/toitware/cellular.git", "branch": "v2.0.2", "background": true, "critical": true } }
Rikke
Rikke 03/31/2023 02:11 PM
Yeah I will try that :๐Ÿ˜‰: Stupid mistake from my side
Rikke
Rikke 04/04/2023 08:55 AM
how different is network = wifi.open from a network = cellular.open config. Both is of type network/net.Client?, but when I use a cellular network where i normally use a wifi network nothing works. I can ping with http, but not connect to mqtt etc(edited)
bitphlipphar
bitphlipphar 04/04/2023 09:15 AM
Maybe increase the amount of logging through the cellular config by lowering the cellular.log.level value to try to see what is going on?(edited)
Rikke
Rikke 04/04/2023 09:16 AM
Log level is already info, but I see nothing
Rikke
Rikke 04/04/2023 09:24 AM
[monarch] INFO: Opening cellular network [cellular] INFO: configuring apn {apn: } [cellular] INFO: enabling radio [cellular] INFO: connecting [cellular] INFO: connected
thats all the log messages i see
bitphlipphar
bitphlipphar 04/04/2023 09:29 AM
Set it to debug?
bitphlipphar
bitphlipphar 04/04/2023 09:29 AM
You should get lots of AT output.
Rikke
Rikke 04/04/2023 09:31 AM
No more debug messages after the last info connected :๐Ÿ˜ฆ:
Rikke
Rikke 04/04/2023 09:32 AM
[monarch] INFO: Opening cellular network [cellular] DEBUG: -> AT [cellular] DEBUG: <- OK [cellular] DEBUG: -> ATE0 [cellular] DEBUG: <- OK [cellular] DEBUG: -> AT+CMEE=2 [cellular] DEBUG: <- OK [cellular] INFO: configuring apn {apn: } [cellular] DEBUG: -> AT+CFUN=4 [cellular] DEBUG: <- OK [cellular] DEBUG: <- +CEREG: 0 [cellular] DEBUG: <- *ignored* [URC] +CEREG [0] [cellular] DEBUG: -> AT+CPIN? [cellular] DEBUG: <- +CPIN: READY [cellular] DEBUG: <- OK [cellular] DEBUG: -> AT+CEREG=2 [cellular] DEBUG: <- OK [cellular] DEBUG: -> AT+CPSMS=0 [cellular] DEBUG: <- OK [cellular] DEBUG: -> AT+CEDRXS=0 [cellular] DEBUG: <- OK [cellular] DEBUG: -> AT+SQNIBRCFG=0 [cellular] DEBUG: <- OK
Rikke
Rikke 04/04/2023 09:32 AM
[cellular] DEBUG: -> AT+SQNIPSCFG=1,100 [cellular] DEBUG: <- OK [cellular] DEBUG: -> AT+SQNBANDSEL=0,"standard","20,8" [cellular] DEBUG: <- +SQNBANDSEL: <custom> [cellular] DEBUG: <- OK [cellular] DEBUG: -> AT+SQNBANDSEL=1,"standard","20,8" [cellular] DEBUG: <- +CME ERROR: operation not supported [cellular] DEBUG: -> AT+CGDCONT? [cellular] DEBUG: <- +CGDCONT: 1,"IP","",,,,0,0,0,0,0,0,0,,0 [cellular] DEBUG: <- OK [cellular] INFO: enabling radio [cellular] DEBUG: -> AT+CFUN=1 [cellular] DEBUG: <- OK [cellular] DEBUG: <- +CEREG: 2 [cellular] DEBUG: <- [URC] +CEREG [2] [cellular] INFO: connecting [cellular] DEBUG: -> AT+COPS=0,2 [cellular] DEBUG: <- OK [cellular] DEBUG: -> AT+CEREG=2 [cellular] DEBUG: <- OK [cellular] DEBUG: -> AT+CEREG? [cellular] DEBUG: <- +CEREG: 2,2 [cellular] DEBUG: <- OK [cellular] DEBUG: -> AT [cellular] DEBUG: <- OK [cellular] DEBUG: -> AT [cellular] DEBUG: <- +CEREG: 1,"36D9","02A54E0C",7 [cellular] DEBUG: <- [URC] +CEREG [1, 36D9, 02A54E0C, 7] [cellular] DEBUG: <- OK [cellular] INFO: connected [monarch] INFO: After Opening cellular network
Rikke
Rikke 04/04/2023 09:34 AM
I will look in the sequans docs
Rikke
Rikke 04/04/2023 09:37 AM
i removed the bands from config [20,8] but with no luck. I will keep looking
Rikke
Rikke 04/04/2023 10:49 AM
Okay the exc from ntp says wifi ssid not provided. So something funky is going on
Rikke
Rikke 04/04/2023 10:54 AM
Seems like I have to pass the network otherwise it expects wifi result ::= ntp.synchronize --network=network. I got debug messages from modem now:
[cellular] DEBUG: -> AT+SQNDNSLKUP="pool.ntp.org" [cellular] DEBUG: <- +SQNDNSLKUP: <custom> [cellular] DEBUG: <- OK [cellular] DEBUG: -> AT+SQNSD=1,1,123,"194.58.204.20",0,16384,1,0 [cellular] DEBUG: <- OK [cellular] DEBUG: -> AT+SQNSSENDEXT=1,48 [cellular] DEBUG: <- > [cellular] DEBUG: -> <48 bytes> [cellular] DEBUG: <- [cellular] DEBUG: <- OK [cellular] DEBUG: <- +SQNSRING: 1 [cellular] DEBUG: <- [URC] +SQNSRING [1] [cellular] DEBUG: -> AT+SQNSI=1 [cellular] DEBUG: <- +SQNSI: 1,48,48,48,0 [cellular] DEBUG: <- OK [cellular] DEBUG: -> AT+SQNSRECV=1,1500 [cellular] DEBUG: <- +SQNSRECV: <custom> [cellular] DEBUG: <- OK [cellular] DEBUG: -> AT+SQNSH=1 [cellular] DEBUG: <- OK
(edited)
26 messages in total