pi-gpio | A simple node.js-based GPIO helper for the Raspberry Pi
kandi X-RAY | pi-gpio Summary
kandi X-RAY | pi-gpio Summary
This couldn’t have been more confusing. Raspberry Pi’s physical pins are not laid out in any particular logical order. Most of them are given the names of the pins of the Broadcom chip it uses (BCM2835). There isn’t even a logical relationship between the physical layout of the Raspberry Pi pin header and the Broadcom chip’s pinout. The OS recognizes the names of the Broadcom chip and has nothing to do with the physical pin layout on the Pi. To add to the fun, the specs for the Broadcom chip are nearly impossible to get!.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Sanitize option strings
- Handle command response .
- Normalize a direction .
- Sanitize the pin number
- Check if a number is a number .
- Nop . js
pi-gpio Key Features
pi-gpio Examples and Code Snippets
Community Discussions
Trending Discussions on pi-gpio
QUESTION
I try to rebuild an electron app but I got this error regarding the epoll installation.
...ANSWER
Answered 2021-Nov-09 at 06:01I have a same problem too, but i am using a serialport not epoll.
So, I think the cause of this problem is electron modules not the native module.
QUESTION
I'm trying to enable pull-ups on Raspberry pi and the easier way to do it it's executing raspi-gpio set
, the problem is that for some reason I can't do it with call_usermodehelper
(it doesn't throw any error, but it does nothing).
As an alternative I've been looking at raspi-gpio source code and I have a functional C code that enables pull-ups (this code prints the GPIO CPU and enable GPIO26's pull-ups):
...ANSWER
Answered 2021-Oct-03 at 22:51Mmap was accessing to "/dev/mem", after some more questions I've found that that file connects user-space with kernel-space (and LKM it's on kernel space, so no need to access to it). In this case, ioremap
does the job.
Here's the final code:
QUESTION
I know similar question had already been answered, and I studied dilligently. I believe, I have tried nearly all possible combinations, without success:
...ANSWER
Answered 2021-Jun-04 at 16:14You're running commands in the container as appuser, while the device files are owned by root with various group permissions and no world access (crw-rw---
and crw-r-----
). Those groups may look off because /etc/groups
inside the container won't match the host, and what passes through to the container is the uid/gid, not the user/group name. The app itself appears to expect you are running as root and even suggests sudo. That sudo is not on the docker command itself (though you may need that if your user on the host is not a member of the docker group) but on the process started inside the container:
QUESTION
I got a bit stuck debugging a yocto build problem. I encountered this while updating from yocto warrior (2.7) to yocto dunfell (3.1) The build fails during the building of the rootfs, all steps before seem to work:
...ANSWER
Answered 2021-Feb-17 at 07:55I found it out myself (interesting how asking questions helps you thinking...):
The issue was in the systemd
recipe itself and related to the systemd-compat-units
recipe. I was able to fix it with this in my layer's recipes-core/systemd/systemd_%.bbappend
:
QUESTION
I'm trying to connect 6 mcp2515 over spi0. I have adapted an SPI overlay to add the neccesary chip select lines. My new SPI overlay looks like this:
...ANSWER
Answered 2021-Jan-14 at 08:15It's working!!! As i mentioned in my first post only one board was working (can1 spi0.4), after i rechecked the other two non working boards i discovered that one had a hardware damage causing the other board not to work as well. As a final conclusion my spi and mcp overlays are fully functional!
Regards Antmar
QUESTION
I am attempting to write a driver for an OV2680 camera sensor. I want to turn on some GPIO pins as one of the steps in its ->probe()
function. Those GpioIo() pins are declared in the DSDT tables like so (for a device upon which the OV2680 is dependent; see full DSDT table:
ANSWER
Answered 2020-Aug-12 at 14:18(Gathering the answer based on comments I have given earlier)
For sake of the clarification I have to say, that from your DSDT we can get the following information. There are 3 groups of PMICs, i.e. DSCx
, CLPx
and PMIx
. I believe they are based on the model, like Desktop, Laptop, 2-in-1. And in each case all PMICs in the same group have different _UID
. From the provided output of the grep -H 15 ...
we have only 2 out of 10 enumerated with the instances INT3472:08 and INT3472:09 (exactly two last defined in DSDT). And they are PMIx
, you may check this by grep -H . /sys/bus/acpi/devices/INT3472:*/path
.
Your interest is the PMI1
which consumes three GPIO lines from Intel GPIO driver, i.e. pins 121, 122 and 143 (you may decode them as Community #2, Group #5 or GPP_F, relative to the group pins 1, 2 and 23, this may help you to understand _INI
method that touches these lines via other methods in DSDT), and provides 3 + 7 = 10 pins according to its driver.
Now to the code. The _DEP
ACPI method is used solely for linking power resources, and Linux kernel has other means how to hijack resources from other device, because what you are trying to do is to use the resource which is not related to the device you are creating driver for.
The method is to find device by ACPI HID:
QUESTION
In developing an application using Qt5 with Python, you are generally event driven. No sweat, works like a charm. However, there are instances when you need to poll the status of some hardware GPIO (i.e. a button push), or get some information from a serial port, or something like a gpsd daemon.
What is the preferred way to handle this? Via a QTimer, say, running every 50 msec? Or is there some other method I haven't found? Is it better to set up a trigger on a GPIO pi (https://www.ics.com/blog/control-raspberry-pi-gpio-pins-python) or is there any conflict with the Qt5 Gui?
Basic documentation doesn't look horrible, and I can follow some examples, of course, but didn't know if there was a better/canonical/more Pythonic method.
https://doc.qt.io/qtforpython/PySide2/QtCore/QTimer.html
https://python-catalin.blogspot.com/2019/08/python-qt5-qtimer-class.html
...ANSWER
Answered 2020-Jul-14 at 17:07I don't think there is a pythonic solution, not because you can't use python but because python is not relevant to the topic. And there is no canonical solution either, everything will depend on the application.
From my experience I have found it much easier to reuse libraries that handle GPIOs like Rpi.GPIO or gpiozero. These libraries have as a strategy to create threads where the state of the pins is monitored, so you cannot use the callbacks directly to update the GUI but you must implement wrapper(see this for example).
trivial example:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install pi-gpio
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page