The AIS SIM7020E API Library is an Arduino IDE library that has been developed to support platforms that use UDP, MQTT, and MQTTs.
#include "AIS_SIM7020E_API.h"
AIS_SIM7020E_API nb;UDP
nb.begin(serverIP,serverPort);MQTT
nb.begin();
setupMQTT();
//nb.connectMQTT(serverIP,serverPort,clientID);
nb.setCallback(callback);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); The AIS Magellan Library is an SDK for use with the Magellan IoT Platform and the Arduino IDE.
#include "Magellan_SIM7020E.h"
Magellan_SIM7020E magel;magel.begin(); //init Magellan LIBPlease ensure that the payload is in JSON format, for example:
payload="{\"Temperature\":"+Temperature+",\"Humidity\":"+Humidity+"}";Please ensure that the payload is in JSON format, for example:
magel.report(payload);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.