RPi.GPIO python module for Pine A64/A64+
#71
(02-18-2017, 06:49 AM)JasperBrown Wrote: - pip(ed) the Rasp.Pi GPIO

Whit the above line, you seem to try to compile RaspberryPi version, not the A64.
  Reply
#72
no one has mentioned the script,
create_gpio_user_permissions.py
is there some criteria by which this script should [or should not] be run?
it seems like maybe it should be run but maybe it is called from another install script? thanks.
  Reply
#73
(02-18-2017, 12:16 PM)martinayotte Wrote: Whit the above line, you seem to try to compile RaspberryPi version, not the A64.


After
Code:
sudo python setup.py install
had not worked..i tried the install.txt from git..

You just had ran the setup.py and it worked?
  Reply
#74
After getting the git, yes, only "python setup.py install" is required.
  Reply
#75
Which system image did you use?
  Reply
#76
(02-21-2017, 04:43 AM)JasperBrown Wrote: Which system image did you use?

If you meet us on irc chat we can help you in real time;  often its faster with less confusion.

Big Grin

see below for chat room details
marcushh777    Cool

please join us for a chat @  irc.pine64.xyz:6667   or ssl  irc.pine64.xyz:6697

( I regret that I am not able to respond to personal messages;  let's meet on irc! )
  Reply
#77
(02-21-2017, 04:43 AM)JasperBrown Wrote: Which system image did you use?

Armbian Mainline 4.10, but months ago, I was using longsleep and it was working there too.
  Reply
#78
Has anybody used this library for I2C?

I got my first I2C device recently, this temp/pressure sensor. I tried reading it from an ESP8266 and an arduino first and didn't have any luck, so I decided to give it a try on the pine64. It shows up on i2cdetect, and if I run "sudo i2cdump twi1 0x76" it dumps a bunch of data, so I'm guessing it's wired up right.

I saw in the notes in github that this library has I2C "borrowed from pyA20", so a little googling found me some documentation here (you have to scroll a bit to get to the I2C info).

From that info, I put together this python script:
Code:
#!/usr/bin/env python3
from RPi import I2C

I2C.init("/dev/twi1")
I2C.open(0x76)

# set power mode to forced
I2C.write([0xF4,0x01])
sleep(1)

# dump data
I2C.write([0xF7])
value = I2C.read(1)
print(value)

I2C.close()
quit()

Now when I run this (as root) using python3, I get this error:
Code:
Traceback (most recent call last):
 File "./bmp280_readonce.py", line 2, in <module>
   from RPi import I2C
 File "/usr/lib64/python3.4/site-packages/RPi/I2C/__init__.py", line 4, in <module>
   from RPi._I2C import *
ImportError: dynamic module does not define init function (PyInit__I2C)

I tried changing the first line to use python2 instead of python3, and then I get this error instead:
Code:
Traceback (most recent call last):
 File "./bmp280_readonce.py", line 5, in <module>
   I2C.open(0x76)
IOError: [Errno 2] No such file or directory

Any idea what I'm doing wrong?
  Reply
#79
Are you using the library from https://github.com/swkim01/RPi.GPIO-PineA64 ?
I've verified it with both python2.7 and python 3.5 under Armbian, and it is working with both.
  Reply
#80
Yes, that's the one. So far I've just used it to blink LED's. This is my first attempt at trying to work with I2C. I wonder if there's some sample code that I could look at somewhere.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  fm transmitter with gpio weasel18 2 4,751 09-10-2019, 04:28 AM
Last Post: desai_amogh
  How to use dts or other setup to declare gpio pin Interrupt (e.g. a button)? dkebler 1 3,546 06-12-2019, 10:37 AM
Last Post: dkebler
Lightbulb Sample GPIO codes highlighting RPi.GPIO-PineA64 and the PI bus MarkHaysHarris777 6 10,955 06-07-2019, 12:37 AM
Last Post: tllim
Star GPIO, SPI and I2C C++ Lib databit 7 11,042 02-04-2019, 05:45 AM
Last Post: Jeff R
Information Howto: Controlling Pine64 GPIO via the filesystem (sysfs) on linux pfeerick 4 11,753 01-24-2019, 03:36 AM
Last Post: Fifth
  GPIO and SPI SamR1 20 31,155 03-15-2018, 10:32 AM
Last Post: jomoengineer
Question GPIO shockr 7 14,579 03-11-2018, 01:52 AM
Last Post: jomoengineer
  Read GPIO problem shworker 14 20,930 08-17-2017, 01:21 PM
Last Post: martinayotte
  Cross-wired Uart Ports between two Pine Boards via Cat5 Cable MarkHaysHarris777 10 15,725 11-20-2016, 04:17 AM
Last Post: pfeerick
  GPIO fiq capability joseph 3 6,007 11-10-2016, 06:07 PM
Last Post: joseph

Forum Jump:


Users browsing this thread: 12 Guest(s)