element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Upcoming Project: LED IP Status Indicator. How?
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 14 replies
  • Subscribers 686 subscribers
  • Views 3636 views
  • Users 0 members are here
  • raspberry
  • pi
  • raspberry_pi
  • learning
  • raspberrypi
  • rpi
  • linux
Related

Upcoming Project: LED IP Status Indicator. How?

Kuya.Marc
Kuya.Marc over 13 years ago

The Situation

 

I've configured my Broadband Internet Router to have fixed DHCP addresses for allowed devices (being used by household relatives). Before shutting off the Internet (so I can sleep), I typically ping IP addresses to see if they're connected. These are Wi-Fi connections, therefore, I can't physically see a LED light up on the router, itself.

 

The Configuration

 

I have the Raspberry Pi, Model B at 512MB, that has a physical LAN connect to my Broadband Internet Router, which also is a Wi-Fi access point. I am able to manually ping IP addresses when logging in via SSH.

 

The Project

 

Having a LED (connected via GPIO with resistor) light up when a specific IP address is active, without requiring a SSH or direct login. In other words, its a hardware version of the ping utility.

 

The Questions

 

  1. Can this be a BASH script that runs without SSH login?
  2. Can this be compiled from C source code? (I'm not used to Python, yet.)
  3. Can this run as a system service, whereas it's transparent to Raspberry Pi operations (Raspbian, XBMC, etc.)?

 

The Summary

 

I am not asking someone to write the code as I'm a veteran C programmer with 15+ years of Linux experience. I've never written code to test, and constantly retest of a specific IP address is alive or not. This project may be anywhere from extremely easy to extremely hard, but I know the Raspberry Pi can do it.

 

I will give credit to those that wish to make the initial code for me, as this project can be beneficial in many ways, such as checking if a specific device (computer, smartphone, etc.) is online or not.  Thanks in advance!

 

Kuya Marc

  • Sign in to reply
  • Cancel
  • gregoryfenton
    gregoryfenton over 9 years ago in reply to Kuya.Marc

    I just saw your post, sorry for my late reply.
    How about you open your router's attached devices page and parse it for the MAC address you are checking for?

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • rew
    rew over 9 years ago in reply to gregoryfenton

    So, while I was playing dumb and pretended that we know the IP address of the device in question, you are now pretending/assuming we know the mac address.

     

    But the problem remains a generic one. It seems we're looking for a specific device, how do we recognize that device?

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Cancel
  • jhz
    jhz over 9 years ago in reply to rew

    You both are right. First we need to know the device which is connecting with Raspberry Pi. I made RPi access point following this guide. I think we need to check the log file to get the IP of the device first and using that IP we can turn ON the LED connected with GPIO but I don't know how to do that.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • rew
    rew over 9 years ago in reply to jhz

    My ISC-DHCPD shows:

    Jan 26 13:40:14 myserver dhcpd[6871]: DHCPACK on 192.168.xxx.yy to xx:yy:zz:49:62:08 via enp4s0

    in the /var/log/syslog file when a DHCP lease is given out or extended.

     

    So with

    tail -f /var/log/syslog | awk  '/DHCPACK/ { system ("/home/pi/ip_given_out"  $8 );}'

    you can have a script (/home/pi/ip_given_out) run with as an argument the IP address that was just given out. You can save that to a file

    LASTIP_FILE=/home/pi/.lastip

    echo $1 > $LASTIP_FILE

    and then use

    the_IP=`cat $LASTIP_FILE`

    in the script I've typed (and not tested) above. (some merging/mangling still required. Left as an excercise for the reader).

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Cancel
<
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube