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: 36128
Joined: Sun Jun 16, 2013 11:19 pm
Location: 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: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

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: 9941
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”