RPi.GPIO python module for Pine A64/A64+
#91
(04-10-2018, 03:17 AM)xalius Wrote: Are you using spidev?

I'm not sure, but I don't think so. I put my code on github here so you can see what I'm doing.

I initially took the code from Adafruit, but since this library uses a different implementation for SPI (and I2C) I modified it to work on the pine64.

Nokia5110.py is my modified library.
nokia_test2.py draws some shapes and text on the display.
nokia_clock2.py draws a very simple analog clock.
  Reply
#92
Can you pastebin the debug output you see on your console?
Come have a chat in the Pine IRC channel >>
  Reply
#93
(04-12-2018, 03:54 AM)xalius Wrote: Can you pastebin the debug output you see on your console?

sure here's a snippet of it:

Code:
tx[0]=00
tx[1]=00
tx[2]=00
tx[3]=00
tx[4]=00
tx[5]=00
tx[6]=00
tx[7]=00
tx[8]=00
tx[9]=00
tx[10]=00

It looks like whatever is being sent over SPI is also being dumped to the screen. I'd like to be able to turn this off, as it makes it difficult to find anything else that I try printing.
  Reply
#94
I endeavored to introduce it. Amid the establishment, it gived to me a blunder: 

"Python.h can't discovered record or catalog" 

I am certain to have Python introduced, in such a case that I express "python" in terminal, it returns me the adaptation

Python Training
  Reply
#95
Has there been any change in this of late? I'm trying to resurrect some old python2 code on my pine64s (and port it to python3) but installing via library by cloning the repo and doing a `sudo python setup.py install` on a fresh build of Manjaro ARM is getting me the dreaded errror:
Code:
Traceback (most recent call last):
  File "./pine64-fan-control.py", line 9, in <module>
    from RPi import GPIO as GPIO
  File "/usr/lib/python3.8/site-packages/RPi/GPIO/__init__.py", line 23, in <module>
    from RPi._GPIO import *
RuntimeError: This module can only be run on a Raspberry Pi!

Idealy I'd install it in a venv, but I'm not that far yet, and I've not installed the 'official' RPI version, so basically no idea what's going on now!
  Reply
#96
I am also interested if anyone ever got event detection (interrupts) to work and if so what modificaitons were made to the dts to enable this?
  Reply
#97
MarkHaysHarris777 Wrote:the module name should be RPi.GPIO,  not RPi._GPIO
I am looking for steps to download and install RPi.GPIO on my Pine64 A64. For some reason my original SD card and steps from 2016 are missing and my SD card is corrupt. This is possibly why it was moth-balled. BUt I am revisiting and have Armbian image installed and have HDMI and LCD, WIFI and BT working. Now I'd like to get this SBC to control a Robot. I could not get RPi.GPIO or Wiring to install
  Reply
#98
Hi all,
i've the following error when I try to install RPi.GPIO-PineA64 via command sudo python3 setup.py install:

source/py_gpio.c: In function ‘py_setup_channel’:
/usr/include/python3.9/object.h:633:41: error: expected ‘(’ before ‘PyType_HasFeature’
633 | #define PyType_FastSubclass(type, flag) PyType_HasFeature(type, flag)
| ^~~~~~~~~~~~~~~~~
/usr/include/python3.9/listobject.h:25:5: note: in expansion of macro ‘PyType_FastSubclass’
25 | PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LIST_SUBCLASS)
| ^~~~~~~~~~~~~~~~~~~
source/py_gpio.c:247:14: note: in expansion of macro ‘PyList_Check’
247 | } else if PyList_Check(chanlist) {
| ^~~~~~~~~~~~
source/py_gpio.c:247:37: error: expected ‘;’ before ‘{’ token
247 | } else if PyList_Check(chanlist) {
| ^
source/py_gpio.c: In function ‘chan_from_gpio’:
source/py_gpio.c:580:39: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
580 | if (*(pinToGpioPineA64+chan) == gpio)
| ^~
source/py_gpio.c:592:32: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
592 | if (*(*pin_to_gpio+chan) == gpio)
| ^~
source/py_gpio.c: In function ‘PyInit__GPIO’:
source/py_gpio.c:1065:4: warning: ‘PyEval_ThreadsInitialized’ is deprecated [-Wdeprecated-declarations]
1065 | if (!PyEval_ThreadsInitialized())
| ^~
In file included from /usr/include/python3.9/Python.h:145,
from source/py_gpio.c:23:
/usr/include/python3.9/ceval.h:129:36: note: declared here
129 | Py_DEPRECATED(3.9) PyAPI_FUNC(int) PyEval_ThreadsInitialized(void);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
source/py_gpio.c:1066:7: warning: ‘PyEval_InitThreads’ is deprecated [-Wdeprecated-declarations]
1066 | PyEval_InitThreads();
| ^~~~~~~~~~~~~~~~~~
In file included from /usr/include/python3.9/Python.h:145,
from source/py_gpio.c:23:
/usr/include/python3.9/ceval.h:130:37: note: declared here
130 | Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void);
| ^~~~~~~~~~~~~~~~~~
error: command '/usr/bin/aarch64-linux-gnu-gcc' failed with exit code 1

--

Can anyone helps me to find out the solution?

MT
  Reply
#99
python work well for create apps. The pandemic has boosted the demand for the digitization of services. People are increasingly looking for online courses, coaching sessions, and on-demand services. So, creating an online service marketplace platform is a profitable business idea at the present time. That’s why I decided to follow guide about how to build an online marketplace
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  fm transmitter with gpio weasel18 2 3,615 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 2,796 06-12-2019, 10:37 AM
Last Post: dkebler
Lightbulb Sample GPIO codes highlighting RPi.GPIO-PineA64 and the PI bus MarkHaysHarris777 6 8,702 06-07-2019, 12:37 AM
Last Post: tllim
Star GPIO, SPI and I2C C++ Lib databit 7 8,837 02-04-2019, 05:45 AM
Last Post: Jeff R
Information Howto: Controlling Pine64 GPIO via the filesystem (sysfs) on linux pfeerick 4 9,994 01-24-2019, 03:36 AM
Last Post: Fifth
  GPIO and SPI SamR1 20 25,132 03-15-2018, 10:32 AM
Last Post: jomoengineer
Question GPIO shockr 7 11,949 03-11-2018, 01:52 AM
Last Post: jomoengineer
  Read GPIO problem shworker 14 16,303 08-17-2017, 01:21 PM
Last Post: martinayotte
  Cross-wired Uart Ports between two Pine Boards via Cat5 Cable MarkHaysHarris777 10 12,267 11-20-2016, 04:17 AM
Last Post: pfeerick
  GPIO fiq capability joseph 3 4,739 11-10-2016, 06:07 PM
Last Post: joseph

Forum Jump:


Users browsing this thread: 1 Guest(s)