cellular/examples/monarch.toit
soracom.io
[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
******************************************************************************
[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
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
+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
"containers": {
"cellular": {
"entrypoint": "src/modules/sequans/monarch.toit",
"git": "https://github.com/toitware/cellular.git",
"branch": "v2.0.2",
"background": true,
"critical": true
}
}
network = wifi.open
network = cellular.open config
network/net.Client?
[monarch] INFO: Opening cellular network
[cellular] INFO: configuring apn {apn: }
[cellular] INFO: enabling radio
[cellular] INFO: connecting
[cellular] INFO: connected
[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
[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
wifi ssid not provided
result ::= ntp.synchronize --network=network
[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