alexellis / growlab

A global contest to grow and monitor your own food with Raspberry Pi
MIT License
442 stars 49 forks source link

Updates for new technicians & Fixes to growlab.service #46

Open kylos101 opened 3 years ago

kylos101 commented 3 years ago

Hi @alexellis,

I went through growlab, took notes, and am at a point where my camera and sensor are working using the service. Now I just need to dog proof my setup so it doesn't become an expensive chew toy...

Would you be interested in reviewing and potentially accepting a PR containing new technician documentation and a tweak to the service?

Here is a summary of what I did:

  1. Added a couple pages and content to existing pages for new technicians (this helped me, I'm newer to RPi).
  2. Change growlab.service to run sample.sh every 10 minutes as the pi user. This was necessary to run every 10 minutes (instead of constantly when referencing app.py), and also includes uploading to Github (it gets error 128 w/o having User and Group set).
  3. Change sample.sh to add the proper docs folder for the live preview

Perhaps @cpanato can help share feedback on the service and script changes too?

The related commits are in my fork here: https://github.com/alexellis/growlab/compare/master...kylos101:service-and-new-docs?expand=1

Take care,

Kyle

cpanato commented 3 years ago

hey, cool that you are taking part in this!!

regarding your comments:

the snippet of the code for the app.py

...
while True:
        ...
        spec = specimen(config["text"], config["images"])
        spec.save_image("{}/image.jpg".format(pwd), frame, readings)

        spec.save_html("{}/image.jpg".format(pwd), output_path, readings)
        print("Sleeping {} after that will take another picture".format( config["images"]["interval_seconds"]))
        time.sleep(config["images"]["interval_seconds"])

then I did a modification in the sample.sh script and created a cron job to run the script for me, I'm not pushing the image and index.html to the same repo, I've created a new repo (https://github.com/cpanato/growlab-live) just to hold the live images and maybe other things in the future.

I saw your diff and the docs look good to me :)

alexellis commented 3 years ago

Hi @kylos101 can you send the PR so that I can compare in a diff please?

Alex