balanga
Posts: 118
Joined: Sat Aug 23, 2014 6:56 pm

spi.py

Fri Nov 02, 2018 2:17 pm

I have two files called spi.py:-

/usr/local/lib/python3.5/dist-packages/pifacecommon/spi.py
/usr/lib/python3/dist-packages/pifacecommon/spi.py

How do I tell which is being used when I enable the SPI kernel module using raspi-config? and how would I go about enabling the other one?

User avatar
DougieLawson
Posts: 39837
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: spi.py

Fri Nov 02, 2018 5:05 pm

In all sane cases you'll find that /usr/local/... trumps /usr/...

There is an assumption that python2 & python3 are sane (we know that to be false because of the V2 versus V3 pain).
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

balanga
Posts: 118
Joined: Sat Aug 23, 2014 6:56 pm

Re: spi.py

Tue Nov 06, 2018 1:27 pm

To enable SPI I have to run raspi-config then select 5 - Interface Options -> P4 SPI.

What does this actually do? ie which files are actually affected?

balanga
Posts: 118
Joined: Sat Aug 23, 2014 6:56 pm

Re: spi.py

Tue Nov 06, 2018 9:27 pm

After some rummaging around it appears that setting SPI on consists of uncommenting

#dtparam=spi=on

in

/boot/config.txt

Can anyone confirm?

Presumably a reboot is required to make it effective...

DirkS
Posts: 10417
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: spi.py

Wed Nov 07, 2018 9:39 am

balanga wrote:
Tue Nov 06, 2018 9:27 pm
After some rummaging around it appears that setting SPI on consists of uncommenting

#dtparam=spi=on

in

/boot/config.txt

Can anyone confirm?

Presumably a reboot is required to make it effective...
Correct

Return to “Automation, sensing and robotics”