MKR1000 Pushover Status Using Arduino

Send status messages of your MKR1000 via Pushover service to your mobile phone, etc.Pushover service

Things used in this project

Hardware components

Arduino MKR1000
Arduino MKR1000

Story
An IoT node must be trimmed to reduce current consumption due to battery life. A WiFi-based node as Arduino MKR1000 needs a lot of current while sending.

To avoid a high current consumption over time the controller should sleep the most time, wake up for sending some info, and go to sleep for a defined period of time afterwards.

Status messages of the IoT node are welcome to see the health of the node. In this project the RSSI, or “Received Signal Strength Indicator” is sent by a Pushover message to my mobile phone.

The RSSI is a measurement of how well your device can hear a signal from an access point or router. It’s a value that is useful for determining if you have enough signal to get a good wireless connection (see https://www.metageek.com/training/resources/understanding-rssi.html).

No external components are required. Power the MKR100 – That’s all.

Code

MKR1000_PushOver_Status_WakeUp

/*
MKR1000_PushOver_Status_Wakeup.ino

created 2018-07-05 Claus Kuehnel (info@ckuehnel.ch)
*/

#include <SPI.h>
#include <WiFi101.h>
#include <RTCZero.h>

char* ssid = SECRET_SSID;
char* password = SECRET_PW;

// Pushover settings
char pushoversite[] = “api.pushover.net”;
char apitoken[] = “aeneokkaiz6iywxhpzigzug9khzi33”;
char userkey [] = “uojfahpyozqtj6gbgccg61e5jngg93”;

int length;

WiFiClient client;

/* Create an rtc object */
RTCZero rtc;

/* Change these values to define the wakeup periode */
byte wakeupSeconds = 0;
byte wakeupMinutes = 5;
byte wakeupHours = 0;

/* Change these values to set the current initial time */
const byte seconds = 0;
const byte minutes = 0;
const byte hours = 0;

/* Change these values to set the current initial date */
const byte day = 1;
const byte month = 1;
const byte year = 2018;

bool matched = true;

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

rtc.begin();

rtc.setTime(hours, minutes, seconds);
rtc.setDate(day, month, year);

rtc.setAlarmTime(hours + wakeupHours, minutes + wakeupMinutes, seconds + wakeupSeconds);
rtc.enableAlarm(rtc.MATCH_HHMMSS);

rtc.attachInterrupt(alarmMatch);
}

Leave a Comment

Your email address will not be published. Required fields are marked *