I am in Electrical Engineering industry for 4 years, in fact, I love to mess with electronic components, theory and applications of EE. For me, it is the queen of all Engineering branches, what you say?
@alowhum most of these questions are way too advanced for me to answer, but I know that wait() calls _process() which processes messages and kicks the watchdog (through doYield()). See https://github.com/mysensors/MySensors/blob/development/core/MySensorsCore.cpp#L565
while (hwMillis() - enteringMS < waitingMS) {
_process();
}
By default, nrf24-based nodes do not use interrupts for message handling.
There is nothing done in parallell.
@Erik-Forsberg
I think one should be a bit careful about making too many special rules for different cases, between device and controller. I think there should be set ways of communicating between the controller and device. There should also be ways for the user to make rules to create the automations, but this should not change the set ways for communication.
In this case, when we need an initial value from the user, which should be automated somehow, I think the user should be able to make rules, and somehow be able to set an initial state, by controller API or other means. But I think that should be detached from the specific device - controller communication.
You can have a look at my handle_req branch here:
https://github.com/MartinHjelmare/pymysensors/tree/handle_req
I would say your implementation looks fine, although I have some comments. We can continue at github.
@laoadam Your garage door safety sensors may not be aligned quite right. It could be off just enough that vibration from the door itself when opening and closing is knocking one of the sensor modules out of alignment. The same could be true if one of the wires to it is loose. Check both sensor modules to make sure they are aligned right and not loose. One should be a transmitter that shoots a beam to the other module which is the receiver. If the transmitter beam is not aligned exactly right with the receiver, it won't work. As I mentioned too, check that there are no loose or broken wires. If wires go to screw terminals, make sure those are secured properly and that none of the wire casing is getting pinched in with the wire as that may cause a partial connection that could be lost with vibration of the door.
With all that being said, this is a forum for a DIY home automation hardware platform called MySensors. Were you planning at some point to implement this for your garage door?