Giter Club home page Giter Club logo

tuitwall's Introduction

tuitwall

tuitwall is a project that will allow you to show tweets in a led matrix.

The backend is built with PHP and uses the twitteroauth library to manage all the authentication system with Twitter. It also serves as the configuration page, as the user can choose which tweets and from who, are shown. The Arduino, using the ethernet shield, calls the backend that provides it with the last tweet valid, then shows it on the led matrix with a scroll effect.

Requisites

Web

  • HTTP Server (e.g. Apache)
  • PHP 5

Electronics

Note: this has been tested only with one led matrix, but it can be extended up to 4 boards (and further) with proper code.

Configuration

web/config.php

  • SERVER: server domain (including subdomain if existing, but excluding http:// and sub-folders). It is retrieved by default from PHP variable, if wrong, set it manually.
  • CONSUMER_KEY & CONSUMER_SECRET: consumer application keys, get them from https://dev.twitter.com/apps.
  • OAUTH_CALLBACK: location of the PHP script that will receive the OAuth callback. It should point to callback.php.
  • API_KEY: only devices with the same API_KEY will be able to get tweets through fetch.php. Leave empty ("") to disable the check.
  • SHOW_TWEET: show current tweet at main page?
  • SHOW_USER: prepend tweet owner when giving a tweet to a device through fetch.php?
  • STREAM: show a stream from twitch.tv at the main page? Useful when doing a demo of the project.
  • TWITCH_ID: ID of the stream from twitch.tv you want to show.
  • DISALLOW_LOGOUT: disallow logging out to keep tweets from a specific user being shown. To log out you have to delete auth.txt from the web server.

tuitwall.ino

  • API_KEY: same as in config.php.
  • SERVER: same as in config.php.
  • GET_REQUEST: shouldn't be modified.
  • INTERVAL: milliseconds to wait at least between tweet requests.
  • VEC_LENGTH: length of the array where the tweet will be stored.
  • SPEED: milliseconds to wait at least between led matrix refreshes.
  • TIMEOUT: milliseconds in which the tweet should be received.

The reason there are so many options to limit access to tweets is because Twitter only allows clients to make a limited number of requests in a given hour.

Usage

  1. Upload the contents of the web folder to a web server.
  2. Adapt the configuration to your needs.
    1. Change the SERVER constant (both in the Arduino sketch and config.php) to the appropiate one.
    2. Change the API_KEY to a different one. Remember to use the same in the Arduino sketch and config.php.
    3. Create a Twitter application and point the Callback URL to the location of callback.php.
    4. Copy the Consumer key and Consumer secret keys to config.php.
  3. Mount the Arduino and Ethernet Shield and connect to the PC.
  4. Upload tuitwall.ino to the Arduino.
  5. Connect the led matrix board to the Arduino (continue reading for schematic).
  6. Check that the led matrix board has its direction set to 1 (switches at the back).
  7. Connect the Ethernet Shield to a router through an ethernet cable.
  8. Reset the board.
  9. Enjoy!

Remember that the sketch outputs debug messages to the serial port (at 115200bps), so you can follow initialization and execution of the sketch. The Ethernet Shield relies on a DHCP enabled network, if this is not the case, please modify the code as required to give an appropiate static IP.

Schematic

How to connect Arduino to Sure Electronic's led matrix using the provided IDC cable:

https://github.com/chiva/tuitwall/raw/master/images/tuitwall-schematic.png

The hardware and web part of the project should look similar to this:

https://github.com/chiva/tuitwall/raw/master/images/tuitwall-hardware.jpg

https://github.com/chiva/tuitwall/raw/master/images/tuitwall-web.jpg

Other uses

The Arduino part is mostly universal, you can change the php page it connects to to another one that returns whatever you want to appear on the led matrix. It could be the weather report, current playing song, rss feed, etc. Be creative!

Remember, what the php page returns should be plain text terminated by chr(0). No html, just the text you want to appear.

tuitwall's People

Contributors

chiva avatar

Watchers

James Cloos avatar Manuel Orellana Sandoval avatar

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.