background image

-47-

v7.3

Software

4.12. e-mail management functions

4.12.1. Reseting e-mail parameters

The 

emailReset()

 function resets the current e-mail parameters in the memory of the module to the default 

ones. The values reset are: 

 

e-mail user name

 

e-mail password

 

e-mail sender address

 

e-mail SMTP server

Example:

 {

  

_4G.emailReset();

 }

4.12.2. Setting the SMTP server

The 

emailSetServerSMTP()

 function sets the SMTP server address, used for e-mail sending. The function expects 

an input parameter for the SMTP server address. This parameter can be either: 

 

Any valid IP address in the format: xxx.xxx.xxx.xxx

 

Any host name to be solved with a DNS query (factory default is the empty string “”)

Example: 

 {

  

_4G.emailSetServerSMTP(“smtp.mydomain.com”);

 }

4.12.3. 

Configuring SMTP parameters

The 

emailConfigureSMTP()

 function sets the parameters needed to the SMTP connection. The input parameters 

for this function are: 

 

Security:

 parameter indicating if the SSL encryption is enabled. The possibilities are: 

 

-

Wasp4G::EMAIL_NONSSL

 

-

Wasp4G::EMAIL_SSL

 

Port:

 SMTP port to contact (default 25). Range is from 1 to 65535. 

Example: 

 {

   

_4G.emailConfigureSMTP(Wasp4G::EMAIL_NONSSL, 25);

 }

Note:

 

some servers support an obsolete implementation of SMTPS on port 465. The module only supports the standard 

implementation of SMTP over SSL/TLS described in RFC 3207. So do not use port 465 on servers with an obsolete 

implementation of SMTPS: the module will not work properly. Use instead port 25 or port 587.

Содержание LE910

Страница 1: ...Waspmote 4G Networking Guide ...

Страница 2: ...onstants 11 4 1 4 API variables 12 4 1 5 API functions 13 4 1 6 Error codes 13 4 2 Switching on 16 4 3 Switching off 16 4 4 SIM card 16 4 4 1 Entering PIN 16 4 4 2 Getting IMEI IMSI and ICCID 17 4 5 Checking network connection status 18 4 6 Setting operator parameters 19 4 7 SMS 19 4 7 1 Setting SMS configuration 19 4 7 2 Sending SMSs 20 4 7 3 Reading SMSs 20 4 7 4 Deleting SMSs 21 4 8 HTTP client...

Страница 3: ...data 37 4 10 8 Closing a socket 38 4 10 9 SSL sockets 38 4 11 GPS 41 4 11 1 Standalone or Autonomous GPS S GPS 42 4 11 2 Assisted GPS A GPS 42 4 11 3 Get GPS position 42 4 11 4 Indoor tracking using 4G and A GPS mode geolocation 44 4 12 e mail management functions 47 4 12 1 Reseting e mail parameters 47 4 12 2 Setting the SMTP server 47 4 12 3 Configuring SMTP parameters 47 4 12 4 Setting the send...

Страница 4: ...ation such as latitude longitude altitude and speed that makes it perfect to perform tracking applications The new 4G module offers the maximum performance of the 4G network as it uses 2 different antennas normal diversity for reception MIMO DL 2x2 choosing the best received signal at any time and getting a maximum download speed of 100 Mbps We chose the LE910 chipset family from Telit as it compr...

Страница 5: ...rmal diversity for reception MIMO DL 2x2 choosing the best received signal at any time and getting a maximum download speed of 100 Mbps Features comparison Features v12 3G module SIM5215 v15 4G module LE910 Chipset manufacturer SIMCom Telit Cellular protocols 3G GPRS GSM 4G 3G GPRS GSM Certifications CE GCF FCC IC PTCRB CE GCF ANATEL FCC IC PTCRB AT T Compliant KCC RCM NTT DoCoMo KDDi GPS No Yes C...

Страница 6: ...Uplink Downlink up to 384 kbps Protocols TCP UDP HTTP FTP GPS receiver in certain versions 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 LE910 EUG LE910 NAG LE910 AU V2 Region Europe and Brazi...

Страница 7: ...E910 EU V2 LE910 NA V2 Region Europe USA and Canada Americas Supported 4G bands B20 800 B8 900 B3 1800 B1 2100 B7 2600 B12 700 B13 700 B5 850 B4 1700 B2 1900 3G fall back Yes Yes Supported 3G bands B8 900 B1 2100 B5 850 B2 1900 2G fall back Yes No Supported 2G bands 900 1800 None GPS GLONASS No No 3 3 How to connect the module This module must be connected to the SOCKET1 on the Waspmote board Like...

Страница 8: ... 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 Figure SIM card installation in Plug and Sense version Figure Push push mechanism in the External SIM USB socket ...

