Skip to content

Arduino Library for AIS Magellan; It is fully compatible with DEVIO NB-DEVKIT I.

License

Notifications You must be signed in to change notification settings

AIS-DeviceInnovation/Magellan_SIM7020E

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Library Version

AIS DEVIO NB-DEVKIT I Library

This library only supports the DEVIO NB-DEVKIT I. If you have any questions or concerns, please reach out to us on DEVIO FB Fanpage.

AIS SIM7020E API

The AIS SIM7020E API Library is an Arduino IDE library that has been developed to support platforms that use UDP, MQTT, and MQTTs.

AIS SIM7020E API Example Code

Calling the AIS SIM7020E API Library:

#include "AIS_SIM7020E_API.h"
AIS_SIM7020E_API nb;

Initializing the AIS SIM7020E API Library:

UDP

nb.begin(serverIP,serverPort);

MQTT

nb.begin();
setupMQTT();
//nb.connectMQTT(serverIP,serverPort,clientID);
nb.setCallback(callback);

Sending Data:

UDP

nb.sendMsgSTR(serverIP,serverPort,payload);  // Send data in String 
// or
nb.sendMsgHEX(serverIP,serverPort,payload);  // Send data in HexString   

MQTT

nb.publish(topic,payload);  

AIS Magellan Library

The AIS Magellan Library is an SDK for use with the Magellan IoT Platform and the Arduino IDE.

Magellan SDK Example Code

Calling the Magellan Library:

#include "Magellan_SIM7020E.h"
Magellan_SIM7020E magel;

Initializing the Magellan Library:

magel.begin();           //init Magellan LIB

Payload Data:

Please ensure that the payload is in JSON format, for example:

payload="{\"Temperature\":"+Temperature+",\"Humidity\":"+Humidity+"}";

Reporting Data:

Please ensure that the payload is in JSON format, for example:

magel.report(payload);

Magellan Payload Format Examples

Location

payload="{\"Location\":"Latitude,Longitude"}";

Battery Status on Dashboard
Battery must be in the range of 0-100 %

payload="{\"Battery\":100}"; 

Lamp Status
Send status using 0 or 1.

payload="{\"Lamp\":0}";
payload="{\"Lamp\":1}";

Note For more examples, please refer to the example code included in the Arduino IDE.