Skip to content

Commit

Permalink
update readme, improvements of file utilities interfaces and examples
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiopi-tlt committed Oct 14, 2021
1 parent 067aaff commit c1a7012
Show file tree
Hide file tree
Showing 24 changed files with 706 additions and 577 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
ME310 0.0.0 - ????.??.??

ME310 2.6.0 - 2021.10.14
* File utilities improvements
* sketches code improvements
* code cleanup

ME310 2.5.0 - 2021.10.08
* Changed Bosch example to use BMA400-API library
* Minor code cleanup
Expand Down
65 changes: 60 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,60 @@
# ME310G1 / Charlie official communication library for Arduino

Code library for Arduino projects using ME310G1 devices (for example, on [Charlie Board](https://github.com/telit/arduino-charlie) )


# ME310G1 / Charlie official communication library for Arduino

Code library for Arduino projects using ME310G1 devices (for example, on [Charlie Board](https://github.com/telit/arduino-charlie) )



## Contents

This Library will provide a set of APIs wrapping the AT commands to simplify the interaction with the ME310G1 device.

### Classes

The library provides the following classes:

- **ME310** : _main class providing all the functionalities, the only needed for users' code_
- **Parser** : _internal helper classes to simplify the AT command responses parsing_
- **PathParsing** : _internal helper class to parse the file paths on the device_
- **ATCommandDataParsing** : _internal class used to call Parser_


### Examples

The following examples are available:

- **[AGNSS_example](examples/AGNSS_example/AGNSS_example.ino)** : _Simple example that shows how to configure the AGNSS functionality_
- **[Bosch_sensor_example](examples/Bosch_sensor_example/Bosch_sensor_example.ino)** : _Shows how to retrieve info from the onboard Bosch BMA400 accelerometer_
- **[CheckModule](examples/CheckModule/CheckModule.ino)** : _Turns the modem on and checks if it responsive_
- **[CLIP_example](examples/CLIP_example/CLIP_example.ino)** : _Shows how to use Calling Line Identifier protocol_
- **[FTP_example](examples/FTP_example/FTP_example.ino)** : _Connects to an FTP server and performs basic operations_
- **[GNSS_example](examples/GNSS_example/GNSS_example.ino)** : _Simple GNSS example, it enables the GNSS receiver and provides raw location data_
- **[LWM2M_example](examples/LWM2M_example/)** : _uses LwM2M protocol and the accelerometer to send data to the OneEdge portal_
- **[LWM2M_example_2G](examples/LWM2M_example/LWM2M_example_2G/LWM2M_example_2G.ino)** : _example with 2G network_
- **[LWM2M_example_4G](examples/LWM2M_example/LWM2M_example_4G/LWM2M_example_4G.ino)** : _example with 4G network_
- **[M2M_example](examples/M2M_example/M2M_example.ino)** : _Communicates with the modem using the M2M commands to manage the filesystem_
- **[ME310_AT_Test](examples/ME310_AT_Test/ME310_AT_Test.ino)** : _Communicates with the modem and provides info about it (ICCID, IMEI etc.)_
- **[MQTT_example](examples/MQTT_example/MQTT_example.ino)** : _Communicate with a MQTT broker_
- **[Ping_example](examples/Ping_example/Ping_example.ino)** : _Simple example that enables the connectivity and pings a server_
- **[Socket_example](examples/Socket_example/Socket_example.ino)** : _Enables connectivity and uses a TCP socket example communicating with a demo server_
- **[TransparentBridge](examples/TransparentBridge/TransparentBridge.ino)** : _Enable the modem and creates a bridge between Arduino serial and modem AT interface, allowing user to send AT commands manually_


## Support

If you need support, please open a ticket to our technical support by sending an email to:

- [email protected] if you are in the Americas region
- [email protected] if you are in EMEA region
- [email protected] if you are in APAC

providing the following information:

- module type
- answer to the commands (you can use the 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.
28 changes: 14 additions & 14 deletions examples/AGNSS_example/AGNSS_example.ino
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
In this example sketch, it is shown how to use AGNSS management, using ME310 library.\n
AGNSS is enable, GNSS configuration, GNSS controller power management, GNSS nmea configuration functions are shown.\n
GPS positions are acquired and response is printed.
NOTE:\n
For the sketch to work correctly, GNSS should be tested in open sky conditions to allow a fix. The fix may take a few minutes.
@version
@version
1.0.0
@note
@author
Expand All @@ -29,7 +30,7 @@
*/

#include <ME310.h>
#include <string>
#include <string>

/*When NMEA_DEBUG is 0 Unsolicited NMEA is disable*/
#define NMEA_DEBUG 0
Expand All @@ -40,21 +41,20 @@

using namespace me310;
/*
* If a Telit-Board Charlie is not in use, the ME310 class needs the Uart Serial instance in the constructor, that will be used to communicate with the modem.\n
* If a Telit-Board Charlie is not in use, the ME310 class needs the Uart Serial instance in the constructor, that will be used to communicate with the modem.\n
* Please refer to your board configuration in variant.h file.
* Example:
* Uart Serial1(&sercom4, PIN_MODULE_RX, PIN_MODULE_TX, PAD_MODULE_RX, PAD_MODULE_TX, PIN_MODULE_RTS, PIN_MODULE_CTS);
* ME310 myME310 (Serial1);
* ME310 myME310 (Serial1);
*/
ME310 myME310;

ME310::return_t rc;
ME310::return_t rc;
int count = 0;

void setup() {
pinMode(ON_OFF, OUTPUT);
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(ON_OFF, LOW);

Serial.begin(115200);
myME310.begin(115200);
Expand All @@ -79,7 +79,7 @@ void setup() {
// e.g. $GPSCFG: 0,4321,2,0
/////////////////////////////////////
Serial.println("Read GNSS configuration");
myME310.read_gnss_configuration(); //issue command AT$GPSCFG?
myME310.read_gnss_configuration(); //issue command AT$GPSCFG?
Serial.println(myME310.buffer_cstr(1));
/////////////////////////////////////
// Set GNSS priority
Expand All @@ -99,7 +99,7 @@ void setup() {

delay(5000);
/////////////////////////////////////
// Set constellations
// Set constellations
// AT$GPSCFG=2,X
// 0 : the constellation is selected automatically based on Mobile Country Code (MCC) of camped network
// 1 : GPS+GLO
Expand Down Expand Up @@ -149,7 +149,7 @@ void setup() {
// Set GNGSA, GLGSV and GNRMC as available sentence in the unsolicited NMEA sentences.
// AT$GPSNMUNEX=0,1,1,0,0,0,0,0,0,0,0,1,0
/////////////////////////////////////
rc = myME310.gnss_nmea_extended_data_configuration(0,1,1,0,0,0,0,0,0,0,0,1,0);
rc = myME310.gnss_nmea_extended_data_configuration(0,1,1,0,0,0,0,0,0,0,0,1,0);
if(rc == ME310::RETURN_VALID)
{
/////////////////////////////////////
Expand Down Expand Up @@ -180,7 +180,7 @@ void setup() {
// AT$AGNSS=provider,status
// <status>:0 to disable
// 1 to enable
/////////////////////////////////////
/////////////////////////////////////
Serial.println("Set the AGNSS providers enable.");
myME310.gnss_set_agnss_enable(0,1);

Expand All @@ -202,7 +202,7 @@ void loop() {
// Get Acquired Position
// AT$GPSACP
/////////////////////////////////////

rc = myME310.gps_get_acquired_position();

/*When the position is fixed, the led blinks*/
Expand Down Expand Up @@ -257,4 +257,4 @@ void loop() {
exit(0);
}
count++;
}
}
9 changes: 5 additions & 4 deletions examples/CLIP_example/CLIP_example.ino
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
@details
In this example sketch, the use of methods offered by the ME310 library for using AT commands is shown.\n
The Calling line identify is enable and wait_for_unsolicited is call in loop part. The response is printed with buffer_cstr_raw.\n
To use this example is necessary a voice variant firmware and a SIM card that supports voice.
NOTE:\n
To use this example is necessary a voice variant firmware and a SIM card that supports voice.\n
For correct operation it is also necessary to set the right APN.
@version
1.0.0
Expand All @@ -38,11 +40,11 @@

using namespace me310;
/*
* If a Telit-Board Charlie is not in use, the ME310 class needs the Uart Serial instance in the constructor, that will be used to communicate with the modem.\n
* If a Telit-Board Charlie is not in use, the ME310 class needs the Uart Serial instance in the constructor, that will be used to communicate with the modem.\n
* Please refer to your board configuration in variant.h file.
* Example:
* Uart Serial1(&sercom4, PIN_MODULE_RX, PIN_MODULE_TX, PAD_MODULE_RX, PAD_MODULE_TX, PIN_MODULE_RTS, PIN_MODULE_CTS);
* ME310 myME310 (Serial1);
* ME310 myME310 (Serial1);
*/
ME310 myME310;
ME310::return_t rc; //Enum of return value methods
Expand All @@ -56,7 +58,6 @@ void setup() {

pinMode(ON_OFF, OUTPUT);
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(ON_OFF, LOW);

Serial.begin(115200);
myME310.begin(115200);
Expand Down
33 changes: 22 additions & 11 deletions examples/CheckModule/CheckModule.ino
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@details
In this example sketch, it is shown how to use a basic AT commands via ME310 library.\n
@version
@version
1.0.0
@note
Expand All @@ -27,14 +27,14 @@

#include <ME310.h>

/*
/*
//sercom2
#define PIN_MODULE_RX 29
#define PIN_MODULE_TX 28
#define PAD_MODULE_TX UART_TX_PAD_0
#define PAD_MODULE_RX SERCOM_RX_PAD_1
#define PIN_MODULE_RTS 30
#define PIN_MODULE_CTS 31
#define PIN_MODULE_CTS 31
*/

#ifndef ARDUINO_TELIT_SAMD_CHARLIE
Expand All @@ -43,28 +43,39 @@

using namespace me310;
/*
* If a Telit-Board Charlie is not in use, the ME310 class needs the Uart Serial instance in the constructor, that will be used to communicate with the modem.\n
* If a Telit-Board Charlie is not in use, the ME310 class needs the Uart Serial instance in the constructor, that will be used to communicate with the modem.\n
* Please refer to your board configuration in variant.h file.
* Example:
* Uart Serial1(&sercom4, PIN_MODULE_RX, PIN_MODULE_TX, PAD_MODULE_RX, PAD_MODULE_TX, PIN_MODULE_RTS, PIN_MODULE_CTS);
* ME310 myME310 (Serial1);
* ME310 myME310 (Serial1);
*/
ME310 myME310;
ME310 myME310;
bool ready = false;

void setup() {
pinMode(ON_OFF, OUTPUT);
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(ON_OFF, LOW);

myME310.begin(115200);

delay(1000);
myME310.powerOn(ON_OFF);
if(myME310.attention() == ME310::RETURN_VALID)
{
ready = true;
}
}

void loop() {
digitalWrite(LED_BUILTIN, HIGH);
delay(500);
digitalWrite(LED_BUILTIN, LOW);
delay(500);
if(ready)
{
digitalWrite(LED_BUILTIN, HIGH);
delay(500);
digitalWrite(LED_BUILTIN, LOW);
delay(500);
}
else
{
exit(0);
}
}
10 changes: 6 additions & 4 deletions examples/FTP_example/FTP_example.ino
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
@details
In this example sketch, it is shown how to use FTP management, using ME310 library.\n
NOTE:\n
For correct operation it is necessary to set the correct APN, username and password.
@version
1.0.0
Expand Down Expand Up @@ -40,11 +43,11 @@

using namespace me310;
/*
* If a Telit-Board Charlie is not in use, the ME310 class needs the Uart Serial instance in the constructor, that will be used to communicate with the modem.\n
* If a Telit-Board Charlie is not in use, the ME310 class needs the Uart Serial instance in the constructor, that will be used to communicate with the modem.\n
* Please refer to your board configuration in variant.h file.
* Example:
* Uart Serial1(&sercom4, PIN_MODULE_RX, PIN_MODULE_TX, PAD_MODULE_RX, PAD_MODULE_TX, PIN_MODULE_RTS, PIN_MODULE_CTS);
* ME310 myME310 (Serial1);
* ME310 myME310 (Serial1);
*/
ME310 myME310;
ME310::return_t rc; //Enum of return value methods
Expand All @@ -57,7 +60,6 @@ void setup() {

pinMode(ON_OFF, OUTPUT);
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(ON_OFF, LOW);

Serial.begin(115200);
myME310.begin(115200);
Expand Down Expand Up @@ -190,6 +192,6 @@ void loop() {
Serial.println((String)"ERROR: " + myME310.return_string(rc));
}
rc = myME310.ftp_close();
Serial.println("The application has ended...");
Serial.println("The application has ended...");
exit(0);
}
Loading

0 comments on commit c1a7012

Please sign in to comment.