Chapter 21:

E-SECRETARY

Automated Customer Entry System with Raspberry Pi

This guide explains setting up an automated customer entry system using two Raspberry Pis - one in the lobby (Pi1) and another in the office (Pi2). This system uses Python scripts, GPIO pins, and SSH for remote interactions.

Lobby Raspberry Pi (Pi1) Setup

1. Install Pygame and Prepare Audio Files:

  • Install Pygame for audio playback:

    pip3 install pygame

  • Create a text file to store numbers and prepare audio files in an "audio/" directory.

  • Use xvfb-run -a python3 welcome.py to run the welcome script without a display.

2. Script for Customer Interaction:

  • The welcome2.py script handles GPIO pin setup, audio playback, and SSH communication to Pi2.

  • It includes logic for playing different audio files and updating a 7-segment display based on the customer number.

  • Utilizes Paramiko for SSH to remotely trigger actions on Pi2.

  • The script also includes a segment to increment and update the customer number.

Key Components of the Script:

  • GPIO pin setup for input (button press) and output (7-segment display).

  • Playing audio based on the current customer number.

  • Sending an SSH command to Pi2 to trigger a guest entry script.

Office Raspberry Pi (Pi2) Setup

1. Script for Office Notification (comein.py):

  • This script waits for a signal from Pi1.

  • When triggered, it executes the guestenter.py script on Pi1 via SSH.

2. Remote Execution:

  • Uses Paramiko for SSH to remotely execute the guest entry script on Pi1.

  • The script waits for a button press to initiate the SSH command.

Important Notes:

  • Ensure both Raspberry Pis are correctly networked and can communicate via SSH.

  • The audio files should be pre-recorded and placed in the specified directory.

  • The 7-segment display logic in the scripts corresponds to specific GPIO pins; adjust according to your setup.

  • Test each script individually to ensure proper functionality before integrating them.

  • SSH keys must be properly set up for secure and hassle-free communication between the two Raspberry Pis.

This system provides an innovative and interactive way to manage customer entries, enhancing the visitor experience with automated greetings and instructions.