GitHub hosted
Public


Download repository: zip

SIM5320 interface library

The SIM5320 driver library for mbed-os.

SIM5320 board

The SIM5320 documentation can be found here:

The library allows:

  • get GPS coordinates and current UTC time
  • send/receive SMS
  • resolve host names
  • establish TCP connections
  • establish UPD connections
  • work with FTP/FTPS servers

The library is compatible with a mbed-os 6.3 or higher.

Driver usage

Typical library usage consists of the following steps:

  1. Initialization:

  2. create SIM5320 driver instances;

  3. optionally invoke SIM5320::reset method to reset device.
  4. invoke SIM5320::init. This method checks that device works, and sets some default settings;

  5. Usage:

  6. invoke SIM5320::request_to_start or SIM5320CellularDevice::init method directly;
    It will set the device into full functionality mode.

  7. use GPS/network to do some things
  8. invoke SIM5320::request_to_stop or SIM5320CellularDevice::shutdown method directly.
    It will set device into low power mode. But in this mode it cannot use network or GPS;

The examples of the GPS/FTP/network/sms usage can be found in the examples directory.

Troubleshooting

If after some AT commands the UART interface configuration was changed and it doesn’t work,
you can reset device to factory settings, using the following steps:

  1. connect device to PC using usb (usually boards have micro connector);
  2. find virtual COM device for AT commands. The PC can find up to 6 virtual com ports,
    so you probably should check each port using baud rate 115200 and AT or AT+CFUN?;
    commands to check if it’s AT command interface.
  3. send AT&F1 command to reset device to factory settings;
  4. restart device manually.

Tests

To run library tests you should:

  1. create an empty test project
  2. connect modem to you board
  3. fill “sim5320-driver.test_*” settings in the you “mbed_app.json”
  4. run mbed test --greentea --tests-by-name "sim5320-driver-tests-*"