|
https://openwrt.org/toh/ubiquiti/edgerouter_x_er-x_ka 要单独编译进去这个驱动还要设置好gpio才能在新建接口中看到设备。
- The routers can supply PoE on the LAN ports. This is controlled by a PCA9555A with GPIO 0..4.
- For documentation purposes - in order to get this running you need, already integrated into OpenWrt:
- install “kmod-i2c-gpio-custom” (pulls gpio and algo-bitbang)
- install “kmod-gpio-pca953x”
- “insmod i2c-gpio-custom bus0=0,3,4”
- “echo pca9555 0x25 >/sys/bus/i2c/devices/i2c-0/new_device”
- export the GPIOs 496..500 (/sys/class/gpio/)
- After reboot you need to run insmod and the echo line below to allow on/off functionality.
- Turn on POE all ports except eth0(WAN)
- #eth0 WAN port
- echo "out" > /sys/class/gpio/gpio496/direction
- echo "0" > /sys/class/gpio/gpio496/value
- #eth1
- echo "out" > /sys/class/gpio/gpio497/direction
- echo "1" > /sys/class/gpio/gpio497/value
- #eth2
- echo "out" > /sys/class/gpio/gpio498/direction
- echo "1" > /sys/class/gpio/gpio498/value
- #eth3
- echo "499" > /sys/class/gpio/export
- echo "out" > /sys/class/gpio/gpio499/direction
- echo "1" > /sys/class/gpio/gpio499/value
- #eth4
- echo "out" > /sys/class/gpio/gpio500/direction
- echo "1" > /sys/class/gpio/gpio500/value
- #turn all POE off
- echo "0" > /sys/class/gpio/gpio496/value
- echo "0" > /sys/class/gpio/gpio497/value
- echo "0" > /sys/class/gpio/gpio498/value
- echo "0" > /sys/class/gpio/gpio499/value
- echo "0" > /sys/class/gpio/gpio500/value
- !!! Update: While using kernel 5.4.33 on an ubnt-erx-sfp I noticed that the gpio numbers had changed as the pca9555 is attributed another gpio base number which is 400. So 496 .. 500 become 400 .. 404.
- Switch Ports (for VLANs)
- ER-X & ER-X SFP:
- Port Switch port Label
- WAN 0 eth0
- LAN 1 1 eth1
- LAN 2 2 eth2
- LAN 3 3 eth3
- LAN 4 4 eth4
- N/A 5 eth5 (Only on SFP)
- CPU (eth0) 6
复制代码 |
|