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

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers platform_config.py Source File

platform_config.py

00001 import json
00002 from time import sleep
00003 import sys
00004 import re
00005 import os
00006 
00007 myfile = os.path.join('example-ublox-cellular-interface','mbed_app.json')
00008 #with open(myfile, 'r') as f:
00009 #  data = json.load(f)
00010 
00011 data={}
00012   
00013 if 'config' not in data:
00014   data['config'] = {}
00015   data['target_overrides'] = {}
00016   data['config']['debug-on'] = {}
00017   data['config']['default-pin'] = {}
00018   data['config']['apn'] = {}
00019   data['config']['username'] = {}
00020   data['config']['password'] = {}
00021   data['config']['ntp-server'] = {}
00022   data['config']['ntp-port'] = {}
00023   
00024   data['config']['debug-on']['value'] = True
00025   data['config']['default-pin'] = '\"1234\"'
00026   data['config']['apn'] = 0
00027   data['config']['username'] = 0
00028   data['config']['password'] = 0
00029   data['config']['ntp-server'] = '\"2.pool.ntp.org\"'
00030   data['config']['ntp-port'] = 123
00031   
00032   data['target_overrides']['*'] = {}
00033   data['target_overrides']['*']['lwip.ppp-enabled'] = True
00034   data['target_overrides']['*']['platform.stdio-convert-newlines'] = True
00035   
00036   
00037   print('data', data)
00038 else:
00039   data['config']['debug-on']['value'] = True
00040 
00041   print('debug-on', data['config']['debug-on']['value'])
00042 
00043 with open(myfile, 'w') as f:
00044   json.dump(data, f)