positionnumber, counting from left to right. Valid positions are 1 to 4.
selectorsis a tuple composed as in the following:
- Ring pin.
EXP object is created, the expansion board can be used from the application by using the
Both values are integers from 0 to 3.
start_cellular(apn="", apn_user="", apn_password="", dhcp=True, ip="", mask="", gateway="", dns="126.96.36.199", timeout=10000)
apn: is the APN for the network connection. It depends from the SIM card provider.
apn_user: the username for the network connection authentication. Usually it is empty. Default value empty string.
apn_password: the password for the network connection authentication. Usually it is empty. Default value empty string.
dhcp is True (the default) other following four IP related arguments are ignored. When
dhcp is False, the four IP related arguments are:
ip: is the IP address.
mask: the net mask expressed as A.B.C.D dotted address.
gateway: the gateway to be used as default router.
dns: the Domain Name Server to be used for name resolution. Default is "188.8.131.52", the Google DNS.
timeout: Connection timeout in milliseconds.
CellularExceptionis raised if connection do not succeed during this time. Default value 10000 ms.
cellular module is returned.
Please refer also to the cellular documentation.
from expansions import connect from bsp import board board.init() # Add the connect expansion sel = (0,) con_e = board.next_expansion(connect, sel) # Start the cellular module and connect to the desired provider cel = con_e.start_cellular(apn="my-provider-apn") # Print info of the cell we connected to. print(cel.cellinfo()) # Stop cellular module con_e.stop_cellular() while True: sleep(1000)