Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting intf. GPIO, I2C, SPI...? #35

Closed
Nic2012 opened this issue Sep 10, 2017 · 7 comments

Comments

Projects
None yet
2 participants
@Nic2012
Copy link

commented Sep 10, 2017

Hi,
this 64bit distro is working really fine, fast boot, wlan, eth, installing favourite apps no problem.
But is GPIO already included? Trying to install wiringPi and runs returns the following:

pi@pi64:~/wiringPi$ gpio readall
Oops: Unable to determine board revision from /proc/cpuinfo
 -> No "Hardware" line
 ->  You'd best google the error to find out why.
pi@pi64:~/wiringPi$ cat /proc/cpuinfo
processor       : 0
BogoMIPS        : 38.40
Features        : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 1
BogoMIPS        : 38.40
Features        : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 2
BogoMIPS        : 38.40
Features        : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 3
BogoMIPS        : 38.40
Features        : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

Can I fix it or is that a matter of the Kernel?

Thank you for y effort to realize this project,
best reagards,
Nic

@bamarni

This comment has been minimized.

Copy link
Owner

commented Sep 11, 2017

Hi,

I don't think this necessarily means there is something wrong with the kernel, it seems that on arm64 cpuinfo provides less information : raspberrypi/linux#2110.

One could either submit a patch to the kernel so that arm64 also exposes this field or get wiringPI to have a detect mechanism that'd work for both archs (assuming they want to support arm64).

@Nic2012

This comment has been minimized.

Copy link
Author

commented Sep 11, 2017

You mean, in general without that patch we cannot use GPIO on pi64? Its matter by raspberrypi.org to provide a patch?
And whats about the other interfaces like: I2c, SPI are already working on pi64?

@bamarni

This comment has been minimized.

Copy link
Owner

commented Sep 11, 2017

I wouldn't say you cannot use GPIO on pi64, it's just the command line tool from WiringPI which is not compatible, there are probably either library you can use for programming or other cli tools.

I haven't tested it yet so I cannot provide more pointers at the moment sorry.

@Nic2012

This comment has been minimized.

Copy link
Author

commented Sep 12, 2017

At least as root GPIO works in bash on low level:

echo "23" > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio23/direction
echo "1" > /sys/class/gpio/gpio23/value
...

and can be verified by LED.

Python 2.7.13 already on distro:
After apt-get install python-pip, pip install RPi.GPIO RPi.GPIO-0.6.3 is existing but with a test, python returns

Traceback (most recent call last):
  File "gpio23.py", line 1, in <module>
    import RPi.GPIO as GPIO
  File "/usr/local/lib/python2.7/dist-packages/RPi/GPIO/__init__.py", line 23, in <module>
    from RPi._GPIO import *
RuntimeError: This module can only be run on a Raspberry Pi!

Which is propably same thing as with WiringPi?

@Nic2012

This comment has been minimized.

Copy link
Author

commented Oct 8, 2017

At least i2c is working fine, preconditions:

nano /etc/modules >>
i2c-bcm2708
i2c_dev
nano /boot/config.txt >>
dtparam=i2c_arm=on
dtparam=i2s=on
dtparam=spi=on
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install i2c-tools
sudo i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

Finally, a real-time clock DS3231 runs without problems.

@Nic2012

This comment has been minimized.

Copy link
Author

commented Oct 22, 2017

Well, I was successful to compile with modifications in original source code in RPi.GPIO-0.6.3 and Adafruit_Python_SSD1306, that finally this libs can be used in pi64. So in Python and RPi.GPIO i can now control gpios and with the Adafruit stuff I can access an oled display.

But this costs me a lot of research and trouble and waste of time. Mostly caused by this annoying "./proc/cpuinfo" issue. It would be much more easier when the kernel has the right patches.

@Nic2012

This comment has been minimized.

Copy link
Author

commented Oct 23, 2017

If nodejs v6 is installed, the only npm package that works for GPIO is so far https://www.npmjs.com/package/onoff. The others depending more or less on exact platform version/release etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.