IoT Emergency Alert Button with RPi and Notify17 (who launched on HN last year)

栏目: IT技术 · 发布时间: 4年前

内容简介:Today’s post outlines a project that I threw together in as short of time as possible because there was an urgent need for it.As readers of This Blog may know, my wife is quite ill and has been for some time. Unfortunately her condition has worsened greatl

Today’s post outlines a project that I threw together in as short of time as possible because there was an urgent need for it.

As readers of This Blog may know, my wife is quite ill and has been for some time. Unfortunately her condition has worsened greatly, and she is now bed bound. This has necessitated that she be able to easily contact our adult daughter who is her primary caregiver, or myself. Even when we are in the house, this can be a challenge if we don’t hear her asking for help. When we are out of the house, it is obviously an issue.

IoT Emergency Alert Button with RPi and Notify17 (who launched on HN last year)

To solve this, we looked at options such as an key fob alarm, but this would require Very Loud Noises and also some time for shipping from Amazon which is currently delayed. A wireless doorbell would also work, but would require an online order or even a trip to a big store with a giant line of people waiting to get in- not to mention the half hour drive to the nearest one.

Being an electronics hobbyist with an increasingly well stocked parts bin, I decided that I had enough to cobble something together that would notify both my daughter and I on our phones whenever my wife pressed a button.

I’m happy to report that it works! Here’s how I did it.

Notify17.net

The first problem I needed to solve: How to get notifications that my wife pressed the button. For this I decided to use a product that launched on Hacker News last year called Notify17.net . It’s designed to be used by server admins to allow them to send alerts and notifications from any Internet connected device. This is the perfect solution for this project! I grabbed the example code from their website, put in my API key, then installed the app on my phone. In just a couple of minutes I was sending myself alerts to my phone from the command line on my home server.

The IOT Button

For this I chose the easiest thing I had on hand: A Raspberry Pi Zero W from Seeed Studio. It was sitting in a drawer just waiting for a project that needed it. I connected a button to Pin 10 and to 3.3V, and found a python script to detect the button presses. I modified the script to run my bash script from earlier, and in just another few minutes, I was getting notifications on every button press.

  • IoT Emergency Alert Button with RPi and Notify17 (who launched on HN last year)
  • IoT Emergency Alert Button with RPi and Notify17 (who launched on HN last year)
Terrible pictures of the Button <Left and the Pi> Right

The button itself is a phone hangup switch salvaged from an old printer/fax/copier that I tore apart a couple of years ago. A larger tab was glued to it so that there would be something easy to press. The switch was wired up with an old USB cable that I cut up. USB cables, usually sourced from old mice and keyboards, have four conductors and are a great source of small gauge 4 conductor wire.

Lastly, I setup a Notify17.net account for my daughter, duplicated the setup on her phone, and in just a few minutes, both of us were getting notifications when my wife pressed the button.

The only difference was that I debounced the switch and used FALLING for button detection, which detects when you let the button go rather than when it’s pressed, which solved problems with multiple notifications for a single button press:

GPIO.add_event_detect(10,GPIO.FALLING,callback=button_callback,bouncetime=500

I learned those tricks from http://shallowsky.com/blog/hardware/buttons-on-raspberry-pi.html .

The problem was solved in about an hour using parts on hand, and it seemed to work really well at first. But then we started getting false notifications, and before I had a chance to troubleshoot further, my wife ordered a doorbell on Amazon. Oh well. You win some, you don’t win some.

In the end though, I learned a lot and got more familiar with Notify17, which is actually intended to help System Administrators and DevOps teams get notifications from programs when something goes wonky- which is exactly what I’m going to use it for from now on.

And even though this didn’t work out as I’d hope, I do hope that this post helps YOU to be inspired to use what you have to fill a need. When you get a chance to try out Notify17 . It’s a great project!


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

SNS浪潮

SNS浪潮

李翔昊 / 人民邮电出版社 / 2010 / 35.00元

内容提要: 本书通过互联网行业与社会生活中的案例内容,向读者介绍了一些互联网技术和新型网站的发展,揭示了社交网站兴起的因素。在探讨社交网站发展和网络开放平台的同时,也介绍、描述了其对社会信息传播、行业组织、广告营销等方面的影响。最后通过新技术和产品应用,展望了未来社会化网络的趋势走向。 本书适合从事信息技术、社会传播、市场营销相关工作,以及广大互联网用户,或对IT行业有兴趣的人士阅读。......一起来看看 《SNS浪潮》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试