Re: Fitlet and GPIO access
Posted: Thu Jan 07, 2016 4:27 pm
Hi,
I've finally gotten some time to play with the Fitlet and gpio under Mint and am having a few difficulties.
In the documentation for the fitlet SDK under Linux, under the usage section, there is a line
"modprobe fch_gpio"
This fails, saying "module fch-gpio not found". I checked the other documentation and presume it is a typo, as "modprobe gpio_fch" seems to work and loads the module as required. So far, so good, however I can't seem to set the direction of the I/O pin and it acts like an input at all times.
The line "Echo 89 > /sys/class/gpio/export" seems to work ok, as is confirmed by the creation of a directory named gpio89 on the path /sys/class/gpio
The line "echo out > /sys/class/gpio/gpio89/direction" appears to work, as the file direction does now hold the value "out". This can also be set to "in" successfully as well as "low" and "high" but no other values, AFAIK.
At this point there is 3.3v on pin gpio89, echoing 1 or 0 to /sys/class/gpio/gpio89/value makes no difference to this value.
The pin does seem to work as an input with a pull-up, however. If I leave it alone, then the command
"cat /sys/class/gpio/gpio89/value" yields a 1 whereas if I connect the pin down to ground then
"cat /sys/class/gpio/gpio89/value" yields a 0 - which is as required.
So in summary, the problem seems to be with the implementation of the direction command and communicating this information to the gpio chip.
I'd be grateful for any help you can give
regards
dave Langstaff
I've finally gotten some time to play with the Fitlet and gpio under Mint and am having a few difficulties.
In the documentation for the fitlet SDK under Linux, under the usage section, there is a line
"modprobe fch_gpio"
This fails, saying "module fch-gpio not found". I checked the other documentation and presume it is a typo, as "modprobe gpio_fch" seems to work and loads the module as required. So far, so good, however I can't seem to set the direction of the I/O pin and it acts like an input at all times.
The line "Echo 89 > /sys/class/gpio/export" seems to work ok, as is confirmed by the creation of a directory named gpio89 on the path /sys/class/gpio
The line "echo out > /sys/class/gpio/gpio89/direction" appears to work, as the file direction does now hold the value "out". This can also be set to "in" successfully as well as "low" and "high" but no other values, AFAIK.
At this point there is 3.3v on pin gpio89, echoing 1 or 0 to /sys/class/gpio/gpio89/value makes no difference to this value.
The pin does seem to work as an input with a pull-up, however. If I leave it alone, then the command
"cat /sys/class/gpio/gpio89/value" yields a 1 whereas if I connect the pin down to ground then
"cat /sys/class/gpio/gpio89/value" yields a 0 - which is as required.
So in summary, the problem seems to be with the implementation of the direction command and communicating this information to the gpio chip.
I'd be grateful for any help you can give
regards
dave Langstaff