inkyPhat Crontab

This InkyPhat is a really cool device. However, Crontab won’t run it for some reason. I have it currently set up to run every 1 minute and at reboot. This is just to test it out, I’ll eventually set it to every 10 minutes. This is sudo’s crontab:

*/1 * * * * python /home/pi/Pimoroni/inkyphat/examples/

@reboot python /home/pi/Pimoroni/inkyphat/examples/

I suspect crontab doesn’t know how to look in the /resources file for the backdrop.png file because if I run from my shell:

$ sudo python /home/pi/Pimoroni/inkyphat/examples/

it tells me:

IOError: [Errno 2] No such file or directory: ‘resources/backdrop.png’

Can anyone help me correct this please?

You’re right. The issue is one of context, crontab is not running in the directory /home/pi/Pimoroni/inkyphat/examples/, and so the Python script can’t find any of its resources (in this case, backdrop.png)

You need to ensure the script is run in the right directory, which you can do by preparing a simple launcher script to run it:

nano /home/pi/ >


cd /home/pi/Pimoroni/inkyphat/examples/

Then your crontab entry should be */1 * * * * bash /home/pi/

1 Like