Hi Papa.Thanks for your helpful tutorials,all sketches and technical support. I'm working to a school project with 1 gateway and 4 node, but without any server . The gateway send and receved text to node(one or all) by pressing some buttons .
Can you help me with some example or how to modify your Gateway .ino for my use?
We are 2 students at the last year of computer programming school. We are working to a simple project with Arduino and RFM69hw module: 1 gateway with an oled display powered by usb 5v and 4 node or more (2 door sensor and 2 motion sensor) powered by battery. We are studying the listen mode (in LowpowerLab library of Felix Russo) to make a node low power.
The question is... All nodes will be in Listening mode (RX mode for 250us and 1 s in SLEEP mode). A button on Gateway enables sensors (of all nodes or one) with a tx message (WAKE for example). It enables the INTERRUPT pin and supply the sensor by digital write. Now the nodes can send alarm message when a movement is detected or door is opened (Interrupt detected). Gateway receive an alarm message and shows it on display. If the button is pressed again, the Gateway sends a tx message (SLEEP for example) to disable the alarm sensor of node.
The motion sensor and the door sensor are in the classroom so the PIR sensor and door sensor detect a lot of movement and send always a tx message to gateway (and the battery will drain quickly). The idea is to put the sensor in sleep mode (listening mode) and wait until the end of class sessions to activate with a button the sensor node with a "ARM" message (for the night). The following day, in the morning all sensors will be disabled by a text command such as "DISARM". Our project is a simple alarm 1 gateway with oled and 4 nodes. Thanks for all help and sorry for my bad English.
Hmmmmmmmmm (thinking) In some ways I believe the present Gateway & choose nodes sketches have much for what you are asking: In the Gateway sketch, I just included an "Away" mode, a jumper that arms the system. The choose nodes sketch has coding for several sensors including some where the node sleeps at low power until something changes on the interrupt pin (D3). The choose nodes sketch also has examples of powering sensors with a digital pin.
Gaps in my code for what you want: It has no OLED code. On the possibly more challenging side: At present the Gateway will not work without connecting to Mosquitto (MQTT broker) on the OpenHAB computer. Also at present, the Gateway sketch (especially with helpful DEBUGging output) fills much of the Arduino memory so there's not much room for added coding. If Gateway code communicating with the OpenHAB / Mosquitto can be successfully removed, that may provide enough space for added coding (like for OLED).
Proposal: If you agree, I could look at removing the Gateway code that communicates with OpenHAB / Mosquitto. Since this is a school project, I expect you to be responsible for the OLED, etc. I believe my threads of schematics & node code customization would help you. This post has a linked list to documentation on various sensors & node functions. As long as you make a strong effort studying & using that documentation, I'd be willing to give you some hints.
If I'm able to remove the Gateway code that communicates with OpenHAB / Mosquitto AND you use our code for your project, some more expectations: In your school report, I expect you to give credit to this forum. I expect you to report here what you added to get the project working or at least what you learned in the process. Perhaps your report on your school project would work for this & I would give you credit on this forum for your additions.
Are both of you willing to agree to the above proposal? Just be honest with me. I know it's a risk to start down a certain path, especially facing a deadline. So I will understand if you choose to use another approach. Just let me know what you decide.
Thanks for reply. The oled code for ssd1306 is already written, as the parts for sensor.Some part of menu features,led input-output and alarm will be coded soon.
All credits go to Felix and this forum for helped me with some .ino example and the libraries.
This is a good project to show the power of the Arduino open source plattform. All progress( code and schematics) will be share here with any tips for all forum member.In the end all project must be clean and modern. I started with this ino example( thanks to Felix of Lowpower lab)ListenMode_Master.ino (1.49 KB)ListenMode_Node.ino (1.77 KB)
zzzap: "All credits go to Felix and this forum... All progress( code and schematics) will be shared here with any tips for all forum member.
papa: yes, our gateway & node sketches also credit Felix & use an earlier version of his RFM69 library (before listen mode was added for low power sleeping). From what you wrote, it's good to hear your willingness to share documentation of your progress on this forum.
zzzap: "I started with this ino example( thanks to Felix of Lowpower lab): ListenMode_Master.ino (1.49 KB)ListenMode_Node.ino (1.77 KB) ... The oled code for ssd1306 is already written, as the parts for sensor. Some part of menu features,led input-output and alarm will be coded soon."
papa: What I quoted from you sounds like you are making good progress with examples (& your own work) that you have now. So I am not sure what additional help you hope for from this forum. Our gateway & node sketches are so much built around communicating with OpenHAB's MQTT binding via the Mosquitto service. So adapting our sketches may be more complicated than adding what you need to the ListenMode sketches.
That said, our forum's sketches contain code sections that may be useful for your project. If you let me know what code examples you are looking for, I could show you where to look in our sketches.
Again, I would be glad for you to publish here early & more finished results. Perhaps we can confirm your efforts & even suggest improvements.
I look forward to hearing more from you on what I've written in this post.