Go to advanced search

by paulv
Wed Jun 12, 2013 8:42 pm
Forum: Automation, sensing and robotics
Topic: Failsafe(r) use of GPIO pin driving critical applications
Replies: 41
Views: 11888

Re: Failsafe use of GPIO pin driving critical applications

Interesting. I propose a competition to find the cheapest design to switch off a relay when the Pi crashes. Still powered, just crashed. Prize - 1 (one) virtual hug. Hi Joan, Coming from you that's a big compliment. Tks! :roll: I will enter the competition (good idea!) to try to score that hug. As ...
by paulv
Wed Jun 12, 2013 1:56 pm
Forum: Automation, sensing and robotics
Topic: Failsafe(r) use of GPIO pin driving critical applications
Replies: 41
Views: 11888

Failsafe(r) use of GPIO pin driving critical applications

I'm using my Pi as a web-based thermostat in my second home, on another continent. It is supposed to keep the temperatures in the house above a minimum, and below a maximum (it's in a hot climate!) Needless to say, when the pi crashes while the HVAC system is heating or cooling, it may continue to d...
by paulv
Sun May 26, 2013 2:04 pm
Forum: General discussion
Topic: What's the simple and safe way to do a "shutdown" button?
Replies: 60
Views: 65701

Re: What's the simple and safe way to do a "shutdown" button

Well, while was at it, I discovered yet another method to add a button press event to a python program. Turns out that when you use the GPIO.add_event_detect function, you can not only add a separate thread, but also add a debounce value like so: GPIO.add_event_detect(PORT, GPIO.FALLING, callback=my...
by paulv
Fri May 24, 2013 1:05 pm
Forum: General discussion
Topic: What's the simple and safe way to do a "shutdown" button?
Replies: 60
Views: 65701

Re: What's the simple and safe way to do a "shutdown" button

That's very interesting. There are a number of Python frameworks that allow you to turn multi threaded apps into an event driven app. You don't have to worry about managing threads, but write an event handler, so when your button gets pressed it runs the code in your event handler. Possibly the bes...
by paulv
Fri May 24, 2013 1:01 pm
Forum: General discussion
Topic: What's the simple and safe way to do a "shutdown" button?
Replies: 60
Views: 65701

Re: What's the simple and safe way to do a "shutdown" button

In the meantime, I decided to figure out how to do a thread in Python. Needed to do that for a while anyway, so I had a good reason. Here is my sample code: #!/usr/bin/env python2.7 import subprocess import RPi.GPIO as GPIO import time from threading import Thread GPIO.setmode(GPIO.BCM) # GPIO 23 (p...
by paulv
Fri May 24, 2013 9:55 am
Forum: Automation, sensing and robotics
Topic: Orderly shutdown your RasPi using a hard disk jumper
Replies: 11
Views: 31206

Re: Orderly shutdown your RasPi using a hard disk jumper

There is yet another method to do this without polling and sleep(ing).
Look at the following topic at the post from Fri May 24, 2013 3:52:
http://www.raspberrypi.org/phpBB3/viewt ... 74#p355974
by paulv
Fri May 24, 2013 9:52 am
Forum: General discussion
Topic: What's the simple and safe way to do a "shutdown" button?
Replies: 60
Views: 65701

Re: What's the simple and safe way to do a "shutdown" button

I have found yet another method on the web to do a shutdown, but now by using the new(er) interrupt possibility for the GPIO pins, rather than polling. The new version uses no cpu time and is very responsive (no waiting for sleep cycles). Here is the code I found, and I only added the shutdown state...
by paulv
Sat May 18, 2013 1:26 pm
Forum: Advanced users
Topic: STICKY: HOWTO: Move the filesystem to a USB stick/Drive
Replies: 339
Views: 519136

STICKY: HOWTO: Move the filesystem to a USB stick/Drive

This procedure will allow you to run Debian from a USB connected drive, instead of the SD card. The RPi will still boot from the SD card, but in essence, will no longer write to it. The original idea was to keep the SD card from failing due to excessive writing to it. It will NOT protect you from di...

Go to advanced search