I can’t seem to get the pwm for GPIO heads on the rockpi 4 to work. Note, the intent is to run the fan from penta hat, currently no operating and way too hot to be a usable product.
rockpi services won’t run:
Please note I’m running armbian, buster server. I do not wish to deviate to radxa’s older debian
As someone who is not a programmer, it seems to me the issue is with mraa not properly being translated by SWIG. Please help. I’ve been looking into this almost 2 days and I’m about to throw the rockpi 4 at a wall…
services not running
rk3399-bluetooth.service loaded failed failed Bluetooth Rockpi
rng-tools.service loaded active running rng-tools.service
rockpi-penta.service loaded failed failed Rockpi SATA Hat
service data as follows:
rockpi-penta.service - Rockpi SATA Hat
Loaded: loaded (/lib/systemd/system/rockpi-penta.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2020-06-27 21:27:49 -08; 4min 30s ago
Process: 1721 ExecStart=/usr/bin/python3 /usr/bin/rockpi-penta/main.py on (code=exited, status=1/FAILURE)
Main PID: 1721 (code=exited, status=1/FAILURE)
Jun 27 21:27:49 fileserver systemd[1]: rockpi-penta.service: Service RestartSec=100ms expired, scheduling restart.
Jun 27 21:27:49 fileserver systemd[1]: rockpi-penta.service: Scheduled restart job, restart counter is at 5.
Jun 27 21:27:49 fileserver systemd[1]: Stopped Rockpi SATA Hat.
Jun 27 21:27:49 fileserver systemd[1]: rockpi-penta.service: Start request repeated too quickly.
Jun 27 21:27:49 fileserver systemd[1]: rockpi-penta.service: Failed with result ‘exit-code’.
Jun 27 21:27:49 fileserver systemd[1]: Failed to start Rockpi SATA Hat.
system log detail as follows:
un 27 21:27:49 fileserver systemd[1]: rockpi-penta.service: Service RestartSec=100ms expired, scheduling restart.
Jun 27 21:27:49 fileserver systemd[1]: rockpi-penta.service: Scheduled restart job, restart counter is at 4.
Jun 27 21:27:49 fileserver systemd[1]: Stopped Rockpi SATA Hat.
Jun 27 21:27:49 fileserver systemd[1]: Started Rockpi SATA Hat.
Jun 27 21:27:49 fileserver libmraa[1721]: libmraa version v2.0.0-57-gf374a26 initialised by user ‘root’ with EUID 0
Jun 27 21:27:49 fileserver libmraa[1721]: gpio: platform doesn’t support chardev, falling back to sysfs
Jun 27 21:27:49 fileserver libmraa[1721]: libmraa initialised for platform ‘ROCK Pi 4’ of type 20
Jun 27 21:27:49 fileserver libmraa[1721]: pwm_init: pwm0. Failed to open export for writing: No such file or directory
Jun 27 21:27:49 fileserver python3[1721]: Traceback (most recent call last):
Jun 27 21:27:49 fileserver python3[1721]: File “/usr/bin/rockpi-penta/main.py”, line 3, in
Jun 27 21:27:49 fileserver python3[1721]: import fan
Jun 27 21:27:49 fileserver python3[1721]: File “/usr/bin/rockpi-penta/fan.py”, line 6, in
Jun 27 21:27:49 fileserver python3[1721]: pin13 = mraa.Pwm(13)
Jun 27 21:27:49 fileserver python3[1721]: File “/usr/local/lib/python3.7/dist-packages/mraa.py”, line 579, in init
Jun 27 21:27:49 fileserver python3[1721]: this = _mraa.new_Pwm(pin, owner, chipid)
Jun 27 21:27:49 fileserver python3[1721]: ValueError: Error initialising PWM on pin
Jun 27 21:27:49 fileserver systemd[1]: rockpi-penta.service: Main process exited, code=exited, status=1/FAILURE
Jun 27 21:27:49 fileserver systemd[1]: rockpi-penta.service: Failed with result ‘exit-code’.
Testing the PMW code of pwm.py yields the same:
Traceback (most recent call last):
File “./pwm.py”, line 6, in
x = mraa.Pwm(11) # pin11 pwm0
File “/usr/local/lib/python3.7/dist-packages/mraa.py”, line 579, in init
this = _mraa.new_Pwm(pin, owner, chipid)
ValueError: Error initialising PWM on pin