Rikke
03/31/2023, 12:15 PMcellular/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
03/31/2023, 12:17 PM[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
Rikke
03/31/2023, 12:19 PMtask::
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
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 tookasperl
03/31/2023, 1:41 PMkasperl
03/31/2023, 1:41 PMkasperl
03/31/2023, 1:41 PMkasperl
03/31/2023, 1:42 PMRikke
03/31/2023, 2:02 PMkasperl
03/31/2023, 2:08 PMkasperl
03/31/2023, 2:09 PMkasperl
03/31/2023, 2: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
03/31/2023, 2:11 PMRikke
04/04/2023, 8:55 AMnetwork = 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 etckasperl
04/04/2023, 9:15 AMRikke
04/04/2023, 9:16 AMRikke
04/04/2023, 9: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 seekasperl
04/04/2023, 9:29 AMkasperl
04/04/2023, 9:29 AMRikke
04/04/2023, 9:31 AMRikke
04/04/2023, 9: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
04/04/2023, 9: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
04/04/2023, 9:34 AMRikke
04/04/2023, 9:37 AMRikke
04/04/2023, 10:49 AMwifi ssid not provided
. So something funky is going onRikke
04/04/2023, 10:54 AMresult ::= 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