Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

PWM for PoE Hat

Featured Replies

Hey there, had anyone any success enabling PWM to control a PoE hat [1]?

I tried a few overlays but no luck.

 

```

rock-3a-worker-1:overlay:# cat /boot/armbianEnv.txt
verbosity=1
bootlogo=false
overlay_prefix=rk35xx
fdtfile=rockchip/rk3568-rock-3a.dtb
rootdev=UUID=f0751d3c-c5c2-4ced-a989-772c2ad130a4
rootfstype=ext4
overlays=w1-gpio i2c7 i2c8
extraboardargs=nvme_core.default_ps_max_latency_us=0
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u

```

 

I also built mraa with the following:

 

```

IMRAA=ON FTDI4222=OFF BUILDCPP=ON BUILDTESTS=ON BUILDSWIG=ON USBPLAT=ON ONEWIRE=ON INSTALLTOOLS=ON BUILDSWIGPYTHON=ON \
      bash -c "./scripts/run-cmake.sh && make -Cbuild install"

```

but it won't show anything on gpio or pwm

```

mraa-gpio list
No Pins

```

Any other ideas there?

[1] Pinout ->  https://wiki.radxa.com/ROCKPI_23W_PoE_HAT 

  • Author

I found the answer on radxa's forum [1] by amazingfate.

In order to make it, you need to enable amazingfate's overlay and then control the pwm, which can be done like this:

 

wget https://raw.githubusercontent.com/radxa/kernel/stable-4.19-rock3/arch/arm64/boot/dts/rockchip/overlay/rk3568-pwm8-m0-fan.dts
armbian-add-overlay rk3568-pwm8-m0-fan.dts

sudo cat > /etc/systemd/system/fan-control.service <<EOF
[Service]
RemainAfterExit=true
ExecStart=bash -exc '\
echo 0 > /sys/devices/platform/fe6f0000.pwm/pwm/pwmchip*/export || true; \
echo 10000 > /sys/devices/platform/fe6f0000.pwm/pwm/pwmchip*/pwm0/period && \
echo 5000 > /sys/devices/platform/fe6f0000.pwm/pwm/pwmchip*/pwm0/duty_cycle && \
echo normal > /sys/devices/platform/fe6f0000.pwm/pwm/pwmchip*/pwm0/polarity && \
echo 1 > /sys/devices/platform/fe6f0000.pwm/pwm/pwmchip*/pwm0/enable'
ExecStop=bash -exc 'echo 0 > /sys/devices/platform/fe6f0000.pwm/pwm/pwmchip*/pwm0/enable'

[Install]
WantedBy=multi-user.target
EOF

systemctl enable fan-control.service

reboot # so the overlay gets applied and the service start

 

[1] https://forum.radxa.com/t/armbian-for-rock-3a-unofficial-build-with-mainline-kernel/9434/45

On 7/3/2022 at 4:46 PM, jaysonsantos said:

I found the answer on radxa's forum [1] by amazingfate.

In order to make it, you need to enable amazingfate's overlay and then control the pwm, which can be done like this:

 

wget https://raw.githubusercontent.com/radxa/kernel/stable-4.19-rock3/arch/arm64/boot/dts/rockchip/overlay/rk3568-pwm8-m0-fan.dts
armbian-add-overlay rk3568-pwm8-m0-fan.dts

sudo cat > /etc/systemd/system/fan-control.service <<EOF
[Service]
RemainAfterExit=true
ExecStart=bash -exc '\
echo 0 > /sys/devices/platform/fe6f0000.pwm/pwm/pwmchip*/export || true; \
echo 10000 > /sys/devices/platform/fe6f0000.pwm/pwm/pwmchip*/pwm0/period && \
echo 5000 > /sys/devices/platform/fe6f0000.pwm/pwm/pwmchip*/pwm0/duty_cycle && \
echo normal > /sys/devices/platform/fe6f0000.pwm/pwm/pwmchip*/pwm0/polarity && \
echo 1 > /sys/devices/platform/fe6f0000.pwm/pwm/pwmchip*/pwm0/enable'
ExecStop=bash -exc 'echo 0 > /sys/devices/platform/fe6f0000.pwm/pwm/pwmchip*/pwm0/enable'

[Install]
WantedBy=multi-user.target
EOF

systemctl enable fan-control.service

reboot # so the overlay gets applied and the service start

 

[1] https://forum.radxa.com/t/armbian-for-rock-3a-unofficial-build-with-mainline-kernel/9434/45

You have missed out the replace active with default in the dts file :)

Edited by oneofthemany
found the issue and wanted to inform the author

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.