Sensors without a gateway..?



  • So a while back I ordered a bunch of pro minis and the RF modules (NRF24L01+) and they've sort of just been sitting in one of my electronics bins since... I had the fantastic idea that I was going to make my home all smart on the cheap. Then I realized what if it becomes a sentient being and murders me during the night? What if it decides NOT to send a push notification to my phone when the serial killer sneaks in through my window and stabs me in the heart?

    Okay so that's not really the reason I didn't build it, I just got busy with other projects and school and the like. The other day however my dad mentioned to me he'd like something that when the garage door opens if it would alert him down in his office, in the basement of the house. My first thought was these wireless RF chips and I figured I could just have a node in the garage that tells the receiver in his office "hey garage is open woopdeedoo" and then it triggers a piezo to make a god awful buzzy noise to alert my father. Problem I'm having is all I really want are two arduinos communicating with each other, not a whole network of sensors that send it through a MQTT gateway to a Pi that then sends an email to him that triggers a USB piezo to make a god awful buzzy noise. Unfortunately the MySensors code is setup to do exactly that, I'm not very familiar with editing libraries and alot of the code in the example is pulling from them.

    What I have setup right now is the traffic LED's are enables so when the receiving arduino gets a signal, it buzzes the piezo (using pin 6 for RX). That's fine and dandy but I'd like it to really be something where when the specific garage node with a specific state (on/off) is received it will trigger the piezo. This way if I ever decide to set up any more of these devices they won't interfere with each other.

    Hope that all made sense through the sarcasm and all, any help is greatly appreciated and feel free to give yourself a ✋ nice pat on the back for making it this far into my article. If you have any questions or need some clarification just let me know!

    Thanks,
    Brayton :bowtie:


  • Admin

    You could try the MQTT client gateway running on ESP8266 in the development branch.
    It also allows you to attach and present the door sensor directly to the gateway.

    https://github.com/mysensors/Arduino/tree/development/libraries/MySensors/examples/GatewayESP8266MQTTClient

    Have this push to some "cloud"-MQTT-broker which alerts your father. No need for any other components than a NodeMCU and door contact.



  • Gotcha. That could work thanks!

    Is there any way though that I could just simply have the receiving arduino trigger the piezo instead of sending it to the cloud? Basically the transmitter in the garage tells the receiving arduino in his office that the door is open and the receiving arduino buzzes. That is all I need. I'm just not sure how to have the receiving module read the incoming message and respond accordingly. (besides using the network traffic LED's)


  • Hardware Contributor

    @Brayton-Larson
    Hello, old topic but if anyone is interested it's simple to implement.
    You need to know the node ID of the receiving node, and send it a message from the gateway.
    In the development version use the receive method/event that will trigger every time your node or gateway receives a message, if the message is sent by the door node, then you can send a message to the receiving node, and use the same receive method in the node to display a message/use the buzzer/...

    void receive(const MyMessage &msg) {
      // here process the message, see API/examples
    }
    

    And you can even use the esp8266 gateway to ring the buzzer directly to make it even more simple, then you only need one esp8266 as gateway and arduino/nrf24 as node.


Log in to reply
 

Suggested Topics

0
Online

11.2k
Users

11.1k
Topics

112.5k
Posts