[PIGET] Watch your Raspberry Pi with 2b3l

[PIGET] Watch your Raspberry Pi with 2b3l

This project is unfinished !

Idea

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:
https://github.com/pigetnet/ledsButtons/tree/master/3d

(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)

Wiring

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

2b3l_bb

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

https://pinout.xyz/

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

Installation

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.

Usage

Two modes are available :

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

Type :

/do/ledsButtons/test

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

/do/ledsButtons/security

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

Commandes

Security Mode
Buttons
All leds
Red led
Yellow led
Green led

Supervisor

(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:
/do/supervisor/list

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:
/do/supervisor/restart

To stop a service:
/do/supervisor/stop

To start a service:
/do/supervisor/start

Comments are closed.