Adafruit Industries, Essential service and business: NYC – Executive Order 202.6 - Read more. Accepting essential orders - here's how.
0

automating "config-pin P9.30 spi"
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

automating "config-pin P9.30 spi"

by rifo on Thu Aug 25, 2016 1:44 pm

Hello,

I am trying to automate configuring spi pins. I need to issue below commands

config-pin P9.28 spi
config-pin P9.29 spi
config-pin P9.30 spi
config-pin P9.31 spi

When I do it manually, everything works fine but when I try to automate it. This doesn't work.

I have tried adding it to

* /etc/rc.local
* systemd
* monit

for some reason, this doesn't work. Can you please tell me where I should place these commands?

thanks
rifo
rifo
 
Posts: 42
Joined: Sun Jan 26, 2014 3:07 pm

Re: automating "config-pin P9.30 spi"

by rifo on Fri Aug 26, 2016 11:37 am

Hello,

I have done some more trials. It seems that I need to insert a delay of 7 seconds in the application itself before issuing the "config-pin P9.30 spi" command from the application itself via "system" command
without the delay, P9.30 pin stays in default mode.
rifo
 
Posts: 42
Joined: Sun Jan 26, 2014 3:07 pm

Re: automating "config-pin P9.30 spi"

by drewfustini on Fri Aug 26, 2016 11:43 pm

Thanks for the insight.

For startup, creating a new systemd unit file should work:
systemd: Writing and Enabling a Service

drewfustini
 
Posts: 920
Joined: Sat Dec 26, 2015 1:19 pm

Re: automating "config-pin P9.30 spi"

by rifo on Sat Aug 27, 2016 3:05 am

Hello Drew,

I didn't know that systemd can generate a delay in startup before launching the application. This would be much better for me.
Thanks for tip. I'll look that up.
rifo
 
Posts: 42
Joined: Sun Jan 26, 2014 3:07 pm

Please be positive and constructive with your questions and comments.