Facebook LED Blink on New Notifications and Messages

39,557

104

92

Introduction: Facebook LED Blink on New Notifications and Messages

In this instructable I will show you how to make a LED blink when you have a new notification or message on Facebook via the parallel port. Check out the following video for a demonstration:


It is a quick and easy project to do, provided you have the required stuff.

Step 1: How Does It Work?

There are two parts that power this project.

The first part is a small program that turns on or off the LEDs that are on a parallel port using inpout32.dll. The program hosts a tiny server that its one and only purpose is to understand HTTP requests.

The second part is a Greasemonkey script that detects when you have a new notification/message.
If you have a new notification or a message, the script will request a URL from the server the program described above hosts, and the program will understand the URL, and will start blinking the requested LED.
After you read your new notification/message, the script will request the same URL as before, which tells the program to stop blinking the LED.

Simple eh?

Step 2: Requirements

You will need:
- Windows (also works with x64 versions)
     It should be possible to make this work on Linux, but not on a Mac, because as far as I know, Macs do not have a parallel port
- A parallel port
     Most new computers don't have an integrated parallel port, so you'll have to buy a PCI-to-parallel card yourself. From what I read on the internet, not all cards will work, and USB-to-parallel also won't work.
- Mozilla Firefox with the Greasemonkey extension installed or Google Chrome (Opera might work too)
- 2 LEDs
- Centronics Printer cable (optional; I use it as an extension cable)

Step 3: Download and Configure the LED Blinker

Download the LED Blinker from this step's attachments, and unzip it somewhere.

Open Device Manager (you can do that by pressing WindowsKey+R and typing devmgmt.msc in the window that comes up), double click on Ports (COM & LPT), and then double click on your parallel port (it is usually listed as ECP Parallel Port or Printer Port or something similar).
On the new window that comes up, click on the Resources tab and note the first part of the I/O Range setting (check the attached screenshot). *

Once you have that, go to the folder where you unzipped the application, and open the address.txt file. Replace the contents of that file with the address you noted above (again, check the attached screenshot), and save it.

Once that's done, double click on LEDBlinker.exe to open the application (note: On Windows Vista/7 you must run it as an administrator for the first time!). You won't see anything, but you can verify that the program is running by looking for it in the Task Manager. If you have a firewall, it might warn you that the program is trying to listen on port 4012. You must allow it for the program to work (for more information check step 1).

Note: If you are getting an error when you run the application saying that it can't find mswinsck.ocx, then download it from here, and place it in the same folder as the program. It should work then (again, if you're using Windows Vista/7 you'll have to run it as an administrator for the first time).

*: If there are more than one I/O Ranges, then try them all until you find the one that works. Make sure you terminate LEDBlinker.exe via the Task Manager every time you change address.txt.

Step 4: Connect the LEDs to the Parallel Port

If you are using a printer cable, check the third picture for reference, otherwise, check the second.

Connect the longer lead* of the first LED to bit 1 (check the pictures mentioned above), and the shorter to any of the ground (GND) pins (it doesn't matter which one you choose). This will be the LED that will blink when you have a new notification.**

Connect the longer lead of the second LED to bit 6, and the shorter to any of the ground pins. This will be the LED that will blink when you have a new message.

To check if the notification LED is working click here (stop blinking).
To check if the message LED is working, click here (stop blinking).
If the LEDs aren't working, make sure that the LEDs are correctly inserted (try moving them a little), and that the LED Blinker is configured correctly and running.

*: If the leads of your LED have the same length then find the flat side of your LED. Connect the lead of that side to any of the ground pins, and the other to the bit pin.

**: It is possible to change that, but you will have to make a tiny change to the Greasemonkey script.

Step 5: Install the Greasemonkey Script

After you make sure the LEDs are working correctly, it's time to install the Greasemonkey script. The Greasemonkey script can be found here: http://userscripts.org/scripts/show/82985
Click the above link, and then click the Install button and acknowledge the warning.
After you install the script, reload Facebook.

You're done! :)

Step 6: Some Things to Keep in Mind...

LEDBlinker.exe has to be open at all times, so it might be a good idea to have it run on startup when Windows boots.

Your browser also has to be open at all times, with a Facebook tab open.

The part that detects new messages has a limitation: You must already have a chat window open and minimized with the person that sends you the message; otherwise, the new message will not be detected.

Share

    Recommendations

    • Creative Misuse Contest

      Creative Misuse Contest
    • Tiny Home Contest

      Tiny Home Contest
    • Fix It! Contest

      Fix It! Contest

    92 Discussions

    Hello, My message light don't work with the message box up and minimized. It will turn on with the link provided but not when i get a new message. Any ideas?

    hi guys I just wonder, can I use this and make it work same way ? http://www.dcs.dk/CNet/digitalcontent/ccs/6D1382DF-846B-4B5A-B64C-85D337E875AF.jpg

    5 replies

    Sorry, as far as I know, USB-to-parallel cables won't work :(

    If your computer doesn't have a parallel port, then you'll have to get a PCI-to-parallel controller (unless you are on a laptop, so you're out of luck). I use this one, but if you can't find that particular model in your country, then you can try this one, which should work, since it uses a chip similar to my card.

    any chance this can be done with a serial port (unfortunately dont have a parallel port or any open PCI ports) - Thanks!

    Yeah, Serial ports are strictly rx/tx data transmission pins. No voltages suitable for LED fun. :(

    Oh, it can be done. I don't know about this script but I've been doing it in VB by switching the DTR and RTS pins on and off to tell me if I have email. I've also been doing it with a USB to Serial adapter so I don't need an on board serial port.

    I guess the first step is to see if inpout32.dll ca handle serial port action or if it strictly does parallel ports.

    As described in step 6, there are some limitations regarding the message LED: "The part that detects new messages has a limitation: You must already have a chat window open and minimized with the person that sends you the message; otherwise, the new message will not be detected."

    Make sure that the LED is correctly connected (does the message LED start blinking when you visit http://127.0.0.1:4012/6/on ?). Also, make sure that you're using version 1.2 or newer of the script.

    oh its for chat not an actual inbox! Is there an way to modify the script so it detedts inboxes?

    Replace line 12 ("var notifCount = jc.getElementsByTagName("span")[0];") with "var notifCount = document.getElementById("jewelInnerUnseenCount");".

    Keep in mind that this will replace the new notification blink function. If you want to keep both functions, I can modify the script for you to include both functions.

    does the new code only use the one LED becasue the one still wont flash when i get a message

    Yes, it's still on LED 1.

    Some questions:
    Does the LED blink when you go to http://127.0.0.1:4012/1/on ?

    When you receive a message on Facebook, does it say that you've got an unread message at the top of the page (where the friend requests and notification buttons are)?

    Yes they both work when i test them with the link but not when i recieve a message i doesnt flash

    That's weird. Does Facebook show you that you have an unread message (the same way that it shows you that you have an unread notification)? Also, does the script work for notifications?

    ya it shows when i have an unread message and the LED notification light works fine