Scott Main [Fri, 4 Dec 2020 20:09:22 +0000 (12:09 -0800)]
Add timout loop after exporting the PWM pin.
This gives udev time to respond to the device event. Without this,
the subsequent attempts to modify pin properties will fail when
depending on udev rules to apply new user permissions.
This code is essentially copied from python-periphery, as was most
of this file (both MIT licenced). Although it appears sergeev added
this loop recently, compared to when this code was originally cloned.
Scott Main [Fri, 4 Dec 2020 20:09:22 +0000 (12:09 -0800)]
Add timout loop after exporting the PWM pin.
This gives udev time to respond to the device event. Without this,
the subsequent attempts to modify pin properties will fail when
depending on udev rules to apply new user permissions.
This code is essentially copied from python-periphery, as was most
of this file (both MIT licenced). Although it appears sergeev added
this loop recently, compared to when this code was originally cloned.
Scott Main [Fri, 4 Dec 2020 20:09:22 +0000 (12:09 -0800)]
Add timout loop after exporting the PWM pin.
This gives udev time to respond to the device event. Without this,
the subsequent attempts to modify pin properties will fail when
depending on udev rules to apply new user permissions.
This code is essentially copied from python-periphery, as was most
of this file (both MIT licenced). Although it appears sergeev added
this loop recently, compared to when this code was originally cloned.
Scott Main [Fri, 4 Dec 2020 20:09:22 +0000 (12:09 -0800)]
Add timout loop after exporting the PWM pin.
This gives udev time to respond to the device event. Without this,
the subsequent attempts to modify pin properties will fail when
depending on udev rules to apply new user permissions.
This code is essentially copied from python-periphery, as was most
of this file (both MIT licenced). Although it appears sergeev added
this loop recently, compared to when this code was originally cloned.
Scott Main [Fri, 4 Dec 2020 20:09:22 +0000 (12:09 -0800)]
Add timout loop after exporting the PWM pin.
This gives udev time to respond to the device event. Without this,
the subsequent attempts to modify pin properties will fail when
depending on udev rules to apply new user permissions.
This code is essentially copied from python-periphery, as was most
of this file (both MIT licenced). Although it appears sergeev added
this loop recently, compared to when this code was originally cloned.
Michael Lass [Fri, 30 Oct 2020 22:57:10 +0000 (23:57 +0100)]
Do not prematurely stop waiting for an answer from the message queue
When requesting data from libgpiod_pulsein via the message queue, we
always expect an answer. Prematurely stopping to wait for an answer can
only do harm. If we do not read the expected answer from the mq, it will
stay there and be read (falsely) as an answer to the following request.
Example:
* We request a pulse length by sending '^'.
* Due to high system load, libgpiod_pulsein does not send a response in
time.
* We timeout with a RuntimeError. This is verly likely ignored by the
calling code since RuntimeErrors are thrown with every invalid
reading such that the calling code _has to_ ignore these errors.
* We trigger a new sensor reading (pause-clean-resume).
* We request the length of the pulse buffer by sending 'l'.
* We read from the message queue. The response we get now is the
response to our original '^' request. Let this response be 100.
* We now assume 100 elements in the pulse buffer. This is of course
wrong and will lead to all sorts of errors.
The only reason to timeout on an expected answer is probably during
initialization when we are not sure if the communication via message
queue has been successfully set up. In all other cases we should just
block and never timeout.
kent [Sat, 15 Aug 2020 20:11:48 +0000 (13:11 -0700)]
i2c function verified. Documentation updated.
i2c functions using I2C0_SCL, I2C0_SDA or I2C1_SCL, I2C1_SDA as SCl, SDA.
USART pin removed. According to documentation embeded linux should use pyserial not busio!
pylint give a message for i2cPorts as not conforming to Capitalization standard, but this the same for all the other examples and the way the other programs expect it.
dnssoftware [Wed, 27 May 2020 16:43:40 +0000 (02:43 +1000)]
Update pin.py
On beaglebone black, the spi devices are spidev0.0, spidev0.1, spidev1.0, spidev1.1 and the existing code tries to open up spidev2.0 when using SPI1. Renumbering fixes this.