[PIGET] Watch your Raspberry Pi with 2b3l

[PIGET] Watch your Raspberry Pi with 2b3l

This project is unfinished !
There are probably:

  • bugs
  • things that doesn’t works
  • missing documentation
  • hazardous spell checking.

If you want to contribute , you can post your suggestions, ideas, corrections :

All comments are validated manually, so don’t worry if they don’t show up instantly.


We are going to use 2 buttons and 3 leds to:

  • See if someone have access to our terminal (red led)
  • See if file sharing is active (yellow led)
  • See if someone is currently using file sharing (green led)
  • Button 1 : Restart our Raspberry Pi
  • Button 2 : Enable / Disable file sharing

(note : if you find other ideas on how to use 3 leds and 2 buttons, you can post them on http://github.com/pigetnet/ledsButtons/issues )

3D model

2b3l en filaments phosporescent
2b3l made with phosphorescent filament

Link to 3D model:

(note : This model was not properly test, if you have another 3D model idea, feel free to share them)

(note : We will explain how to solder the components here)


Cables must make a 3×2 rectangle on the Raspberry Pi at the end.


  • Red led : 21
  • Yellow led : 20
  • Green led: 16
  • Button 1 : 26
  • Button 2 :19


You can also display the pinout by typing /do/ledsButtons/pinout


To install this module, type in your terminal :

/pi/install ledsButtons

(note : Beware of the uppercase, I will modify this module to be only in lowercase later)

This will install led , buttons and supervisor.


Two modes are available :

Test Mode : This mode will check if everything is correctly wired:

Type :


Bouton 1Turn on all leds
Bouton 2 : Turn off all leds

Security Mode : This mode will check if something is connected to your Raspberry Pi


Red led :  Terminal is currently use(ssh)
Yellow led : File sharing is currently use (samba)
Green led : File sharing is enabled (samba)
Button 1 : Blink all the led , and shutdown the Raspberry Pi
Button 2 : Enable / Disable file sharing (samba)

Create your own mode :

Check this script: https://github.com/pigetnet/ledsButtons/blob/master/scripts/ssh/check
If you want to create your own services, you need to learn how to clone a module here


Security Mode
  • Enable security (sambaCheck sshCheck)
  • Disable security
    /do/ledsButtons/securityOff (sambaCheck sshCheck)
  • Restart security
  • Display button 1 state
  • Display button 2 state
  • Display buttons and leds state
  • Set up buttons
All leds
  • On
  • Off
  • Blink
  • Fade in / Fade out
Red led
  • On
  • Off
  • Blink
  • Fade in / Fade out
  • Display state
Yellow led
  • On
  • Off
  • Blink
  • Display state
Green led
  • On
  • Off
  • Blink
  • Display state


(note : this module is undocumented and needed to be check properly: http://github.com/pigetnet/supervisor/issues)
(note : This part will be a tutorial on his own)

The supervisor module can be use to transform a software or a script as a service.
You only need to make your scripts/software run in an infinite loop.

To create a service, type:
/do/supervisor/create service_name script
/do/supervisor/create sambaCheck /do/ledsButtons/scripts/samba/check

To display a list of services:

To display log of a service:
/do/supervisor/log service_name
/do/supervisor/log service_name

To remove a service:
/do/supervisor/remove service_name
/do/supervisor/remove sambaCheck

To restart a service:

To stop a service:

To start a service:

Comments are closed.