Closed mrajiullah closed 5 years ago
I do manage to connect to the Telia NB-IOT but couldnt use socket to make data connection.
>>> from network import LTE
>>> lte=LTE()
>>> lte.attach(band=20, apn="lpwa.telia.iot")
>>> lte.isattached()
True
>>> lte.connect()
>>> lte.isconnected()
True
>>> def send_at_cmd_pretty(cmd):
... response = lte.send_at_cmd(cmd).split('\r\n')
... for line in response:
... print(line)
...
...
...
>>> lte.imei()
'354346096085039'
>>> lte.iccid()
>>> lte.isattached()
Traceback (most recent call last):
File "<stdin>", line 1
IndentationError: unexpected indent
>>> lte.isattached()
False
>>> lte.attach(band=20, apn="lpwa.telia.iot")
>>> lte.isattached()
True
>>> lte.iccid()
'89450421190211492260'
>>> send_at_cmd_pretty('AT!="showphy"')
DL SYNCHRO STATISTICS
=====================
Synchro state : CELL_ACQUIRED
PPU SIB1 ACQ watchdog : 0
Frequency Hypothesis RF (Hz) : 0
RSRP (dBm) : -90.96
RSRQ (dB) : -12.47
Channel estimation state (Cell-spec.) : LOW CINR
Channel estimation state (UE-spec.) : LOW CINR
Channel estimation state (MBSFN) : LOW CINR
Channel estimation CINR : 2.42
Channel length : SHORT
AGC
AGC RX gain (dB) : 50.46
RX PSD BO (dBFs) : -22.04
RX PSD (dBm) : -92.81
Noise level RS (dBm) : -94.42
Digital gain (dB) : 4.72
CINR RS (dB) : 3.46
NARROWBANDS
Last DL NB : Central
Last UL NB : 0
AFC
Frequency offset RF (Hz) : -467
Frequency offset BB (Hz) : 0
PBCH
MIB received quantity : 0
MIB timeout quantity : 0
OK
>>> send_at_cmd_pretty('AT!="fsm"')
SYSTEM FSM
==========
+--------------------------+--------------------+
| FSM | STATE |
+--------------------------+--------------------+
| RRC TOP FSM |CAMPED |
| RRC SEARCH FSM |CAMPED |
| RRC ACTIVE FSM |IDLE |
| PMM PLMN FSM |NORM_CAMPED |
| EMM MAIN FSM |REGISTERED |
| EMM AUTH FSM |KASME_DEFINED |
| EMM CONN FSM |EMM_IDLE |
| EMM TAU FSM |NULL |
| EMM TEST FSM |NULL |
| ESM BEARER FSM |BEARER_ACTIVE |
| SMS MT FSM |IDLE |
| SMS MO FSM |IDLE |
| LPP FSM |IDLE |
| HP MAIN FSM |IDLE |
| HP USIM FSM |READY |
| HP SMS MO FSM |IDLE |
| HP SMS MT FSM |IDLE |
| HP CAT FSM |IDLE |
+--------------------------+--------------------+
OK
Ok, it worked for the first time
from network import LTE
import time
lte = LTE()
lte.attach(band=20, apn="lpwa.telia.iot")
while not lte.isattached():
time.sleep(0.25)
lte.connect() # start a data session and obtain an IP address
while not lte.isconnected():
time.sleep(0.25)
>>> import usocket
>>> usocket.dnsserver(0,'8.8.8.8')
>>> usocket.dnsserver(1,'4.4.4.4')
>>> usocket.dnsserver()
('8.8.8.8', '4.4.4.4')
>>> print(usocket.getaddrinfo("www.google.com", 80)[0][-1])
('172.217.21.132', 80)
>>> print(usocket.getaddrinfo("www.kau.se", 80)[0][-1])
('193.10.226.48', 80)
FiPy firmware update
NB-IOT Antenna
You will need to connect the antenna to the FiPy using the U.FL connector on the under side of the FiPy.
Module firmware update
Modem firmware update
IMEI: 354346096085039