hhk7734 / odroid.gpio Goto Github PK
View Code? Open in Web Editor NEWOdroid.GPIO
License: MIT License
Odroid.GPIO
License: MIT License
hey, do you have any plans to support PWM?
thanks for the library..
On latest version of Ubuntu Mate as of okt 2022, package does not install correctly on Odroid N2+ with pip, or setup.py
error: subprocess-exited-with-error
ERROR: failed building wheel for Odroid.GPIO
error: command '/usr/bin/aarch64-linux-gnu-gcc' failed with exit code 1
python setup.py bdist_wheel did not run succesfully
usage of dash-seperated 'long-description' will not be supported in future version, must change to underscore
I am using a module which relies on the Rpi.GPIO. This module uses the VERSION variable which is defined in the Rpi.GPIO library here https://sourceforge.net/p/raspberry-gpio-python/code/ci/default/tree/RPi/GPIO/__init__.py
It also would be great if the major and minor version from this and the Rpi library would be the same as some modules rely on specific versions and check try to check them.
I have a new Odroid C4 and some python code that was originally written for Raspberry Pi. I changed import RPi.GPIO
to import Odroid.GPIO
and followed the installation requirements from the readme.
I get stuck on on ImportError: libwiringPi.so.3: cannot open shared object file: No such file or directory.
Any suggestions?
(venv) ebo@odroid:~/tools/network-anomaly-api/relay_API/API$ sudo add-apt-repository -y ppa:hardkernel/ppa \
> && sudo apt update
Hit:1 http://ports.ubuntu.com/ubuntu-ports focal InRelease
Hit:2 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease
Hit:3 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease
Hit:4 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease
Hit:5 http://ppa.launchpad.net/hardkernel/ppa/ubuntu bionic InRelease
Hit:6 http://ppa.launchpad.net/hardkernel/ppa/ubuntu focal InRelease
Hit:7 http://archive.canonical.com/ubuntu focal InRelease
Get:8 http://deb.odroid.in/c4 focal InRelease [1714 B]
Fetched 1714 B in 2s (745 B/s)
Reading package lists... Done
Hit:1 http://archive.canonical.com/ubuntu focal InRelease
Hit:2 http://ports.ubuntu.com/ubuntu-ports focal InRelease
Hit:3 http://ppa.launchpad.net/hardkernel/ppa/ubuntu bionic InRelease
Hit:4 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease
Hit:5 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease
Hit:6 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease
Hit:7 http://ppa.launchpad.net/hardkernel/ppa/ubuntu focal InRelease
Get:8 http://deb.odroid.in/c4 focal InRelease [1714 B]
Fetched 1714 B in 3s (579 B/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
4 packages can be upgraded. Run 'apt list --upgradable' to see them.
(venv) ebo@odroid:~/tools/network-anomaly-api/relay_API/API$ sudo apt install -y python3 python3-dev python3-pip \
> odroid-wiringpi libwiringpi-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3 is already the newest version (3.8.2-0ubuntu2).
python3-dev is already the newest version (3.8.2-0ubuntu2).
python3-pip is already the newest version (20.0.2-5ubuntu1.8).
libwiringpi-dev is already the newest version (3.14.5-0~202301030313~ubuntu20.04.1).
odroid-wiringpi is already the newest version (3.14.5-0~202301030313~ubuntu20.04.1).
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
(venv) ebo@odroid:~/tools/network-anomaly-api/relay_API/API$ python3 -m pip install -U --user pip Odroid.GPIO
ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv.
(venv) ebo@odroid:~/tools/network-anomaly-api/relay_API/API$ python3 -m pip install -U pip Odroid.GPIO
Requirement already satisfied: pip in /home/ebo/tools/network-anomaly-api/relay_API/venv/lib/python3.8/site-packages (23.0.1)
Requirement already satisfied: Odroid.GPIO in /home/ebo/tools/network-anomaly-api/relay_API/venv/lib/python3.8/site-packages (0.1.4)
Requirement already satisfied: pybind11>=2.4 in /home/ebo/tools/network-anomaly-api/relay_API/venv/lib/python3.8/site-packages (from Odroid.GPIO) (2.10.3)
(venv) ebo@odroid:~/tools/network-anomaly-api/relay_API/API$ cd ..
(venv) ebo@odroid:~/tools/network-anomaly-api/relay_API$ python3 app.py
Traceback (most recent call last):
File "app.py", line 25, in <module>
from web_app import app
File "/home/ebo/tools/network-anomaly-api/relay_API/web_app/__init__.py", line 53, in <module>
from web_app.relay.routes import relay_blueprint
File "/home/ebo/tools/network-anomaly-api/relay_API/web_app/relay/routes.py", line 15, in <module>
from API.relay import Relay
File "/home/ebo/tools/network-anomaly-api/relay_API/API/relay.py", line 6, in <module>
import Odroid.GPIO as GPIO
File "/home/ebo/tools/network-anomaly-api/relay_API/venv/lib/python3.8/site-packages/Odroid/GPIO/__init__.py", line 29, in <module>
from Odroid._GPIO import *
ImportError: libwiringPi.so.3: cannot open shared object file: No such file or directory
(venv) ebo@odroid:~/tools/network-anomaly-api/relay_API$
def output(channels, values):
'''
Output to a GPIO channel or list of channels.
channels - Pin number or list(pin number) according to the set mode.
values - value or list(value).
- value can be 0/1 or False/True or LOW/HIGH.
'''
if not isinstance(channels, (list, tuple)):
channels = [channels]
if isinstance(values, (int, bool)):
values = [values for _ in range(len(channels))]
if len(values) != len(channels):
raise RuntimeError("The number of channels and values are different")
for i in channels:
digitalWrite(i, values[i])
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.