Hey everyone! I’m a middle school technology teacher and I have been running a explorer hat pro unit. I’ve had a lot of success so far but have a strange issue. The culminating project in my class is having students attach two motors to the explorer hat and then control it with alligator clips and attach it to some sort of chassis that they make to make a remote controlled buggy. I’ve had no issues with getting the motors to run, my issue is that I am trying to get the programs they write to run on a reboot so that they can just plug in a power stick and operate the buggies without the monitor, keyboard, etc.
I have tried getting the code to run at reboot using crontab however, when the raspberry pi reboots the motors move for a split second but then otherwise it does not seem like the program is running. I’m using 3B+ pis And I’m also happy to send pictures etc. I’m eagerly awaiting help!
I would suggest that you don’t start a program at boot from crontab. This technology was outdated in the beginning of the 1980’s. So although it might still work it is nothing you want to do.
Current mainstream is systemd. Of course you have a slight learning curve, but there are many tutorials and examples, especially if you only want to do something simple. The big advantage is that you have full control of the user and the environment of whatever you start at boot and this should help to solve your real problem. It might be possible that you tweak crontab in a way that also fixes your problem, but I think it is a waste of time trying to find workarounds for pre-historic software artifacts.
So maybe you post how you currently start your programs manually (after login) from a keyboard and then we will see how you can come up with a simple systemd-definition file which executes your script at startup.