-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from telit/feature/GNSS
Add TLT GNSS example
- Loading branch information
Showing
22 changed files
with
839 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,70 @@ | ||
# TLT Library for Arduino | ||
|
||
This library allows to use a Telit Charlie board to connect to the Internet over a NBIoT, LTE Cat M1 or 2G network(if fallback is available). | ||
|
||
It is a loose porting effort of https://github.com/arduino-libraries/MKRNB Arduino library, providing the same interfaces when possible. | ||
|
||
This library requires the ME310 Arduino Library **greater or equal than 2.4.0** version to work. | ||
|
||
|
||
## Download and install the ME310 Library | ||
|
||
Download the ME310 Arduino library from https://github.com/telit/arduino-me310-library, and place the folder in your Arduino libraries folder, or install the new library from the ZIP file. | ||
|
||
This Library will simplify the interactions with the ME310G1 Module. | ||
|
||
# TLT Library for Arduino | ||
|
||
This library allows to use a Telit Charlie board to connect to the Internet over a NBIoT, LTE Cat M1 or 2G network(if fallback is available). | ||
|
||
It is a loose porting effort of https://github.com/arduino-libraries/MKRNB Arduino library, providing the same interfaces when possible. | ||
|
||
This library requires the ME310 Arduino Library **greater or equal than 2.4.0** version to work. | ||
|
||
|
||
## Download and install the ME310 Library | ||
|
||
Download the ME310 Arduino library from https://github.com/telit/arduino-me310-library, and place the folder in your Arduino libraries folder, or install the new library from the ZIP file. | ||
|
||
|
||
## Contents | ||
|
||
This Library will simplify the interactions with the ME310G1 Module. | ||
|
||
### Classes | ||
|
||
The library provides the following classes: | ||
|
||
- **TLT**: _modem related operations (turn off, check status, enable connectivity, etc. )_ | ||
- **TLTSMS**: _helper for SMS operations_ | ||
- **GPRS**: _GPRS attach utilities_ | ||
- **TLTClient**: _Client to exchange data over TCP/IP_ | ||
- **TLTScanner**: _Utilities to analyze the cellular network such as carrier info, signal strength, etc._ | ||
- **TLTPIN**: _Utilities for the SIM PIN management_ | ||
- **TLTSSLClient**: _TLS/SSL client to exchange data in secure mode_ | ||
- **TLTUDP**: _UDP client utilities_ | ||
- **TLTFileUtils**: _Modem filesystem management_ | ||
- **TLTGNSS**: _GNSS configuration and data management/conversion_ | ||
|
||
|
||
### Examples | ||
|
||
The following examples are available: | ||
|
||
- **[ChooseRadioAccessTechnology_example](examples/ChooseRadioAccessTechnology_example/ChooseRadioAccessTechnology_example.ino)** : _Select a network operator and register the module via the ME310 library. with the preferred technology_ | ||
- **[GPRS_example](examples/GPRS_example/GPRS_example.ino)** : _sest the device connectivity trying to communicate with a HTTP server_ | ||
- **[PinManagement_example](examples/PinManagement_example/PinManagement_example.ino)** : _Insert or disable the SIM PIN_ | ||
- **[ReceiveSMS_example](examples/ReceiveSMS_example/ReceiveSMS_example.ino)** : _SMS management, loop to receive an SMS message_ | ||
- **[SendSMS_example](examples/SendSMS_example/SendSMS_example.ino)** : _SMS management, how to send SMS messages_ | ||
- **[ScanNetworks_example](examples/ScanNetworks_example/ScanNetworks_example.ino)** : _Scan nearby network cells and provide info_ | ||
- **[SSLWebClient_example](examples/SSLWebClient_example/SSLWebClient_example.ino)** : _Connect to a website using SSL_ | ||
- **[TLTGNSS_example](examples/TLTGNSS_example/TLTGNSS_example.ino)** : _Configure the module in GNSS priority and then waits a fix, printing the retrieved coordinates (in decimal and DMS formats)_ | ||
- **[UDPNtpClient_example](examples/UDPNtpClient_example/UDPNtpClient_example.ino)** : _UDP client used to retrieve NTP time_ | ||
- **[WebClient_example](examples/WebClient_example/WebClient_example.ino)** : _Connects to an echo server and exchanges data_ | ||
- **[FileUtils_example](examples/FileUtils_example/FileUtils_example.ino)** : _Shows how to perform file related operations_ | ||
|
||
|
||
## Support | ||
|
||
If you need support, please open a ticket to our technical support by sending an email to: | ||
|
||
- ts-americas@telit.com if you are in the Americas region | ||
- ts-emea@telit.com if you are in EMEA region | ||
- ts-apac@telit.com if you are in APAC | ||
|
||
providing the following information: | ||
|
||
- module type | ||
- answer to the commands (you can use the ME310 library TrasparentBridge example to communicate with the modem) | ||
- AT#SWPKGV | ||
- AT+CPIN? | ||
- AT+CCID | ||
- AT+CGSN | ||
- AT+CGDCONT? | ||
|
||
and add [Charlie][AppZone] in the e-mail object, and in the e-mail body refer to the opened issue on github. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
/*Copyright (C) 2020 Telit Communications S.p.A. Italy - All Rights Reserved.*/ | ||
/* See LICENSE file in the project root for full license information. */ | ||
|
||
/** | ||
@file | ||
TLTMDM.h | ||
string.h | ||
stdio.h | ||
@brief | ||
Sample test of the use of FileUtils class in TLT library. | ||
@details | ||
In this example sketch, it is shown to use file system management, using FileUtils library.\n | ||
Add file in directory, get list of directory, delete files and directory functions are shown.\n | ||
@version | ||
1.0.0 | ||
@note | ||
@author | ||
Cristina Desogus | ||
@date | ||
10/08/2021 | ||
*/ | ||
// libraries | ||
#include <TLTMDM.h> | ||
using namespace me310; | ||
|
||
// initialize the library instance | ||
ME310* myME310 = new ME310(); | ||
TLTFileUtils fileUtils(myME310, true); | ||
|
||
char filename[] = "testFile.txt"; | ||
char fileBin[] = "testBin.bin"; | ||
|
||
|
||
void setup() { | ||
Serial.begin(115200); | ||
myME310->begin(115200); | ||
|
||
delay(5000); | ||
Serial.println("Starting Arduino file demo."); | ||
|
||
myME310->powerOn(ON_OFF); | ||
|
||
fileUtils.begin(); | ||
Serial.print("Free space: "); | ||
Serial.print(fileUtils.freeSpace()); | ||
Serial.println(" Bytes."); | ||
|
||
Serial.print("Count File: "); | ||
Serial.println(fileUtils.fileCount()); | ||
|
||
Serial.println("Files list before new file creation."); | ||
fileUtils.printFiles(); | ||
|
||
String buf = "Hello World"; | ||
Serial.println("Create File"); | ||
fileUtils.createFile(filename, buf.c_str(), buf.length()); | ||
|
||
Serial.println("Files List after create file."); | ||
fileUtils.printFiles(); | ||
|
||
|
||
Serial.println("Check file."); | ||
Serial.print(filename); | ||
Serial.print(": "); | ||
if (fileUtils.existFile(filename)) | ||
{ | ||
Serial.println("File present!"); | ||
|
||
uint32_t size = fileUtils.listFile(filename); | ||
Serial.print("Size file: "); | ||
Serial.println(size); | ||
|
||
String contentFile; | ||
Serial.println("Read File: <"); | ||
fileUtils.readFile(filename, contentFile); | ||
Serial.println(contentFile.c_str()); | ||
Serial.println(">"); | ||
|
||
uint8_t contentFileUint[size+1] = {0}; | ||
Serial.println("Read File Uint8: <"); | ||
fileUtils.readFile(filename, contentFileUint); | ||
Serial.println((char*)contentFileUint); | ||
Serial.println(">"); | ||
|
||
Serial.println("Delete File."); | ||
fileUtils.deleteFile(filename); | ||
|
||
Serial.println("Files List after delete file."); | ||
fileUtils.printFiles(); | ||
} | ||
else | ||
{ | ||
Serial.println("File does not present!"); | ||
} | ||
|
||
Serial.println("Create a binary file"); | ||
uint8_t bufferBin[] = {0,1,2,3,4,5,6,7,8,9}; | ||
|
||
fileUtils.createFile(fileBin, (char*)bufferBin, 10); | ||
Serial.println("Files List after create binary file."); | ||
fileUtils.printFiles(); | ||
|
||
Serial.println("Check file."); | ||
Serial.print(fileBin); | ||
Serial.print(": "); | ||
if (fileUtils.existFile(fileBin)) | ||
{ | ||
Serial.println("File present!"); | ||
|
||
uint32_t size = fileUtils.listFile(fileBin); | ||
Serial.print("Size file: "); | ||
Serial.println(size); | ||
|
||
uint8_t contentFileUint[size+1] = {0}; | ||
uint8_t tmp_contFileUint[(size*2)+1] = {0}; | ||
Serial.println("Read File Uint8: <"); | ||
fileUtils.readFile(fileBin, contentFileUint); | ||
myME310->ConvertBufferToIRA(contentFileUint, tmp_contFileUint, size); | ||
Serial.println((char*)tmp_contFileUint); | ||
Serial.println(">"); | ||
|
||
Serial.println("Delete File."); | ||
fileUtils.deleteFile(fileBin); | ||
|
||
Serial.println("Files List after delete file."); | ||
fileUtils.printFiles(); | ||
} | ||
else | ||
{ | ||
Serial.println("File does not present!"); | ||
} | ||
|
||
|
||
Serial.println("end"); | ||
} | ||
|
||
void loop() { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.