GithubHelp home page GithubHelp logo

koenieee / pushbullet-esp8266 Goto Github PK

View Code? Open in Web Editor NEW
29.0 29.0 10.0 22 KB

PushBullet library to send and receive notifications/sms from your ESP8266 microcontroller.

License: GNU General Public License v2.0

C++ 100.00%

pushbullet-esp8266's People

Contributors

koenieee avatar reaper7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pushbullet-esp8266's Issues

multiple compilation errors

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:

Change 1

removed if( at line54

Change 2

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

Notes

It appears that 124553e introduced all of these lines which caused the compilation issues for me

Connection is lost

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.

Connection to api.pushbullet.com fails

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.

Arduino 1.6.8 compilation error

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.