PAGING SYSTEM FOR INPATIENTS

A wifi service to patient’s devices can serve a button to paging nursing staff in their station with a push of a button on the served page, which triggers a physical pin in raspberry pi which can be observed as a LED or a buzzer.


Sudo apt install git

Sudo clone git://git.dragon.net/wiringPi or sudo apt install wiringpi

Sudo apt install apache2 -y

sudo apt-get install php libapache2-mod-php -y

Sudo rm index.html

Sudo nano index.php

<html>

<head>

<meta name="viewport" content="width=device-width" />

<title>Raspberry Pi WiFi Controlled LED</title>

</head>

<body>

<center><h1>Control LED using Raspberry Pi Webserver</h1>

<form method="get" action="index.php">

<input type="submit" style = "font-size: 14 pt" value="OFF" name="off">

<input type="submit" style = "font-size: 14 pt" value="ON" name="on">

</form>​​​

</center>

<?php

shell_exec("/usr/local/bin/gpio -g mode 27 out");

if(isset($_GET['off']))

{

echo "LED is off";

shell_exec("/usr/local/bin/gpio -g write 27 0");

}

else if(isset($_GET['on']))

{

echo "LED is on";

shell_exec("/usr/local/bin/gpio -g write 27 1");

}

?>

</body>

</html>


WSA: https://github.com/WSA-Community/WSAGAScript

WSL Desktop: https://www.makeuseof.com/tag/linux-desktop-windows-subsystem/


PHP to control GPIO pins (LED, buzzer…)

This to allow patients in different rooms ask for help by pressing the appropriate button on their served web page.

Check wiringpi is installed:

Gpio -v

Gpio readall

Test using shell:

Gpio -g write 17 1

Sudo usermod -a -G gpio www-data // add php user to group gpio

Set permission by:

Sudo visudo

Add www-data ALL=NOPASSWD: ALL

Code:

<form action=”php.php”>

<input type=”submit” name=”ON” value=”Turn On” />

</form>


PHP to control GPIO pins (LED, buzzer…)

This to allow patients in different rooms ask for help by pressing the appropriate button on their served web page.

Check wiringpi is installed:

Gpio -v

Gpio readall

Test using shell:

Gpio -g write 17 1

Sudo usermod -a -G gpio www-data // add php user to group gpio

Set permission by:

Sudo visudo

Add www-data ALL=NOPASSWD: ALL

Code:

<form action=”php.php”>

<input type=”submit” name=”ON” value=”Turn On” />

</form>


NOTIFYING VIA LOBBY STATION

Office visit notification can be automated by asking the customer to press a button and get notified in your office. This can be done by a push button attached to Raspberry pi server located in the lobby, when pushed down, the office pi buzzer is turned on via the server wifi that the latter is connected to.

The client pi remote GPIO settings needs to be enabled via raspi-config

import RPi.GPIO as GPIO

from time import sleep

from gpiozero import LED

from gpiozero.pins.pigpio import PiGPIOFactory


factory = PiGPIOFactory(host='192.168.215.201')


red = LED(22,pin_factory=factory)

buz = LED(23,pin_factory=factory)


#Set warnings off (optional)

GPIO.setwarnings(False)

GPIO.setmode(GPIO.BOARD)

#Set Button and LED pins

Button = 32

led = 22

#Setup Button and LED

GPIO.setup(Button,GPIO.IN,pull_up_down=GPIO.PUD_UP)

GPIO.setup(led,GPIO.OUT)

#flag = 0


while True:

button_state = GPIO.input(Button)

print(button_state)

if button_state == 0:

GPIO.output(led,GPIO.HIGH)

red.on()

buz.on()

else:

GPIO.output(led,GPIO.LOW)

red.off()

buz.off()

sleep(1)