Implementation of the CellularInterface for u-blox C027 and C030 (non-N2xx flavour) modems that uses the IP stack on-board the cellular modem, hence not requiring LWIP (and so less RAM) and allowing any AT command exchanges to be carried out at the same time as data transfers (since the modem remains in AT mode all the time). This library may be used from mbed 5.5 onwards. If you need to use SMS, USSD or access the modem file system at the same time as using the CellularInterface then use ublox-at-cellular-interface-ext instead.

Dependents:   example-ublox-cellular-interface example-ublox-cellular-interface_r410M example-ublox-mbed-client example-ublox-cellular-interface ... more

Committer:
RobMeades
Date:
Fri Mar 02 13:28:32 2018 +0000
Revision:
14:e7dcf3388403
Make sure that the event handler thread is closed cleanly in all cases and add tests that this is the case, both for sleep and for memory.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
RobMeades 14:e7dcf3388403 1 import json
RobMeades 14:e7dcf3388403 2 from time import sleep
RobMeades 14:e7dcf3388403 3 import sys
RobMeades 14:e7dcf3388403 4 import re
RobMeades 14:e7dcf3388403 5 import os
RobMeades 14:e7dcf3388403 6
RobMeades 14:e7dcf3388403 7 myfile = os.path.join('example-ublox-cellular-interface','mbed_app.json')
RobMeades 14:e7dcf3388403 8 #with open(myfile, 'r') as f:
RobMeades 14:e7dcf3388403 9 # data = json.load(f)
RobMeades 14:e7dcf3388403 10
RobMeades 14:e7dcf3388403 11 data={}
RobMeades 14:e7dcf3388403 12
RobMeades 14:e7dcf3388403 13 if 'config' not in data:
RobMeades 14:e7dcf3388403 14 data['config'] = {}
RobMeades 14:e7dcf3388403 15 data['target_overrides'] = {}
RobMeades 14:e7dcf3388403 16 data['config']['debug-on'] = {}
RobMeades 14:e7dcf3388403 17 data['config']['default-pin'] = {}
RobMeades 14:e7dcf3388403 18 data['config']['apn'] = {}
RobMeades 14:e7dcf3388403 19 data['config']['username'] = {}
RobMeades 14:e7dcf3388403 20 data['config']['password'] = {}
RobMeades 14:e7dcf3388403 21 data['config']['ntp-server'] = {}
RobMeades 14:e7dcf3388403 22 data['config']['ntp-port'] = {}
RobMeades 14:e7dcf3388403 23
RobMeades 14:e7dcf3388403 24 data['config']['debug-on']['value'] = True
RobMeades 14:e7dcf3388403 25 data['config']['default-pin'] = '\"1234\"'
RobMeades 14:e7dcf3388403 26 data['config']['apn'] = 0
RobMeades 14:e7dcf3388403 27 data['config']['username'] = 0
RobMeades 14:e7dcf3388403 28 data['config']['password'] = 0
RobMeades 14:e7dcf3388403 29 data['config']['ntp-server'] = '\"2.pool.ntp.org\"'
RobMeades 14:e7dcf3388403 30 data['config']['ntp-port'] = 123
RobMeades 14:e7dcf3388403 31
RobMeades 14:e7dcf3388403 32 data['target_overrides']['*'] = {}
RobMeades 14:e7dcf3388403 33 data['target_overrides']['*']['lwip.ppp-enabled'] = True
RobMeades 14:e7dcf3388403 34 data['target_overrides']['*']['platform.stdio-convert-newlines'] = True
RobMeades 14:e7dcf3388403 35
RobMeades 14:e7dcf3388403 36
RobMeades 14:e7dcf3388403 37 print('data', data)
RobMeades 14:e7dcf3388403 38 else:
RobMeades 14:e7dcf3388403 39 data['config']['debug-on']['value'] = True
RobMeades 14:e7dcf3388403 40
RobMeades 14:e7dcf3388403 41 print('debug-on', data['config']['debug-on']['value'])
RobMeades 14:e7dcf3388403 42
RobMeades 14:e7dcf3388403 43 with open(myfile, 'w') as f:
RobMeades 14:e7dcf3388403 44 json.dump(data, f)