Comments (3)
THis is the example sketch as supplied with the library for an ESP8266
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#include <Pushsafer.h>
// Initialize Wifi connection to the router
char ssid[] = "ssid"; // your network SSID (name)
char password[] = "password"; // your network key
// Pushsafer private or alias key
#define PushsaferKey "XXXXXXXXXXXXX"
WiFiClientSecure client;
Pushsafer pushsafer(PushsaferKey, client);
void setup() {
Serial.begin(115200);
// Set WiFi to station mode and disconnect from an AP if it was Previously
// connected
WiFi.mode(WIFI_STA);
WiFi.disconnect();
delay(100);
// Attempt to connect to Wifi network:
Serial.print("Connecting Wifi: ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
Serial.print(".");
delay(500);
}
Serial.println("");
Serial.println("WiFi connected");
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
pushsafer.debug = true;
struct PushSaferInput input;
input.message = "This is a test message";
input.title = "Hello!";
input.sound = "8";
input.vibration = "1";
input.icon = "1";
input.device = "a";
// API description: https://www.pushsafer.com/en/pushapi
// Other optional Options
// input.url;
// input.urlTitle;
// input.picture;
// input.picture2;
// input.picture3;
// input.time2live;
Serial.println(pushsafer.sendEvent(input));
Serial.println("Sent");
}
void loop() {
}
from pushsafer-arduino-library.
for me all works fine! I'am not a pro for arduino. So please search help from Arduino users in a forum like this: https://forum.arduino.cc/
from pushsafer-arduino-library.
I have just reloaded the library. Seems different than a few days ago.
The CPP code has changed. Now it works okay.
Cheers
To help others. Make sure your library example starts with
#include <ESP8266WiFi.h>
/#include <WiFiClientSecure.h>/
#include <WiFiClient.h>
#include <Pushsafer.h>
If anything different, it will not compile
Matter closed
from pushsafer-arduino-library.
Related Issues (7)
- typo HOT 1
- Not working HOT 8
- Not working again(?) HOT 59
- doesnt fit with Arduino WiFi R2 HOT 5
- Compile error HOT 2
- library not working HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pushsafer-arduino-library.