Go to advanced search

by PingoBags
Wed Jan 31, 2018 11:38 pm
Forum: Python
Topic: Auto turn off if i do not run Stop script
Replies: 13
Views: 1073

Re: Auto turn off if i do not run Stop script

I'm posting a little bit of code for you, it's ok if you don't choose to use any of it since I don't think it's exactly what you're after. But sharing is caring and it's something I will be eventually adding to my own light relay app anyway. I think it basically does what you're asking but from one ...
by PingoBags
Wed Jan 31, 2018 1:34 am
Forum: Python
Topic: Capturing and emailing temp alerts
Replies: 3
Views: 788

Re: Capturing and emailing temp alerts

Here's how I'd probably do it using two threads instead of a while loop. The daily email thread would only run once a day, the intervals calculated at runtime or when the thread resets. The other thread every 3 hours since that is what you currently have yours set at. I could only test it up to a po...
by PingoBags
Tue Jan 30, 2018 10:15 pm
Forum: Troubleshooting
Topic: gpio output voltage drops when connecting relay
Replies: 19
Views: 1805

Re: gpio output voltage drops when connecting relay

This is the relay I have connected directly to my pi zero
https://www.amazon.ca/gp/product/B01BY1 ... UTF8&psc=1
No issues
by PingoBags
Wed Jan 24, 2018 5:51 pm
Forum: Beginners
Topic: Automated light controlled chicken coop door (Self Locking), GPIO motors and limit switches
Replies: 54
Views: 4166

Re: Automated light controlled door, motors and limit switches

I've seen some good videos on youtube for self locking coop doors, like this one for example. Looks like a simple design and I'm sure it would stop most things from getting in. I can't really think of a reliable way to check if there's a chicken in the doorway. Sensors would work but as you already ...
by PingoBags
Wed Jan 24, 2018 12:38 pm
Forum: Beginners
Topic: Automated light controlled chicken coop door (Self Locking), GPIO motors and limit switches
Replies: 54
Views: 4166

Re: Automated light controlled door, motors and limit switches

I have kind of thought about that and the door is basically a thin piece of wood that's not all that heavy. When it is built i will have to stick my arm in there and see how heavy it really is and how the whole thing would react. If it turns out to be heavy i would have to figure out some kind of i...
by PingoBags
Tue Jan 23, 2018 5:14 pm
Forum: Beginners
Topic: Automated light controlled chicken coop door (Self Locking), GPIO motors and limit switches
Replies: 54
Views: 4166

Re: Automated light controlled door, motors and limit switches

You might have issues with the door closing on cloudy days. People at BC that use light to control the door have had issues with false positives. I use a pi in my coop but only for my water heater and lights. I think a better option would be to calculate sunset,sunrise and have the door open and clo...
by PingoBags
Fri Dec 15, 2017 11:40 pm
Forum: Beginners
Topic: looking for help with starting a script on reboot
Replies: 7
Views: 623

Re: looking for help with starting a script on reboot

Yea, it runs once. That's the way I intended it to. It simply waits for an internet connection before running the rest of your script. But once the everything is up and running. You would simply check to make sure your internet hasn't dropped out if IsNetWorking():#If i have net #then it's ok to do ...
by PingoBags
Wed Dec 13, 2017 12:24 pm
Forum: Beginners
Topic: looking for help with starting a script on reboot
Replies: 7
Views: 623

Re: looking for help with starting a script on reboot

Instead of delaying the script, why not just check your internet connection before running the rest of the code. What happens if the Pi momentarily loses connection or the pi takes longer then you expect to connect. My pi drops out all the time. If this is something you plan on running 24/7, I'd jus...
by PingoBags
Tue Dec 12, 2017 7:09 pm
Forum: Troubleshooting
Topic: Setting the time zone
Replies: 5
Views: 5473

Re: Setting the time zone

Code: Select all

sudo timedatectl set-timezone Europe/Brussels
That's how I set mine
by PingoBags
Tue Dec 12, 2017 2:38 pm
Forum: Beginners
Topic: How to make device standalone...
Replies: 5
Views: 703

Re: How to make device standalone...

All I did was open the rc.local with nano sudo nano /etc/rc.local And added my script with full path sudo python /home/pi/Desktop/Scripts/MainScript.py & Here's the link to the tutorial https://www.raspberrypi.org/documentation/linux/usage/rc-local.md Now whenever I turn on my pi or when my power co...
by PingoBags
Tue Dec 12, 2017 11:35 am
Forum: Python
Topic: Control relay from temperature probe
Replies: 9
Views: 1280

Re: Control relay from temperature probe

