Difference between revisions of "PoE HAT (B)"

From Waveshare Wiki
Jump to: navigation, search
Line 23: Line 23:
 
*Network standard: 802.3af PoE
 
*Network standard: 802.3af PoE
 
*Dimensions: 56.5mm x 65mm
 
*Dimensions: 56.5mm x 65mm
 +
*OLED control interface: I2C
 
*OLED size: 0.91inch
 
*OLED size: 0.91inch
 
*OLED pixels: 128x32
 
*OLED pixels: 128x32
 
*OLED driver: SSD1306
 
*OLED driver: SSD1306
 
*OLED display color: White
 
*OLED display color: White
 +
*OLED viewing angle: greater than 160°
 +
*GPIO expansion interface: I2C
 +
*GPIO expansion chip: PCF8574
 +
 
==Examples==
 
==Examples==
 
===Hardware connection===
 
===Hardware connection===

Revision as of 03:18, 28 March 2022

PoE HAT (B)
PoE HAT (B)

Power Over Ethernet HAT (Type B) For Raspberry Pi 3B+/4B, 802.3af Power-Sourcing Equipment Required
{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

Instroduction

This Power Over Ethernet HAT (Type B) is designed for Raspberry Pi 3B+/4B, it supports 802.3af Power-Sourcing equipment for PoE function.

Features

  • Standard Raspberry Pi 40PIN GPIO header, supports Raspberry Pi 3B+/4B
  • PoE (Power Over Ethernet) capability,802.3af-compliant
  • Fully isolated switched-mode power supply (SMPS)
  • 0.91" OLED, for monitoring processor temperature, IP address, and fan status in real-time
  • Onboard cooling fan, allows auto running on powerup OR programmable control, configured by the switch
  • Integrates PCF8574 IO expander for I2C bus, providing pin P0 for directly fan control, and more spare IO pin

Specifications

  • PoE Power input: 37V ~ 57V DC in
  • PoE Power output: 5V 2.5A DC out
  • Network standard: 802.3af PoE
  • Dimensions: 56.5mm x 65mm
  • OLED control interface: I2C
  • OLED size: 0.91inch
  • OLED pixels: 128x32
  • OLED driver: SSD1306
  • OLED display color: White
  • OLED viewing angle: greater than 160°
  • GPIO expansion interface: I2C
  • GPIO expansion chip: PCF8574

Examples

Hardware connection

You need to connect the PoE HAT to Raspberry Pi as picture
PoE-HAT-B-details-5.jpg

Enable I2C Interface

I2C interface is required for the OLED display, you need to first enable the i2c interface for properly work.
Open a terminal of Raspberry Pi and configure:

sudo raspi-config
Interfacing Options -> I2C -> Yes

TSL25911 Light Sensor-5.png

Libraries installation

Libraries Installation for RPi

PS: If you are using the system of the Bullseye branch, you need to change "apt-get" to "apt". The system of the Bullseye branch only supports Python3.

First of all you make sure to use which language C or python Open the terminal of Raspberry Pi and install libraries as guides below

Install Library

If you use the bookworm system, you can only use lgpio library, bcm2835 and wiringPi can't be installed and used.

BCM2835

#Open the Raspberry Pi terminal and run the following command
wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.71.tar.gz
tar zxvf bcm2835-1.71.tar.gz 
cd bcm2835-1.71/
sudo ./configure && sudo make && sudo make check && sudo make install
# For more, you can refer to the official website at: http://www.airspayce.com/mikem/bcm2835/

WiringPi

#Open the Raspberry Pi terminal and run the following command
cd
sudo apt-get install wiringpi
#For Raspberry Pi systems after May 2019 (earlier than that can be executed without), an upgrade may be required:
wget https://project-downloads.drogon.net/wiringpi-latest.deb
sudo dpkg -i wiringpi-latest.deb
gpio -v
# Run gpio -v and version 2.52 will appear, if it doesn't it means there was an installation error

# Bullseye branch system using the following command:
git clone https://github.com/WiringPi/WiringPi
cd WiringPi
. /build
gpio -v
# Run gpio -v and version 2.70 will appear, if it doesn't it means there was an installation error

lgpio

#Open the Raspberry Pi terminal and run the following command
wget https://github.com/joan2937/lg/archive/master.zip
unzip master.zip
cd lg-master
sudo make install

# You can refer to the official website for more: https://github.com/gpiozero/lg

Install Python Library

#python2
sudo apt-get update
sudo apt-get install python-pip
sudo pip install RPi.GPIO
sudo apt-get install python-smbus
#python3
sudo apt-get update
sudo apt-get install python3-pip
sudo pip install RPi.GPIO
sudo apt-get install python3-smbus

Download example

Open a terminal and download with commands below.

cd
wget https://www.waveshare.com/w/upload/8/8b/PoE_HAT_B_code.zip
unzip -o  PoE_HAT_B_code.zip -d ./PoE_HAT_B_code
sudo chmod 777 -R PoE_HAT_B_code

Run the example

Open a terminal and run the example

C
cd ~/PoE_HAT_B_code/c/
make clean 
make
sudo ./main
python
cd ~/PoE_HAT_B_code/python/examples
sudo python main.py

Set the temperature threshold

C
sudo nano ~/PoE_HAT_B_code/c/examples/main.c

Modify the last parameter of POE_HAT_Display() and save

python
sudo nano ~/PoE_HAT_B_code/python/examples/main.py

Modify the last parameter of POE.POE_HAT_Display() and save

Auto-run

Modify rc.local file

sudo nano /etc/rc.local
  • Add the following line in front of the line exit 0
fi
sudo /home/pi/PoE_HAT_B_code/c/main &
#exit 0

or

fi
sudo python3 /home/pi/PoE_HAT_B_code/python/examples/main.py &
#exit 0

Resources

Documents

Example

Third Party Examples

Support

Support

If you require technical support, please go to the Support page and open a ticket.