Starting SPI automatically


#1

Hi,

Is there a way to get spiService to run at boot? If I have start: auto I will get the following error:

Jan 30 07:37:35 | supervisor[1201]/supervisor T=main | app.c GetDevID() 644 | Could not get file info for ‘/dev/spidev0.0’. No such file or directory.
Jan 30 07:37:35 | supervisor[1201]/supervisor T=main | app.c SetCfgDevicePermissions() 754 | Failed to set permissions (rw) for app ‘spiService’ on device ‘/dev/spidev0.0’.

But if I start it manually it works. I have added spidev to /etc/modules. Looks like it does not load /etc/modules in time? Thanks!


SPI after startup
#2

Hi,

How about adding a timer to delay for your program to start the SPI?


#3

Hi @jyijyi,

Thanks for the answer. I was looking for a way to do this, but could not find anything. Is there a simple way to add a delay?


#4

Hi,

How about adding sleep() in your code?


#5

Maybe I am wrong, but I was thinking more on the line of it having something to do with the watchdog for the process since it is the supervisor that is throwing the error. I do not think a sleep() function in the spiService app would make a difference, but I will try it out once I get a chance.

Maybe someone can explain why I am wrong.


#6

Yes, as I suspected the sleep function does not help here. Any more ideas on what I could try, I am out of ideas.