Created an object for the expansion board connected to Zerynth ZM1 board at the
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.
The method fully configure, initialize and start the cellular module. The cellular module will be ready to use when this method resolves.
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.
The interface is stopped, all connections dropped, and all socket related to cellular interface closed.
The method resets the Cellular hardware module and the GNSS subsystem. The started network connections should have been closed before, otherwise they could fall in an inconsistent state.
The method powers the GNSS antenna. The antenna is already powered by the
The method shuts down the GNSS antenna.
The method returns the value of the status pin of the cellular modem. The pin will be high when the module is on.
The method returns the value of the psm indicator pin. The pin will be low when in PSM.
The method returns the value of the ring pin. The pin will go low when the ring triggers.
The method setup the call back function to be called when the ring triggers.
The method returns the value of the dcd pin.
Print the connect expansion summary on the console.
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)