EP-0077: Difference between revisions

From 52Pi Wiki
Jump to navigation Jump to search
m (Yoyojacky moved page Power Button For RPi SKU: EP-0077 to EP-0077)
 
(30 intermediate revisions by 2 users not shown)
Line 13: Line 13:
<br style="clear:both;">
<br style="clear:both;">
----
----
==New Version V2.22==
==New Version V2.02==
{|
{|
|[[File:Rmt01.jpg|left|300px]]
|[[File:Rmt01.jpg|left|300px]]
Line 35: Line 35:
[https://github.com/geeekpi/RPB-HAT  Driver installation for Version 2.02]  
[https://github.com/geeekpi/RPB-HAT  Driver installation for Version 2.02]  
----
----
==Compatibility List==
* Compatibility
{| class="wikitable" style="text-align: center;"
|-
!Platform  !! Version 2.02 !! Version 1.22 !! Notes
|-
|Raspberry Pi 4 Model B  ||Need wiringPi version 2.46|| Need wiringPi version 2.46 || √
|-
|Raspberry Pi 3 Model A Plus ||Need wiringPi version 2.46|| Need wiringPi version 2.46 || √
|-
|Raspberry Pi 3 Model B Plus ||Need wiringPi version 2.46|| Need wiringPi version 2.46 || √
|-
|Raspberry Pi zero  || √|| √||
|-
| Raspberry Pi zero W  || √||√||
|-
|Raspberry Pi 3 Model B ||√||√||
|-
|Raspberry Pi 2 Model B| ||√||√||
|-
|Raspberry Pi Model B+ ||×||×|||
|-
|Raspberry Pi Model A+||×||×|||
|-
|Raspberry Pi Model A||×||×|||
|-
|}


==Features==
==Features==
Line 90: Line 117:
<pre>NOTE: Please make sure that your Raspberry Pi  have  5V/2.5A  power supply with this module!!!</pre>
<pre>NOTE: Please make sure that your Raspberry Pi  have  5V/2.5A  power supply with this module!!!</pre>
----
----
==How  to update wiringPi's Version==
Currently, the version of wiringPi  is 2.44,  but it is not work properly on raspberry pi 3 B plus, so you need to update the wiringPi's version according to this manual.
*1. Check current version of GPIO:
<pre> gpio -v </pre><br>
*2. Typing this command on a Terminal in raspberry Pi 3 B plus.
<pre> gpio  readall</pre><br>
you will see this:
<pre>pi@raspberrypi:~ $ gpio readall
Oops - unable to determine board type... model: 13
</pre>
you need to update wiringPi by following steps: <br>
*3. Get the source from github.
<pre>sudo apt-get install wiringpi
cd  wiringPi/
sudo ./build
</pre>
After that, you can typing : "gpio -v" to check whether  the version is updated.<br>
If you've got this message means it was successfully.
<pre>
gpio version: 2.46
Copyright (c) 2012-2018 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty
Raspberry Pi Details:
  Type: Pi 3+, Revision: 03, Memory: 1024MB, Maker: Sony
  * Device tree is enabled.
  *--> Raspberry Pi 3 Model B Plus Rev 1.3
  * This Raspberry Pi supports user-level GPIO access.
</pre>


==How to wire it up==
==How to wire it up==
Line 101: Line 158:


==How to set it up==
==How to set it up==
<font color=red>NOTE: This method is only for Old version 1.04 </font><br>
*1. Remove your TF card and connect it to your PC or laptop with TF card adapter.
*1. Remove your TF card and connect it to your PC or laptop with TF card adapter.
*2. Modify /boot/config.txt file as following, for example, my pi is Raspberry Pi 3 model B:
*2. Modify /boot/config.txt file as following:
 
==Raspberry Pi 4 model B==
<pre>
dtoverlay=power-off,gpiopin=26
dtoverlay=pi3-act-led,gpio=21
</pre>
==Raspberry Pi 3 model B==
<pre>
<pre>
device_tree=bcm2710-rpi-3-b.dtb
device_tree=bcm2710-rpi-3-b.dtb
Line 109: Line 172:
dtoverlay=pi3-act-led,gpio=21
dtoverlay=pi3-act-led,gpio=21
</pre>
</pre>
<pre>NOTE:  device_tree=PARAMETER  is depends on your Raspberry Pi's model.  
 
==Raspberry Pi 2 Model B==
<pre>
device_tree=bcm2709-rpi-2-b.dtb
dtoverlay=power-off,gpiopin=26
dtoverlay=pi3-act-led,gpio=21
</pre>
==Raspberry Pi zero / zero W==
<pre>
device_tree=bcm2708-rpi-0-w.dtb
dtoverlay=power-off,gpiopin=26
dtoverlay=pi3-act-led,gpio=21
</pre>
more info please access this link:</pre>
more info please access this link:</pre>
[Device Tree| https://www.raspberrypi.org/documentation/configuration/device-tree.md]<br>
[Device Tree| https://www.raspberrypi.org/documentation/configuration/device-tree.md]<br>
Line 115: Line 190:
! Raspberry Pi model !! Device_Tree Info
! Raspberry Pi model !! Device_Tree Info
|-  
|-  
|Raspberry Pi B : || device_tree=bcm2708-rpi-b.dtb
|Raspberry Pi 3 B+: || device_tree=bcm2710-rpi-3-b-plus.dtb
|-
|Raspberry Pi 3 B: || device_tree=bcm2710-rpi-3-b.dtb
|-
|Raspberry pi zero /zero w: || device_tree=bcm2708-rpi-0-w.dtb
|-
|-
|Raspberry Pi 2B : || device_tree=bcm2709-rpi-2-b.dtb   
|Raspberry Pi 2B : || device_tree=bcm2709-rpi-2-b.dtb   
|-
|Raspberry Pi B : || device_tree=bcm2708-rpi-b.dtb
|-
|-
|Raspberry Pi B+ :|| device_tree=bcm2708-rpi-b-plus.dtb   
|Raspberry Pi B+ :|| device_tree=bcm2708-rpi-b-plus.dtb   
|-
|Raspberry Pi 3 B: || device_tree=bcm2710-rpi-3-b.dtb
|}
|}
*3. Install the library of wiringPi and Download shell script to check the GPIO pin's status:
*3. Install the library of wiringPi and Download shell script to check the GPIO pin's status:
Line 146: Line 225:
Have fun.
Have fun.
----
----
==How to install driver for Version 2.02 ==
==How to install driver for Version 2.02 ==
* Install package's for script.check if wiringPi package has been installed, if not, install it.<br>
* One-Step Automated Install
<pre>sudo apt-get -y update</pre>
For those who want to get started quickly and conveniently, you may install Driver using the following command for your Raspberry Pi:
<pre>sudo apt-get -y install wiringPi</pre>
<pre>curl -sSL git.io/vpqzF | bash </pre>
* Just download it from https://github.com/geeekpi/RPB.git by:
<br>
<pre>cd ~
<font color=red>Notice:Linux Command Case sensitivity</font>
git clone https://github.com/geeekpi/RPB.git
* Feature:
cd RPB/
**Power on/off/reboot by remote controller.
sudo cp -Rvf remoteswitch /etc/init.d/
**Power on/off/reboot by keys.
sudo chmod +x /etc/init.d/remoteswitch
**fit for IR remote Power button Version 2.02 and later
sudo chkconfig --add remoteswitch
<br>
sudo chkconfig --level 2345 remoteswitch on
Reboot your raspberry and try to press the power button, reboot button and test it.<br>
</pre>
 
Reboot your raspberry and try to press the power button, reboot button and test it.
==FAQ==
* Q: Cloud it be used on Pi4B?
  A: Yes.
* Q: The version2.02 is same with the 1.22?
  A: Yes.


==Video Tutorial==
==Video Tutorial==

Latest revision as of 19:21, 27 August 2021

Power Button For RPi

Old Version V1.22

8182.JPG
IMG 8183.JPG



Pwr2.jpg
Pwr3.JPG



New Version V2.02

Rmt01.jpg
Rmt02.jpg



Rmt03.jpg
Rmt04.jpg


Description

As everyone at some point will recognize the Raspberry Pi doesn't include any kind of shutdown button.
So the only way to power it off is by unplugging it from the power supply.
To make sure you get no corruption of your data files on the SD card you should shutdown the Raspberry before powering it off.
So the whole procedure can be a bit annoying especially if you want to use the Raspberry as some kind of embedded PC .
e.g. a media server or an internet radio.
NOTE:There is new version: V2.02, using this method to setup the driver, Link is under below:
Driver installation for Version 2.02


Compatibility List

  • Compatibility
Platform Version 2.02 Version 1.22 Notes
Raspberry Pi 4 Model B Need wiringPi version 2.46 Need wiringPi version 2.46
Raspberry Pi 3 Model A Plus Need wiringPi version 2.46 Need wiringPi version 2.46
Raspberry Pi 3 Model B Plus Need wiringPi version 2.46 Need wiringPi version 2.46
Raspberry Pi zero
Raspberry Pi zero W
Raspberry Pi 3 Model B
Raspberry Pi Model B+ × ×
Raspberry Pi Model A+ × ×
Raspberry Pi Model A × ×

Features

Power Button provides a small circuit that includes the features:

  • Sending a shutdown signal to the Raspberry if the Shutdown Button is pressed
  • Waiting for the Raspberry to shut down
  • Powering off the Raspberry after save shutdown
  • Powering on the Raspberry after the Button is pressed again
  • LED light indicating the current state: On / Shutdown / Off
  • Easy to setup

ChangeLog

  • Updated MCU
  • Changed Layout
  • Changed Button
  • Optimized code

Dimension

Parameter Value
Dimension 65mm x 30 mm x 20mm
Weight 22.72g

Package Includes

  • Power Button For RPi Module x1
  • IR Remote controller ( without battery) x1

Mechanical Drawing

  • V1.22 and V2.02 has the same Mechanical Drawing, means that they has the same size.
Pwr6.jpg



Parameters

There is a chart which can show you the function of the GPIO Pin definition of this board:

Function BCM RPi
Disk Status 21 Pin 40
Shut Down 24 Pin 18
PWR Status 26 Pin 37
GND N/A Pin 6/9/14/20/25/30/34/39
5V 5V Pin 2/4
NOTE: Please make sure that your Raspberry Pi  have  5V/2.5A  power supply with this module!!!

How to update wiringPi's Version

Currently, the version of wiringPi is 2.44, but it is not work properly on raspberry pi 3 B plus, so you need to update the wiringPi's version according to this manual.

  • 1. Check current version of GPIO:
 gpio -v 


  • 2. Typing this command on a Terminal in raspberry Pi 3 B plus.
 gpio  readall


you will see this:

pi@raspberrypi:~ $ gpio readall
Oops - unable to determine board type... model: 13

you need to update wiringPi by following steps:

  • 3. Get the source from github.
sudo apt-get install wiringpi
cd  wiringPi/
sudo ./build

After that, you can typing : "gpio -v" to check whether the version is updated.
If you've got this message means it was successfully.

gpio version: 2.46
Copyright (c) 2012-2018 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty

Raspberry Pi Details:
  Type: Pi 3+, Revision: 03, Memory: 1024MB, Maker: Sony
  * Device tree is enabled.
  *--> Raspberry Pi 3 Model B Plus Rev 1.3
  * This Raspberry Pi supports user-level GPIO access.

How to wire it up

Do NOT connect your power supply to Raspberry Pi,  Please connect it to Power Button directly.
Pwr4.JPG
Pwr5.JPG



How to set it up

  • 1. Remove your TF card and connect it to your PC or laptop with TF card adapter.
  • 2. Modify /boot/config.txt file as following:

Raspberry Pi 4 model B

dtoverlay=power-off,gpiopin=26
dtoverlay=pi3-act-led,gpio=21

Raspberry Pi 3 model B

device_tree=bcm2710-rpi-3-b.dtb
dtoverlay=power-off,gpiopin=26
dtoverlay=pi3-act-led,gpio=21

Raspberry Pi 2 Model B

device_tree=bcm2709-rpi-2-b.dtb
dtoverlay=power-off,gpiopin=26
dtoverlay=pi3-act-led,gpio=21

Raspberry Pi zero / zero W

device_tree=bcm2708-rpi-0-w.dtb
dtoverlay=power-off,gpiopin=26
dtoverlay=pi3-act-led,gpio=21

more info please access this link:

[Device Tree| https://www.raspberrypi.org/documentation/configuration/device-tree.md]

Raspberry Pi model Device_Tree Info
Raspberry Pi 3 B+: device_tree=bcm2710-rpi-3-b-plus.dtb
Raspberry Pi 3 B: device_tree=bcm2710-rpi-3-b.dtb
Raspberry pi zero /zero w: device_tree=bcm2708-rpi-0-w.dtb
Raspberry Pi 2B : device_tree=bcm2709-rpi-2-b.dtb
Raspberry Pi B : device_tree=bcm2708-rpi-b.dtb
Raspberry Pi B+ : device_tree=bcm2708-rpi-b-plus.dtb
  • 3. Install the library of wiringPi and Download shell script to check the GPIO pin's status:
sudo apt-get install -y wiringPi
cd ~
git clone https://github.com/yoyojacky/powerbutton.git
cd ~/powerbutton
sudo  mv   ~/powerbutton/gpioshutdown    /etc/init.d/
sudo  chmod   +x   /etc/init.d/gpioshutdown
  • 4. Edit the initialized file in /etc/rc.local :
sudo  nano   /etc/rc.local

Add those three lines before exit 0

sudo /etc/init.d/gpioshutdown &      #Thanks for Steven Porter's kindly advise. (update the "&" mark at the end of command)
gpio mode 25 out
gpio write 25 1

After edit this file, Press "Ctrl + X" to save this file and Press "Y“ to save it.

  • 5. Reboot your Raspberry Pi and plug power button on your RPi, press the button to test.

Have fun.


How to install driver for Version 2.02

  • One-Step Automated Install

For those who want to get started quickly and conveniently, you may install Driver using the following command for your Raspberry Pi:

curl -sSL git.io/vpqzF | bash 


Notice:Linux Command Case sensitivity

  • Feature:
    • Power on/off/reboot by remote controller.
    • Power on/off/reboot by keys.
    • fit for IR remote Power button Version 2.02 and later


Reboot your raspberry and try to press the power button, reboot button and test it.

FAQ

  • Q: Cloud it be used on Pi4B?
 A: Yes.
  • Q: The version2.02 is same with the 1.22?
 A: Yes.

Video Tutorial

Youtube.jpeg


Please follow the link: [ Raspberry Pi 3B with Ir remote power button and pi supply & USB HUB | https://youtu.be/BhEoGZshiPM ]