Note: The below examples use straight AT commands so doesnt need the Arduino MKR library which can be found here Arduino MKRNB
These sketches demonstrate how to;
- Register an MKR NB 1500 on Cumulocity
- Send measurements from an MKR NB 1500 to Cumulocity
- A Telstra Arduino MKR NB 1500 board.
- A Telstra SIM card with an active subscription.
- A Cumulocity account.
- A user with permissions to register devices.
- (Optional) A DHT11 temperature and humidity sensor.
- (Optional) The SimpleDHT library.
Open register_device
. Enter your Cumulocity tenancy and user information on lines 20 - 22.
// Cumulocity tenancy config
String username = "";
String password = "";
String tenancy = "";
On line 23, give your device a name (eg MyArduino).
String deviceName = "";
Upload and run the sketch. Once successfully registered, the serial monitor will continuously print the deviceId
; note this down.
Open send_measurements
. Enter your Cumulocity tenancy, user information, and deviceId
on lines 30 - 33.
// Cumulocity tenancy config
String username = "";
String password = "";
String tenancy = "";
String deviceId = "";
Connect your DHT to GND, 5V, and pin 11.
Upload and run the sketch. You will now see measurements in Cumulocity.