Git Product home page Git Product logo

esp8266githubnotificator's Introduction

ESP8266GitHubNotificator

The ESP8266 lights up the built-in blue LED if you have GitHub notifications waiting.

Theory of operation

An ESP8266 module such as a WEMOS D1 mini is running a simple esp8266/Arduino sketch. The sketch polls the GitHub Notfications API every 60 seconds using a personal GitHub token and lights the built-in LED if there ware notifications available.

Hardware assembly

3D print a nice looking case. Use transparent filament for the area where the blue LED will shine through.

Software setup

Compile and upload the sketch to the WEMOS D1 mini (or another ESP8266 board) using the Arduino IDE and esp8266/Arduino.

Go to https://github.com/settings/tokens, click on "Generate new token", check "notifications", click "Generate token". Copy the resulting token into the sketch at

const String github_token = "...";

Upload the sketch. Connect to the AutoConnectAP WLAN access point, set up your WLAN credentials.

Your contributions are welcome

This is a simple sketch but we still have many ideas, have a look here and send pull requests.

esp8266githubnotificator's People

Contributors

probonopd avatar theassassin avatar

Stargazers

Uelinton Vitor Silva avatar Sylvain LAFRASSE avatar

Watchers

James Cloos avatar  avatar  avatar

esp8266githubnotificator's Issues

Only the first connection request works

For some strange reason, only the first connection request works and all subsequent ones fail. Why?

connecting to api.github.com
GET request sent
2

headers received
connecting to api.github.com
connection failed
connecting to api.github.com
connection failed
connecting to api.github.com
connection failed

Obey the X-Poll-Interval header and "304 Not Modified" response

https://developer.github.com/v3/activity/notifications/ says:

Notifications are optimized for polling with the "Last-Modified" header. If there are no new notifications, you will see a "304 Not Modified" response, leaving your current rate limit untouched. There is an "X-Poll-Interval" header that specifies how often (in seconds) you are allowed to poll. In times of high server load, the time may increase. Please obey the header.

# Add authentication to your requests
curl -I https://api.github.com/notifications
HTTP/1.1 200 OK
Last-Modified: Thu, 25 Oct 2012 15:16:27 GMT
X-Poll-Interval: 60
# Pass the Last-Modified header exactly
curl -I https://api.github.com/notifications
   -H "If-Modified-Since: Thu, 25 Oct 2012 15:16:27 GMT"
HTTP/1.1 304 Not Modified
X-Poll-Interval: 60

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.