GPIO - documentation


#1
  1. What is the current efficiency GPIO pins? (in mA)
  2. Is supported hardware PWM? (If so, which ones?)
  3. When will the service GPIO by WiringPi?

#5

Hi!

Ad 1) 8 mA

Ad 2) Well not yet. Actually the HW PWM in Armada 38x work like that you can either disable or enable it on a GPIO. All PWM-enabled GPIO pins have the same frequency and pulse width. And you can only turn off individual pins. The intended usage is to use is to dim LEDs, which explains why it has this type of limitations.

And kernel GPIO driver nor the Python library do not support it. Sorry. But you might try to hack it yourself into the library (https://gitlab.labs.nic.cz/turris/python-turris-gpio). It should not be that complex - in HW it is only about setting GPIO blinkg registers and configuring GPIO bling counter ON duration and OFF duration registers.

Ad 3) Well, we have the above mentioned Python library. If you need C library you might want to look at source/c_gpio_omnia.c in the sources, which can be basically taken and used as the backend to access GPIOs over /dev/kmem.


#6

Thanks for replay.

So, for what is fan_ctrl.sh in TurrisOS, since does not work.

root@turris:/# fan_ctrl.sh
cut: /sys/class/hwmon/hwmon2/temp1_input: No such file or directory
cut: /sys/class/hwmon/hwmon1/temp1_input: No such file or directory
cut: /sys/class/hwmon/hwmon1/temp2_input: No such file or directory

I want to control FAN PWM 4-pin.


#7

OK, I’m install python-turris-gpio, and I have problem:

root@turris:/tmp# cat test.py
#!/usr/bin/env python2

import sys
import warnings
import time
import turris_gpio as GPIO

GPIO.setmode(GPIO.BOARD)
GPIO.cleanup()
GPIO.setup(56,GPIO.OUT)
print "GPIO56 is on"
GPIO.output(56,GPIO.HIGH)
GPIO.cleanup()
root@turris:/tmp# ./test.py
./test.py:9: RuntimeWarning: No channels have been set up yet - nothing to clean up!  Try cleaning up at the end of your program instead!
  GPIO.cleanup()
Traceback (most recent call last):
  File "./test.py", line 10, in <module>
    GPIO.setup(56,GPIO.OUT)
RuntimeError: No access to /dev/mem.  Try running as root!

EDIT 1:
No exist /dev/mem

root@turris:/# ls /dev/m*
/dev/memory_bandwidth  /dev/mmcblk0p1         /dev/mtd1
/dev/mmcblk0           /dev/mmcblk0rpmb       /dev/mtd1ro
/dev/mmcblk0boot0      /dev/mtd0              /dev/mtdblock0
/dev/mmcblk0boot1      /dev/mtd0ro            /dev/mtdblock1

/dev/mapper:
control

It was not simply to add support for software PWM Turris Omnia to the kernel?


#8

Oh yes… It has been removed for security reasons early on. It will be re-inserted in next release. In the meantime you might try to use either my testing image https://repo.turris.cz/omnia-dev-tms/medkit/omnia-medkit-201701311945-minimal.tar.gz or the nightly version - you might migrate to the version simply by means of updater using this:

uci set updater.override=override; uci set updater.override.branch=nightly; uci commit

#10

I have problem:

root@turris:~# updater.sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 83467  100 83467    0     0   120k      0 --:--:-- --:--:-- --:--:--  131k
WARN:Branch overriden to nightly
DIE:
corruption: Signature validation failed (some keys are missing)

root@turris:~# uci show updater
updater.pkglists=pkglists
updater.pkglists.lists='base' 'cacerts' 'luci-controls' 'lxc' 'nas' 'netutils' 'shell-utils' 'webcam'
updater.override=override
updater.override.disable='0'
updater.override.branch='nightly'

What am I doing wrong?


#11

Hello.
Has anything changed in terms of operating PWM Turris Omnia?

Regards
DarioX7


closed #12