A library created by Yingzhe and Luis from University Relation, Software AG
This library enables you to post the real-time data, alarm and events to the Cumulocity IoT platform.
The University Relation created the library which is used for arduino containing the WiFi module WiFiNINA and WiFi101.
The library was desgined for MKR WIFI 1010 only!! If you are the user from ESP32 or ESP82, you have to modify the code. Sorry for that!
Libraries to be included
- WiFi liraries, e.g., WiFiNINA, WiFi101.
- NTPClient from https://github.com/taranais/NTPClient
void registerDevice(char* deviceName, char* URL, char* username, char* password);
char* deviceName
Device namechar* URL
The URL where your tenant is. The format should be: MyTenant.cumulocity.comchar* username
The username of your tenantchar* password
The password of your tenant
void sendMeasurement(int value, char* unit, String timestamp,char* measurementType,char* measurementObjectName,char* URL);
int value
Measurement to be sentchar* unit
Unit associated with the measurementString timestamp
Timestamp where the measurement is createdchar* measurementType
Type of the measurementchar* measurementObjectName
Object Name of the measurementchar* URL
The URL where your tenant is. The format should be: MyTenant.cumulocity.com
void sendAlarm(char* alarm_Type, char* alarm_Text, char* severity,String timestamp, char* URL);
char* alarm_Type
Type of the alarm. The format is, c8y_FollowThisAlarmchar* alarm_Text
Text of the alarm.char* severity
The severity of the alarm. It could be "CRITICAL", "MAJOR", "MINOR", "WARNING"String timestamp
Timestamp where the measurement is createdchar* URL
The URL where your tenant is. The format is: MyTenant.cumulocity.com
void sendEvent(char* event_Type, char* event_Text, String timestamp, char* URL);
char* event_Type
Type of the event. The format is, c8y_FollowThisEventchar* event_Text
Text of the event.String timestamp
Timestamp where the measurement is createdchar* URL
The URL where your tenant is. The format is: MyTenant.cumulocity.com
These tools are provided as-is and without warranty or support. They do not constitute part of the Software AG product suite. Users are free to use, fork and modify them, subject to the license agreement. While Software AG welcomes contributions, we cannot guarantee to include every contribution in the master project.