Страница 9: ... maximum performance it is recommended to place the antennas like that The main cellular antenna should be in vertical position pointing to the sky in order to radiate better to the cellular base stations around The diversity cellular antenna should be in horizontal position orthogonal 90º to the main antenna Besides the plane where the antenna is should be also orthogonal to the main antenna s pl...

Страница 10: ... The rechargeable battery will not suffer this effect as long as its level is above 20 3 6 Time consumption The following table describes the mean elapsed time for some actions in a single test for several attempts Action Mean elapsed time Power on 11 s Start data connection 4 s Perform HTTP GET or POST 0 7 s Open FTP session 3 s Perform FTP upload 10 kB file 7 s Perform FTP download 10 kB file 6 ...

Страница 11: ...ow Waspmote works When using the class constructor all variables are initialized to their default values 4 1 3 API constants The API constants used in functions are Constant Description DEBUG_WASP4G This definition enables disables the debug mode via USB port 0 No debug mode enabled 1 Debug mode enabled for error output messages 2 Debug mode enabled for both error and OK messages LE910_RATE Module...

Страница 12: ...It stores the phone number of the SMS read from module s memory _smsDate It stores the date of the SMS read from module s memory _smsTime It stores the time of the SMS read from module s memory _socketIndex It stores the socket index which is getting data from UDP or TCP _httpCode It stores the HTTP status code _filesize It stores the size of the file when FTP upload download is performed _ftpWork...

Страница 13: ...ERROR_0002 2 Phone adapter link reserved WASP4G_CME_ERROR_0003 3 Operation not allowed WASP4G_CME_ERROR_0004 4 Operation not supported WASP4G_CME_ERROR_0005 5 Phone SIM Subscriber Identity Module PIN Personal Identification Number required WASP4G_CME_ERROR_0010 10 SIM not inserted WASP4G_CME_ERROR_0011 11 SIM PIN required WASP4G_CME_ERROR_0012 12 SIM PUK Personal Unlocking Key required WASP4G_CME_...

Страница 14: ...CME_ERROR_0149 149 PDP authentication failure WASP4G_CME_ERROR_0150 150 Invalid mobile class WASP4G_CME_ERROR_0550 550 Generic undocumented error WASP4G_CME_ERROR_0551 551 Wrong state WASP4G_CME_ERROR_0552 552 Wrong mode WASP4G_CME_ERROR_0553 553 Context already activated WASP4G_CME_ERROR_0554 554 Stack already active WASP4G_CME_ERROR_0555 555 Activation failed WASP4G_CME_ERROR_0556 556 Context no...

Страница 15: ...ter WASP4G_CMS_ERROR_0310 310 SIM not inserted WASP4G_CMS_ERROR_0311 311 SIM PIN required WASP4G_CMS_ERROR_0312 312 Phone SIM PIN required WASP4G_CMS_ERROR_0313 313 SIM failure WASP4G_CMS_ERROR_0314 314 SIM busy WASP4G_CMS_ERROR_0315 315 SIM wrong WASP4G_CMS_ERROR_0316 316 SIM PUK required WASP4G_CMS_ERROR_0317 317 SIM PIN2 required WASP4G_CMS_ERROR_0318 318 SIM PUK2 required WASP4G_CMS_ERROR_0320...

Страница 16: ...le of use _4G OFF 4 4 SIM card 4 4 1 Entering PIN The enterPIN function allows the user to enter the PIN Personal Identification Number of the SIM Subscriber Identification Module card If the SIM card has no PIN or the PIN was disabled on the SIM card it is not necessary to use this function Example for entering the PIN _4G enterPIN 1234 Besides there is another function prototype in order to set ...

Страница 17: ...quest the model identifier Wasp4G INFO_REV_ID To request the firmware revision Wasp4G INFO_IMEI To request the IMEI International Mobile Station Equipment Identity which is the unique identifier of the module similar to a MAC address Wasp4G INFO_IMSI To request the IMSI Wasp4G INFO_ICCID To request the ICCID Examples of use get IMEI number _4G getInfo Wasp4G INFO_IMEI get IMSI number _4G getInfo W...

Страница 18: ... 4 unknown The checkDataConnection function checks the module s network connection status connects the module to data service and returns whether the module is connected to data service is not connected to a network is searching for a new operator to register to registration was denied This function will wait for the module to be connected to a network for the specified time in second units Exampl...

Страница 19: ...the 4G module Example of use _4G set_APN apn login password The show_APN function allows the user to display the current settings stored in Waspmote s memory which are used by the libraries when data connections are performed Example of use _4G show_APN Related variable _4G _apn Stores the APN name _4G _apn_login Stores the APN login _4G _apn_password Stores the APN password 4 7 SMS 4 7 1 Setting ...

