Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 3873

Beginners • Re: LED works when running from IDE, but not cronjob

$
0
0
  1. Why are you importing time if you're not using it?
  2. We don't know if your code is, in fact, running. It looks simple enough but you never know...
    Try changing your crontab entry to the following, let it run, then check the log file for errors.

    Code:

    */1 * * * * python3 /home/pi/redon.py 2>>/home/pi/redon.log
I imported time because I was going to have the LED do a few on/off states before blinking rapidly. The issue was resolved after 'rpdom' suggested that the code was complete and releasing the GPIO. I added a sleep then a blink and all is good now.

Fair enough. The above crontab change is a useful debugging aid in any case.

Statistics: Posted by thagrol — Tue Nov 12, 2024 11:16 am



Viewing all articles
Browse latest Browse all 3873

Trending Articles