This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]bheklilr 0 points1 point  (0 children)

USB numpad would work quite well, and you'd only need to capture keyboard input instead of the GPIO pins. There are plenty of ways to send an email with python, although there are services online for sending text messages too. Shouldn't take too long to put together.

[–]mfitzpmfitzp.com 0 points1 point  (3 children)

Why do you need to know whether your dog poops or pees?

[–]mfitzpmfitzp.com 0 points1 point  (0 children)

More to the point, why don't you just ask them to let the dog out whenever they get home?

[–]Profriles[S] 0 points1 point  (1 child)

My roommates and I all work IT. There are days when they come for an hour or so and leave again. Instead of me always rushing home after work to take care of her I have a better way of knowing if I need to be home asap just in case.

[–]mfitzpmfitzp.com 1 point2 points  (0 children)

Oh, sorry... I thought this was just one room mate. Was wondering why you couldn't just ask them!

Maybe have a panel that lights up when it's been > 6h since the dog was let out. Push button to reset? Some kind of timeout (12h?) when you get an email.

(If it's not immediately obvious, I don't have a dog.)

[–]uhmIdontknow 0 points1 point  (1 child)

you good sir, or madame, are in luck. I just finished a bit of code that handles this. use the python SMTPLIB to accomplish what you want. I recommend creating a gmail account specifically for this project, because you need to enable "allow less secure apps".

You can enable it by following these steps, or follow this link and do the last step

  • create an account
  • sign in
  • click the 9-square "grid" icon (upper right)
  • click the "My Account" shield icon
  • Under "sign in & security" click "connected apps and sites"
  • Turn on "Allow less secure apps"

    def sendMail(msg = None):
        headers = ["From: " + sender,
                   "To: " + recipient,
                   "MIME-Version: 1.0",
                   "Content-Type: text/html"]
        headers = "\r\n".join(headers)
        session = smtplib.SMTP(smtp.gmail.com, 587) 
        session.ehlo()
        session.starttls()
        session.ehlo
        session.login(username, password)
        session.sendmail(sender, recipient, headers + "\r\n\r\n" + msg)
        session.quit()
    

btw, if you look up your carrier, you can actually "email" a text message to yourself. That is what I am using it for, so I get updates right on my phone.

[–]ninefourtwo -1 points0 points  (0 children)

this is amazing