Страница 20: ...tion reads an SMS from the module storage The user must give the index of the SMS to be 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 The SMS text field can be found in _4G _ buffer Example of use uint8_t index 5 _4G readSMS index The readNewSMS function reads the last un...

Страница 21: ... the storage memory according to several possibilities For this function 2 inputs are introduced the SMS index number and the delete flag If delete flag is not set to delete one single message then index is ignored and the module shall follow the rules for delete flag shown below Wasp4G SMS_DELETE_MESSAGE To delete the message specified in index Wasp4G SMS_DELETE_ALL_1 To delete all read messages ...

Страница 22: ...1 value1 It is a couple with the variable name and value which we want the web service to parse view html It is an optional argument It shows a pretty response HTML formatted All arguments must be separated by The variable name and value must be separated by Some examples pruebas libelium com getpost_frame_parser php var1 3 1415 pruebas libelium com getpost_frame_parser php var1 3 1415 view html p...

Страница 23: ...le once the couples are parsed the user can modify the PHP to save data into a txt file or insert couples into a database or include a timestamp 4 8 2 HTTP request methods The http function configures HTTP parameters performs the request selected by the user and handles the data returned from the server This function needs several parameters to work properly depending on the method used The first ...

Страница 24: ...ion denied 4 unknown 6 not registered ME is not currently searching for a new operator to register to 8 not registered but ME is currently searching for a new operator to register to 9 registration denied 10 unknown 12 if error setting APN 13 if error setting login 14 if error setting password 15 if error activating GPRS connection 16 if error setting URL and port 17 if error sending the request 1...

Страница 25: ...n order to be able to receive HTTP non secure requests The user must go to Manager System System Security HTTP Service Figure Enable HTTP service in Meshlium Manager System The sendFrameToMeshlium function has been developed to send Waspmote frames from Waspmote to Meshlium via non secure HTTP request Meshlium will parse chop the frame and will store it in its internal MySQL database This function...

Страница 26: ... more about how to 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 _4G _httpCode Stores the HTTP code from the server _4G _buffer Stores data received from server _4G _length Stores data length frame buffer Stores data frame that will...

Страница 27: ...t picture shows how the user can download the Meshlium s certificate from Manager System System Users Manager Download Certificate Figure Meshlium certificate export process 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 Exa...

Страница 28: ...ta 19 if wrong method has been selected 20 if timeout waiting the URC 21 if error reading the URC 22 if error reading the HTTP status 23 if error reading the HTTP data length 24 if error reading the HTTP data 25 if error code from 4G module while waiting for HTTP response 26 if timeout waiting for HTTP response 27 if HTTP response data length is zero Example of sending frames to Meshlium www libel...

Страница 29: ...ons for uploading and downloading files 4 9 2 FTP upload The ftpUpload function uploads a file from the Waspmote s SD card to the FTP server The FTP session must be already open This function needs 2 different inputs the complete path of the file to be created in the FTP server and the complete path of the file in the SD card to be uploaded Example of use for files in root directory char sd_file F...

Страница 30: ... in root directory char sd_file FILE1 TXT char server_file FILE2 TXT _4G ftpDownload server_file sd_file In the case the file should be downloaded into an SD card s subdirectory instead of the root directory the SD filename must be accordingly defined The user must keep in mind that subdirectories have to be already created in the SD card in order to create files into them Example of use for files...

Страница 31: ...ttribute which stores the information Example of getting the FTP working directory _4G ftpGetWorkingDirectory Related variable _4G _ftpWorkingDirectory Stores the current working directory The ftpChangeWorkingDirectory function allows the user to change the current working directory The user must keep in mind that the directory to access must be already created before attempting to call this funct...

Страница 32: ...structure stores the information to be stored for all sockets For each one of the connections the information structure includes Socket identifier Total number of bytes sent since the socket was opened Total number of bytes received since socket was opened Total number of pending bytes to read which arrived through the socket Total number of bytes sent and not yet acknowledged since the socket was...

Страница 33: ...US_SUSPENDED Wasp4G STATUS_SUSPENDED_DATA Wasp4G STATUS_LISTENING Wasp4G STATUS_INCOMING Wasp4G STATUS_OPENING Local IP address Local port Remote IP address Remote port As it is possible to have up to 6 simultaneous connections the global variable is defined as follows SocketStatus_t socketStatus 6 The definition of the structure is struct SocketStatus_t uint8_t id uint8_t state char localIp 16 ui...

Страница 34: ...host name to be solved with a DNS query Any valid IPv6 address in the format xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx or xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx Remote port Remote host port to contact from 1 to 65535 Local port Parameter is valid for UDP connections only and has no effect if used for TCP connections UDP connections local port from 1 to 65535 Example of creat...