Thank you pcmanbob i Will try the Codee When i get Home from works :) If pcmanbob code doesn't work, I suggest you post up a picture of your gpio pins. You're using BOARD, pin 11, which is not the same as BCM pin 11. BCM pin 11 is actually BOARD pin 23. Not saying you have mixed them up, just sayin...
by PingoBags
Sun Dec 10, 2017 11:28 pm
Forum: Python
Topic: Control relay from temperature probe
Replies: 9
Views: 1280

Re: Control relay from temperature probe

You have GPIO.cleanup() in your loop, I'm sure that's just gonna reset your pins. Remove that part from you while true loop. Try, instead of setting pin 11 high to turn the relay on, try setting it low to turn it on. Set it high to turn it off. Worth a shot, my relay turns on when set low. Like if (...
by PingoBags
Wed Dec 06, 2017 1:03 am
Forum: Python
Topic: Daily Heartbeat Email
Replies: 12
Views: 1039

Re: Daily Heartbeat Email

Couldn't check for errors, I'll let you do that. Test it in a new file first. from threading import Timer import RPi.GPIO as GPIO,time import time import atexit import sys import smtplib from datetime import datetime from time import ctime GPIO.setmode(GPIO.BOARD) GPIO.setwarnings(False) GPIO.setup(...
by PingoBags
Tue Dec 05, 2017 11:32 pm
Forum: Python
Topic: Daily Heartbeat Email
Replies: 12
Views: 1039

Re: Daily Heartbeat Email

Post up the code for your LEDRed function. Don't worry about being new, I'm new myself. We learn from eachother. from threading import Timer def HoursToSec(hrs): return (hrs * 60) * 60 def DailyEmail(): LEDRed() Timer(HoursToSec(24), DailyEmail).start() def monitor(): if not readInput(11): print ("S...
by PingoBags
Tue Dec 05, 2017 11:32 am
Forum: Python
Topic: Daily Heartbeat Email
Replies: 12
Views: 1039

Re: Daily Heartbeat Email

What about just adding a timer to your existing script and having it run every 24 hours? You already have a function that checks if there is a leak, use that in the timed function. from threading import Timer def HoursToSec(hrs): return (hrs * 60) * 60 def RunCode(): #email the status every 24hrs Ti...
by PingoBags
Tue Dec 05, 2017 1:12 am
Forum: Python
Topic: SyntaxError at print statement
Replies: 3
Views: 558

Re: SyntaxError at print statement

print(f.read())
Maybe you just need a parentheses.
by PingoBags
Mon Dec 04, 2017 3:59 pm
Forum: Python
Topic: New and need some help with automated chicken coop
Replies: 3
Views: 578

Re: New and need some help

I would store the state using a boolean, like paddyg suggested. Personally I would use one for each if statement, high,low and freeze. Like this. The code in each if statement will only get executed once and only when it changes from one to another. def waterHeater(self): TEMP_HIGH = False TEMP_LOW ...
by PingoBags
Fri Nov 24, 2017 10:15 am
Forum: Beginners
Topic: Creating If Statement Based off Sensor Reading
Replies: 13
Views: 1209

Re: Creating If Statement Based off Sensor Reading

I'm doing something similar with an SI1145 light sensor. I snipped some of my python code. I'm using it to dim (sense.low_light = True) the LED matrix on my sense hat in low light conditions. A dark room for example. And switch it back to full bright (sense.low_light = False) in bright light condit...
by PingoBags
Sun Nov 12, 2017 2:19 pm
Forum: Beginners
Topic: controlling a heating element
Replies: 9
Views: 2514

Re: controlling a heating element

I have a heated box but it doesn't use a pi, it will be run off a pi in the near future though, when I need more features. At the moment, it uses an stc 1000. The box dimensions are about 1 meter high, 30 inch wide,30 inch deep with 1 inch foam insulation on the inside. For heat, I use a 100 watt ce...
by PingoBags
Fri Nov 10, 2017 5:35 pm
Forum: Beginners
Topic: Image compare
Replies: 6
Views: 590

Re: Image compare

Can you upload 1 or 2 images of the gauge, preferably at different pressures? Thank you for your respond. Im at work now but i will take nome images when i get home later. Im not able to provide images of different pressures now. normaly the pressure drops gradualy over a month or two but there is ...
by PingoBags
Fri Nov 10, 2017 10:49 am
Forum: Beginners
Topic: Image compare
Replies: 6
Views: 590

Re: Image compare

Can you upload 1 or 2 images of the gauge, preferably at different pressures?
by PingoBags
Tue Nov 07, 2017 12:24 am
Forum: Beginners
Topic: Are there errors in my Script?
Replies: 16
Views: 1085

Re: Are there errors in my Script?

Mottagare = 0 is when I press a button. I want to be able to stop "oppna" and "stanga" by pressing the button "mottagere" again. Hope you understand me. So that when i press first it runs "oppna" and if I press again when "oppna" runs I want to stop it, and if I press again I want "stanga" to run. ...

Go to advanced search