koenieee / pushbullet-esp8266 Goto Github PK
View Code? Open in Web Editor NEWPushBullet library to send and receive notifications/sms from your ESP8266 microcontroller.
License: GNU General Public License v2.0
PushBullet library to send and receive notifications/sms from your ESP8266 microcontroller.
License: GNU General Public License v2.0
I could not get the library to compile in the Arduino IDE 1.9.0-beta unless I changed the following in the PushBullet.cpp
file:
removed if(
at line54
Changed
sendAndToggl("/v2/pushes", "{\"body\":\""+message+"\",\"title\":\""+title+"\",\"type\":\"note\"}");
to
String req = buildRequest("/v2/pushes", "{\"body\":\""+message+"\",\"title\":\""+title+"\",\"type\":\"note\"}");
sendAndToggl(req);
for PushBullet::sendNotePush
, PushBullet::sendLinkPush
, PushBullet::sendSMSPush
, and PushBullet::copyToClipboard
It appears that 124553e introduced all of these lines which caused the compilation issues for me
Hi, thank you for your library.
I have a suggestion, I think library don't need to expose open and close connection functions.
When I use your library as it is I only open connection once and never close, this gives issues as messages don't send.
Instead open and close should be inside send functions.
I can make a pull request.
Hey, I've been trying to get past this since a long time now. When I use this library it continuously fails at
if (!pb.checkConnection()) {
Serial.println("Failed to connect to pushbullet.com");
return;
}
I've amended the ssid, password and api key wherever necessary and my esp8266 is successfully connecting to the internet too. Here's my code:
#include <ESP8266WiFi.h>
#include <PushBullet.h>
#include <WiFiClientSecure.h>
WiFiClientSecure client;
#define PORT 443
// wifi connection variables
const char* ssid = "SSID";
const char* password = "PASS";
boolean wifiConnected = false;
int incomingByte = 0;
boolean connectWifi();
PushBullet pb = PushBullet("API", &client, 443);
void setup() {
// Initialise Serial connection
Serial.begin(115200);
// Initialise wifi connection
wifiConnected = connectWifi();
if (!pb.checkConnection()) {
Serial.println("Failed to connect to pushbullet.com");
return;
}
}
void loop() {
// check if the WiFi connection were successful
if (wifiConnected) {
if (true) {
Serial.println("Pushbullet note pushing");
pb.sendNotePush("Hello, from me", "Message");
delay(5000);
}
}
}
// connect to wifi โ returns true if successful or false if not
boolean connectWifi() {
boolean state = true;
int i = 0;
WiFi.begin(ssid, password);
Serial.println("");
Serial.println("Connecting to WiFi");
// Wait for connection
Serial.print("Connecting");
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
if (i > 10) {
state = false;
break;
}
i++;
}
if (state) {
Serial.println("");
Serial.print("Connected to ");
Serial.println(ssid);
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
}
else {
Serial.println("");
Serial.println("Connection failed.");
}
return state;
}
and the following is printed on my serial console:
...
Connected to MY-SSID
IP address: 192.168.0.113
Failed to connect to pushbullet.com
Please let me know a get around for this.
with error:
PushBullet.cpp:87:87: error: default argument given for parameter 2 of 'void PushBullet::registerThisDevice(String, String)'
so...simply replace line 87 from:
void PushBullet::registerThisDevice(const String nickName, const String pushToken = "")
to
void PushBullet::registerThisDevice(const String nickName, const String pushToken)
solve problem
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.