Tinker Board Forum

Full Version: Permission to use GPIO
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi everyone,

I have connected some motor to my tinker board (to be more specific a motor controller) and wanted to run this script: [LINK](https://github.com/pololu/drv8835-motor-...835_rpi.py)

It requires wiringpi in order to work and I have installed that. The problem is that whenever I try to run the example above, I get this error:
wiringPiSetup: mmap (GPIO) failed: Operation not permitted
You should describe how you issue the command.E.G.
Code:
$ sudo python example.py
Perhaps it's necessary to promote yourself as administrator
Code:
$ sudo su
(12-29-2018, 12:59 AM)Im4Tinker Wrote: [ -> ]You should describe how you issue the command.E.G.
Code:
$ sudo python example.py
Perhaps it's necessary to promote yourself as administrator
Code:
$ sudo su

I did both, under root (using su command) and under sudo. Does not work.
Some people suggest to use iomem=relaxed but no one bothered to state where exactly to paste this command.
It might give more descriptions if you'll report the exact output when you run the command. For instance the full python traceback.
Furthermore, have you noted that pigpio is needed ?
The iomem=relaxed is mentioned here. So we should see if that is set on the TB.
Code:
$ zcat /proc/config.gz |grep DEVMEM=y

One more option is to add iomem=relaxed to the kernel command line
(12-30-2018, 01:13 AM)Im4Tinker Wrote: [ -> ]It might give more descriptions if you'll report the exact output when you run the command. For instance the full python traceback.
Furthermore, have you noted that pigpio is needed ?
The iomem=relaxed is mentioned here. So we should see if that is set on the TB.
Code:
$ zcat /proc/config.gz |grep DEVMEM=y

One more option is to add iomem=relaxed to the kernel command line

Where exactly should I add iomem=relaxed?
Shall I follow this link?
https://askubuntu.com/questions/19486/ho...-parameter
I don't know exactly which OS you've installed on you TB. All is about to append a new parameter to the kernel command line.

Assuming that you installed linaro or Elar System, then it's a way to edit the /boot/extlinux/extlinux.conf and modify the append line.

In the case that you've installed Armbian/Archlinux it will take to modify /boot/boot.cmd and execute the command to remake the boot.scr (which is explained within the boot.cmd itself)
The modification should be to append the above message on the bootargs variable. The easier way is to write within the quote the additional parameter.

In all the cases, you might verify whether the command is taken by
Code:
$ cat /proc/cmdline