Page 1 of 1

Newest python-spidev broken?

Posted: Sat Jan 13, 2018 1:29 pm
by bablokb
Since updating my python-spidev recently (from 2.0~git20150907+rpi1 to 20170223~145721-1) my program reading an ADC does not work anymore. The old version was part of Jessie and also was provided by Stretch-light version 2017-09-07. After reverting manually, it worked again. I'm only using open and xfer to read the ADC channels, so I wonder what is going on.

My specific questions are:
  • is there a way to downgrade the python-spidev package with apt-get?
  • where is the source-code of these package-versions maintained? I would like to see what really changed.
  • Maybe I now have to change my code (e.g. add options or so). Any ideas? I already discovered that the new code returns the answer for the
    xfer call not only as a return value, but also overwrites the control-bytes I send which is annoying but I can work around that problem. But only changing this is not enough.
Thanks, Bernhard

Re: Newest python-spidev broken?

Posted: Sat Jan 13, 2018 3:00 pm
by DougieLawson
Try

Code: Select all

spi.max_speed_hz = 50000
with a suitable value for the frequency.

Re: Newest python-spidev broken?

Posted: Sun Jan 14, 2018 6:47 am
by bablokb
with a suitable value for the frequency.
Is this a matter of trial-and-error? Or is "max_speed_hz" another name for the throughput rate given in the datasheet?

Re: Newest python-spidev broken?

Posted: Sun Jan 14, 2018 10:18 am
by DougieLawson
bablokb wrote:
Sun Jan 14, 2018 6:47 am
with a suitable value for the frequency.
Is this a matter of trial-and-error? Or is "max_speed_hz" another name for the throughput rate given in the datasheet?
Max from the datasheet.