Advertisement

Quick Links

Waspmote 4G
Networking Guide

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the SIM5215 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Libelium SIM5215

  • Page 1 Waspmote 4G Networking Guide...
  • Page 2: Table Of Contents

    Document version: v7.3 - 10/2018 © Libelium Comunicaciones Distribuidas S.L. INDEX 1. Introduction .......................... 4 2. 3G (SIM5215) vs 4G (LE910) ....................5 3. Hardware ..........................6 3.1. Specifications ............................. 6 3.2. Versions .............................. 6 3.3. How to connect the module ......................7 3.4.
  • Page 3 Index 4.9.1. Opening an FTP session .....................28 4.9.2. FTP upload..........................29 4.9.3. FTP download ........................30 4.9.4. FTP delete file ........................31 4.9.5. FTP working directory ......................31 4.9.6. Closing an FTP session ......................31 4.10. TCP/UDP connections........................32 4.10.1. Socket identifiers .......................32 4.10.2. Socket information structure ...................32 4.10.3.
  • Page 4: Introduction

    If you are using previous versions of our products, please use the corresponding guides, available on our Development website. You can get more information about the generation change on the document “New generation of Libelium product lines”. The 4G module has been integrated into the devices Waspmote OEM, Plug & Sense! and Meshlium.
  • Page 5: G (Sim5215) Vs 4G (Le910)

    3G (SIM5215) vs 4G (LE910) 2. 3G (SIM5215) vs 4G (LE910) The new 4G module (specific for the new lines Waspmote v15, Plug & Sense! v15 and Meshlium 4.0) introduces some changes with respect to the 3G module (available for the old lines Waspmote v12, Plug & Sense! v12, Meshlium 3.5 and the new Waspmote v15):...
  • Page 6: Hardware

    3.2. Versions Telit has different versions of the LE910 chipset. Each one of them was especially designed to comply with the RF and cellular regulations in different countries or regions of the world. Libelium has integrated the following versions: Features...
  • Page 7: How To Connect The Module

    Hardware Important note: The current stock of the LE910 4G radio that the manufacturer ‘Telit’ is distributing comprises the v2 version which does not have GPS. The models are: LE910-EU V2 for Europe or Brazil • LE910-NA V2 for US or Canada •...
  • Page 8 Hardware The SIM card used in the 4G module OEM version is a “standard SIM”, also known as “mini SIM”. The next picture shows how the SIM card must be plugged in the 4G module. Figure : SIM card installation in OEM version On the other hand, Plug and Sense! models with 4G radio provide a special connector in order to plug both micro USB wire and nano SIM card for the 4G module.
  • Page 9: Antennas

    Hardware 3.4. Antennas The 4G module comes with 2 cellular antennas for improving the signal reception: normal (main) antenna and diversity antenna. Besides, a 3 antenna is also included for the GPS receiver (when it is available in the 4G module).
  • Page 10: Power Consumption

    Hardware 3.5. Power consumption The 4G module is directly powered by the battery. The next table shows the Waspmote’s peak current consumption in different states of the 4G module. Mean power State consumption 100 mA Transmitting data 400 mA Receiving data 400 mA Non-rechargeable batteries are not advised for the 4G module, because the high peaks of current consumption could make the voltage of these batteries to go below 3.3 V so Waspmote would reset.
  • Page 11: Software

    Software 4. Software 4.1. Waspmote library 4.1.1. Waspmote 4G library The files related to the 4G module library are: /Wasp4G/Wasp4G.h /Wasp4G/Wasp4G.cpp /Wasp4G/utility/Wasp4G_constants.h /Wasp4G/utility/Wasp4G_error_codes.h It is mandatory to include the 4G library when using this module. So the following line must be added at the beginning of the code: #include <Wasp4G.h>...
  • Page 12: Api Variables

    Software 4.1.4. API variables Variable Description The buffer of memory used for storing the responses from the module (512 _buffer bytes) The length of the contents stored in _length _buffer The time to wait after sending every command until listen for a response _def_delay The baudrate to be used when the module is switched on _baudrate...
  • Page 13: Api Functions

    Software 4.1.5. API functions Through this guide there are lots of examples, showing the use of functions. In these examples, API functions are called to execute the commands, storing in their related variables the parameter value in each case. The functions are called using the predefined object All public functions return different possible values: 0: OK...
  • Page 14 Software Network subset personalization PIN required WASP4G_CME_ERROR_0042 Network subset personalization PUK required WASP4G_CME_ERROR_0043 Service provider personalization PIN required WASP4G_CME_ERROR_0044 Service provider personalization PUK required WASP4G_CME_ERROR_0045 Corporate personalization PIN required WASP4G_CME_ERROR_0046 Corporate personalization PUK required WASP4G_CME_ERROR_0047 Unknown WASP4G_CME_ERROR_0100 SIM invalid WASP4G_CME_ERROR_0770 Illegal Mobile Station (MS) (#3)* WASP4G_CME_ERROR_0103 Illegal Mobile Equipment (ME) (#6)*...
  • Page 15 Software Invalid deflected to number WASP4G_CME_ERROR_0259 Deflected to own number WASP4G_CME_ERROR_0260 Unknown subscriber WASP4G_CME_ERROR_0261 Service not available WASP4G_CME_ERROR_0262 Unknown class specified WASP4G_CME_ERROR_0263 Unknown network message WASP4G_CME_ERROR_0264 LU processing WASP4G_CME_ERROR_0680 Network search aborted WASP4G_CME_ERROR_0681 PTM mode WASP4G_CME_ERROR_0682 Active call state WASP4G_CME_ERROR_0683 SSL already activated WASP4G_CME_ERROR_0684 ME failure...
  • Page 16: Switching On

    Besides, there is another function prototype in order to set a new one. It is mandatory to specify the current PIN number and the new one. Example for setting a new PIN: _4G.enterPIN(“1234”, ”1111”); Example of entering the PIN number: www.libelium.com/development/waspmote/examples/4g-01-enter-pin-code -16- v7.3...
  • Page 17: Getting Imei, Imsi And Iccid

    // get IMEI number _4G.getInfo(Wasp4G::INFO_IMEI); // get IMSI number _4G.getInfo(Wasp4G::INFO_IMSI); // get ICCID number _4G.getInfo(Wasp4G::INFO_ICCID); Related variables: → Buffer which stores the information requested _4G._buffer → Number of bytes in buffer _4G._length Example of getting module info: www.libelium.com/development/waspmote/examples/4g-02-get-module-info -17- v7.3...
  • Page 18: Checking Network Connection Status

    Software 4.5. Checking network connection status There are 2 functions to check the network connection status: checkConnection() checkDataConnection() function checks the module’s network connection status and returns whether the module: checkConnection() is connected to a network • is not connected to a network •...
  • Page 19: Setting Operator Parameters

    Software 4.6. Setting operator parameters When the 4G module uses data services like TCP/UDP connections, HTTP services, SMTP or FTP transfers, it is mandatory to configure the parameters provided by the user’s Mobile Network Operator (MNO): APN, login and password. The owner of a SIM should be notified with these parameters by the MNO. function allows the user to save these parameters into Waspmote memory.
  • Page 20: Sending Smss

    • 6: if error sending the body • Example of sending a text message: www.libelium.com/development/waspmote/examples/4g-04-sending-sms 4.7.3. Reading SMSs function reads an SMS from the module storage. The user must give the index of the SMS to be readSMS() read from memory. In the case a new SMS is received, all SMS related parameters are stored in the Waspmote’s library structures: index number, status, sender number, date and time.
  • Page 21: Deleting Smss

    → Stores SMS text field temporary, after calling the read function _4G._buffer → Stores the SMS message length _4G._length Example of receiving and deleting text messages: www.libelium.com/development/waspmote/examples/4g-05-receiving-sms 4.7.4. Deleting SMSs function deletes an SMS according to the given index number in the memory storage. deleteSMS() Examples of use: uint8_t index = 2;...
  • Page 22: Http Client

    HTTP is a great protocol because it is a standard, simple and light way to send information to web servers. Libelium has created a little web service in order to allow 4G, 3G, GPRS, GPRS+GPS or WiFi modules to test the HTTP mode.
  • Page 23: Http Request Methods

    After choosing the method, the function needs the host URL, port and resource of the HTTP server requested. The data field is only necessary when POST or PUT methods are performed. Example of use (GET, HEAD and DELETE methods): char host[] = “test.libelium.com”; uint16_t port = 80; char resource[] = “/test-get-post.php?varA=1&varB=2&varC=3&varD=4”;...
  • Page 24 Software Example of use (POST and PUT methods): char host[] = “test.libelium.com”; uint16_t port = 80; char resource[] = “/test-get-post.php”; char data[] = “varA=1&varB=2&varC=3&varD=4&varE=5”; _4G.http(Wasp4G::HTTP_POST, host, port, resource, data); Once the request has been sent, the function waits for data from the server and stores it in .
  • Page 25: Sending Waspmote Frames To Meshlium Via Http

    Software 4.8.3. Sending Waspmote frames to Meshlium via HTTP Since Meshlium Manager System v4.0.9, HTTPS method is the default method for sending data. HTTPS is the recommended technology because it provides many cyber security services. Therefore, the HTTPS service is always enabled on Meshlium.
  • Page 26 Data Frame Guide in order to know more about how to _httpCode create sensor frames with Waspmote libraries. Example of use: char host[] = “pruebas.libelium.com”; uint16_t port = 80; // after frame has been created _4G.sendFrameToMeshlium(host, port, frame.buffer, frame.length); Related variable: →...
  • Page 27: Sending Waspmote Frames To Meshlium Via Https

    The downloaded certificate must be installed following the steps explained in the “SSL sockets” section and the proper library function. Also, the example linked at the end of this section shows how to perform the installation. Example of sending frames to Meshlium via HTTPS: www.libelium.com/development/waspmote/examples/4g-08b-send-to-meshlium-https/ -27- v7.3...
  • Page 28: Ftp Client

    FTP server: IP address or URL • FTP port number • Username • Password • Example of use: char ftp_server[] = “pruebas.libelium.com”; uint16_t ftp_port = 21; char ftp_user[] = “t3g@libelium.com”; char ftp_pass[] = “ftp1234”; _4G.ftpOpenSession(ftp_server, ftp_port, ftp_user, ftp_pass); -28- v7.3...
  • Page 29: Ftp Upload

    Software Possible error codes for this function: 1: not registered, ME is not currently searching for a new operator to register to • 2: not registered, but ME is currently searching for a new operator to register to • 3: registration denied •...
  • Page 30: Ftp Download

    • 8: if error sending data • Example of uploading files: www.libelium.com/development/waspmote/examples/4g-09-ftp-upload 4.9.3. FTP download function downloads a file from an FTP server to Waspmote’s SD card. The FTP session must ftpDownload() be already open. This function needs 2 different inputs: the complete path of the file in the FTP server and the complete path of the file to be created in the SD card.
  • Page 31: Ftp Delete File

    • 13: if file size mismatch • Example of downloading files: www.libelium.com/development/waspmote/examples/4g-10-ftp-download 4.9.4. FTP delete file function deletes in the FTP server. The FTP session must be already open. The function expects ftpDelete() the name of the file to be deleted as input.
  • Page 32: Tcp/Udp Connections

    Software 4.10. TCP/UDP connections 4.10.1. Socket identifiers The 4G module permits to have up to 6 simultaneous TCP/UDP connections. For that purpose, the libraries define the following socket identifiers to be used when handling the multi-socket connections: Wasp4G::CONNECTION_1 Wasp4G::CONNECTION_2 Wasp4G::CONNECTION_3 Wasp4G::CONNECTION_4 Wasp4G::CONNECTION_5 Wasp4G::CONNECTION_6...
  • Page 33: Socket Status Structure

    Software Related variables: → Socket identifier _4G.socketInfo[socketId].id → Total number of bytes sent since the socket was opened _4G.socketInfo[socketId].sent → Total number of bytes received _4G.socketInfo[socketId].received → Total number of pending bytes to read _4G.socketInfo[socketId].size → Total number of bytes sent and not yet acknowledged _4G.socketInfo[socketId].ack 4.10.3.
  • Page 34: Creating A Tcp/Udp Client Socket

    Software → Socket identifier _4G.socketInfo[socketId].id → Socket status _4G.socketInfo[socketId].state → Local IP address _4G.socketInfo[socketId].localIp → Local port _4G.socketInfo[socketId].localPort → Remote IP address _4G.socketInfo[socketId].remoteIp → Remote port _4G.socketInfo[socketId].remotePort 4.10.4. Creating a TCP/UDP client socket function configures and opens a socket. This function expects several input parameters: openSocketClient() Socket ID: The first parameter indicates the identifier to be associated to the new TCP/UDP.
  • Page 35: Creating A Tcp/Udp Server Socket

    25: if error sending the open command • 26: if timeout opening the socket • Example of creating TCP/UDP client sockets: www.libelium.com/development/waspmote/examples/4g-11-tcp-client www.libelium.com/development/waspmote/examples/4g-13-udp-client 4.10.5. Creating a TCP/UDP server socket ) function configures and opens a listening socket. This function expects several input openSocketServer( parameters: Socket ID: The first parameter indicates the identifier to be associated to the new TCP/UDP connection.
  • Page 36: Sending Data

    18: if protocol input not valid • 19: if error opening the socket • Example of creating TCP/UDP server sockets: www.libelium.com/development/waspmote/examples/4g-12-tcp-server www.libelium.com/development/waspmote/examples/4g-14-udp-server 4.10.6. Sending data function allows the user to send TCP/UDP packets once the socket is active. The function needs 2 send() different inputs parameters: Socket ID: the socket identifier used for opening the connection.
  • Page 37: Receiving Data

    5: if error getting socket status • 6: if timeout getting socket status • All examples related to TCP/UDP sockets (both client and server) show how to send data: www.libelium.com/development/waspmote/examples/4g-11-tcp-client www.libelium.com/development/waspmote/examples/4g-12-tcp-server www.libelium.com/development/waspmote/examples/4g-13-udp-client www.libelium.com/development/waspmote/examples/4g-14-udp-server 4.10.7. Receiving data function allows the user to receive TCP/UDP packets once the socket is active. The function needs...
  • Page 38: Closing A Socket

    Software Possible error codes for this function: 1: if no data received • 2: if error getting socket info • 3: if timeout waiting for data • 4: if error receiving data from module • 5: if error parsing length of data •...
  • Page 39 Software function allows the user to open a remote connection via socket secured through SSL. openSocketSSL() Several inputs are needed for calling this function: Socket ID: the socket identifier used for opening the connection • Host: Remote SSL server address •...
  • Page 40 6: if error getting received data • 7: if error waiting module confirmation • function allows the user to close a secure socket. The function needs an input parameter closeSocketSSL() for the socket identifier. Example for SSL socket: www.libelium.com/development/waspmote/examples/4g-15-ssl-sockets -40- v7.3...
  • Page 41: Gps

    Software 4.11. GPS Nowadays there are several positioning techniques to provide the localization to end devices. One of them is the A-GPS positioning technique based on the help of a cellular network deploying an A-GPS server. Remember the AU version does not have a GPS receiver. At this point, it is advisable to introduce the definition of Time to First Fix (TTFF): TTFF indicates the time and process required for a GPS device to get adequate satellite signals and data to provide accurate navigation.
  • Page 42: Standalone Or Autonomous Gps (S-Gps)

    Software 4.11.1. Standalone or Autonomous GPS (S-GPS) Standalone or autonomous GPS mode (S-GPS) is a feature that allows the GPS receiver, installed on the 4G module, to perform its First Fixing activity without assistance data coming from cellular network. The GPS receiver estimates its position directly from GPS satellites in its line of sight.
  • Page 43 GPS engine of the 4G module. It is possible to switch from a SUPL session gpsStop() to the autonomous GPS mode. Firstly, the GPS feature must be stopped, and then restart with the autonomous mode. Example of GPS modes: www.libelium.com/development/waspmote/examples/4g-16-gps-autonomous-mode www.libelium.com/development/waspmote/examples/4g-17-agps-ms-assisted www.libelium.com/development/waspmote/examples/4g-18-agps-ms-based -43- v7.3...
  • Page 44: Indoor Tracking Using 4G And A-Gps Mode (Geolocation)

    In this section, the execution of the A-GPS in MS-Based mode is shown. For this purpose, the corresponding example was used: www.libelium.com/development/waspmote/examples/4g-18-agps-ms-based In this example, the GPS is started in MS-based mode. Once location is acquired, the GPS is stopped and started again in Standalone mode.
  • Page 45 Software Figure : Figure: Second iteration (53 seconds after starting the 4G module): Distance error: 28 meters. Figure : Figure: Third iteration (63 seconds after starting the 4G module): Distance error: 28 meters. -45- v7.3...
  • Page 46 Software Figure : Fourth iteration (73 seconds after starting the 4G module): Distance error: 7 meters. The location given by the A-GPS module may vary depending on the spot used to perform the test. The accuracy will improve when the device is situated in a high density or poor cellular antennas area. The location accuracy may vary from 10 to 100 meters so a real test in each case is mandatory before implementing a final application.
  • Page 47: E-Mail Management Functions

    Software 4.12. e-mail management functions 4.12.1. Reseting e-mail parameters function resets the current e-mail parameters in the memory of the module to the default emailReset() ones. The values reset are: e-mail user name • e-mail password • e-mail sender address •...
  • Page 48: Setting The Sender Parameters: Address, Username And Password

    Software 4.12.4. Setting the sender parameters: address, username and password function sets the sender parameters. The input parameters related are: emailSetSender() Address: the address string to be used for sending the e-mail. • Username: the username string to be used for sending the e-mail. •...
  • Page 49 Software 1: if error sending mail • 2: if error waiting for module confirmation • Example of sending e-mail: www.libelium.com/development/waspmote/examples/4g-19-send-email-smtp -49- v7.3...
  • Page 50: Certifications

    Certifications 5. Certifications Libelium offers 2 types of sensor platforms, Waspmote OEM and Plug & Sense!: Waspmote OEM is intended to be used for research purposes or as part of a major product so it needs final • certification on the client side. More info at: http://www.libelium.com/products/waspmote/...
  • Page 51: Code Examples And Extended Information

    Code examples and extended information 6. Code examples and extended information In the Waspmote Development section you can find complete examples: www.libelium.com/development/waspmote/examples -51- v7.3...
  • Page 52: Api Changelog

    API changelog 7. API changelog Keep track of the software changes on this link: www.libelium.com/development/waspmote/documentation/changelog/#4g -52- v7.3...
  • Page 53: Documentation Changelog

    Documentation changelog 8. Documentation changelog From v7.2 to v7.3 Added indications to send frames to Meshlium via HTTP or HTTPS (HTTPS is the default mode for Meshlium • Manager System version equal or greater than v4.0.9) Added indications about the SIM card format for both OEM and Plug and Sense! product versions •...

This manual is also suitable for:

Waspmote 4gLe910

Table of Contents