Raspberry Pi auto water changer + ATO

  • Thread starter Thread starter Sam Rowe
  • Start date Start date
  • Tagged users Tagged users None
This is what I added to the crontab file

Code:
@reboot python /home/pi/Water/Changer.py &

Its strange if in terminal I cd into my directory Water and then run 'python Changer.py' it runs without any problems, If I'm out of the Water directory and run at 'python /home/pi/Water/Changer.py' it throws up the statement
Code:
Traceback (most recent call last):
  File "/home/pi/Water/Changer.py", line 83, in <module>
    paper.Initial()
  File "/home/pi/Water/epaper.py", line 30, in Initial
    frame_black = epd.get_frame_buffer(Image.open('black1.bmp'))
  File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 2312, in open
    fp = builtins.open(filename, "rb")
IOError: [Errno 2] No such file or directory: 'black1.bmp'
but if I run 'sudo python /home/pi/Water/Changer.py' I get
Code:
Traceback (most recent call last):
  File "/home/pi/Water/Changer.py", line 5, in <module>
    import schedule
ImportError: No module named schedule

I can't figure out whats wrong?
Pip install schedule?
 
Pip install schedule?
In all honesty @Ranjib I cannot remember what I had done to sort it, the new program I'm writing I have been running in python3 as that's where the tutorials for flask have came from. once running I'll be looking at playing with the HTML files with bootstrap to add bits like server sent events and a better layout / more professional look but just mainly looking to get the system working. spent around 3 days on it so far with the new build that's in GitHub, a lot of trial and error to get parts to run.
 
In all honesty @Ranjib I cannot remember what I had done to sort it, the new program I'm writing I have been running in python3 as that's where the tutorials for flask have came from. once running I'll be looking at playing with the HTML files with bootstrap to add bits like server sent events and a better layout / more professional look but just mainly looking to get the system working. spent around 3 days on it so far with the new build that's in GitHub, a lot of trial and error to get parts to run.
So far im only running it in an open terminal SSH connection so may encounter a similar issue when looking to get the program to run on boot, for now I'm happy to get the code fully running and working and then babysteps from there.
 

TOP 10 Trending Threads

ARE YOU READY TO CONFESS TO CRAZIEST, DUMBEST, FUNNIEST THING YOU’VE EVER DONE IN REEFING?

  • Yeah, I'll confess! (Share your story in the comments!)

    Votes: 26 55.3%
  • Nah, I'll keep mine a secret...(Don't be like that, share with the class!)

    Votes: 21 44.7%
Back
Top
Home
Post thread…
Market
What's new