Страница 35: ...ment 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 The openSocketServer function configures and opens a listening socket This function expects several input parameters Socket ID The first parameter indicates the identifier to be associated to the new TCP UDP connection This identifier is needed in order to...

Страница 36: ...ntly searching for a new operator to register to 8 not registered but ME is currently searching for a new operator to register to 9 registration denied 10 unknown 12 if error setting APN 13 if error setting login 14 if error setting password 15 if error activating GPRS connection 16 if error getting socket status 17 if error in Socket Configuration 18 if protocol input not valid 19 if error openin...

Страница 37: ...evelopment waspmote examples 4g 14 udp server 4 10 7 Receiving data The receive function allows the user to receive TCP UDP packets once the socket is active The function needs different inputs Socket ID the socket identifier used for opening the connection Timeout optional input If no timeout input is specified the receive function is a non blocking function which answers if data has been receive...

Страница 38: ...et new functions are defined for opening the socket sending data receiving data and closing the socket Currently for SSL sockets only one single connection is permitted So regarding the socket identifiers the only available option is Wasp4G CONNECTION_1 The manageSSL function allows the user to store delete and read security data Certificate CA certificate private key into the non volatile memory ...

Страница 39: ...et Status 17 if socket disabled 19 if socket already open 20 if error opening the socket 21 if no response from module The sendSSL function allows the user to send data through a secure socket Several inputs are needed for calling this function Socket ID the socket identifier used for opening the connection Data Data to send Possible error codes for this function 1 if error checking socket status ...

Страница 40: ...ponse from module 5 if error parsing length of received data 6 if error getting received data 7 if error waiting module confirmation The closeSocketSSL function allows the user to close a secure socket The function needs an input parameter for the socket identifier Example for SSL socket www libelium com development waspmote examples 4g 15 ssl sockets ...

Страница 41: ...ta to provide accurate position GPS satellite signals Almanac data Ephemeris data If a GPS device has been turned off for a long period of time when it is turned on it will take longer to acquire these data sets and get a Time to First Fix One way to speed up TTFF is to use the A GPS Positioning Technique A cold start indicates the scenario in which the GPS must get all data in order to start navi...

Страница 42: ...connects to an SLP Server through an IP network 2 modes are available MS Assisted MS Based In MS Assisted mode the module receives acquisition assistance reference time and other optional assistance data from the network The mobile service provider continuously logs GPS information mainly the almanac from the GPS satellites using an A GPS server in its system With the help of this data the A GPS s...

Страница 43: ...outh Longitude Longitude indicator East or West Time Date Number of satellites HDOP Horizontal Dilution of precision If this value is less than 1 indicates the highest possible confidence level to be used for applications The convert2Degrees function performs the conversion from the latitude and latitude variables given by the 4G module to degrees so it is more legible and intuitive The input para...

Страница 44: ...not penetrate building interiors well A GPS uses proximity to cellular towers to calculate position when GPS signals are not available 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...

Страница 45: ... v7 3 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 ...

Страница 46: ... 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 ...

Страница 47: ...h a DNS query factory default is the empty string Example _4G emailSetServerSMTP smtp mydomain com 4 12 3 Configuring SMTP parameters The emailConfigureSMTP function sets the parameters needed to the SMTP connection The input parameters for this function are Security parameter indicating if the SSL encryption is enabled The possibilities are Wasp4G EMAIL_NONSSL Wasp4G EMAIL_SSL Port SMTP port to c...

Страница 48: ...nder address 2 if error setting the sender user 3 if error setting the sender password 4 12 5 Saving e mail parameters The emailSave function saves the actual e mail parameters in the memory of the module The values reset are e mail user name e mail password e mail sender address e mail SMTP server Example _4G emailSave 4 12 6 Sending an e mail The emailSend function sends an e mail message The in...

Страница 49: ... 49 v7 3 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 ...

Страница 50: ...te Plug Sense is the line ready to be used out of the box It includes market certifications See below the specific list of regulations passed More info at http www libelium com products plug sense Plug Sense 4G is certified for CE Europe FCC US IC Canada ANATEL Brazil RCM Australia PTCRB US AT T US Figure Certifications of the Plug Sense 4G product line The 4G module is also used on Meshlium which...

Страница 51: ... 51 v7 3 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 ...

Страница 52: ... 52 v7 3 API changelog 7 API changelog Keep track of the software changes on this link www libelium com development waspmote documentation changelog 4g ...

Страница 53: ...TTPS 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 From v7 1 to v7 2 Added description about the new V2 radio versions From v7 0 to v7 1 Added a new section to show the user how to connect the module to waspmote ...

Отзывы: