Raspberry Pi auto water changer + ATO

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
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?
 
OP
OP
Sam Rowe

Sam Rowe

Community Member
View Badges
Joined
Dec 10, 2017
Messages
38
Reaction score
47
Location
Plymouth
Rating - 0%
0   0   0
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.
 
OP
OP
Sam Rowe

Sam Rowe

Community Member
View Badges
Joined
Dec 10, 2017
Messages
38
Reaction score
47
Location
Plymouth
Rating - 0%
0   0   0
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.
 

Just grow it: Have you ever added CO2 to your reef tank?

  • I currently use a CO2 with my reef tank.

    Votes: 6 7.4%
  • I don’t currently use CO2 with my reef tank, but I have in the past.

    Votes: 3 3.7%
  • I have never used CO2 with my reef tank, but I plan to in the future.

    Votes: 5 6.2%
  • I have never used CO2 with my reef tank and have no plans to in the future.

    Votes: 63 77.8%
  • Other.

    Votes: 4 4.9%
Back
Top