Hi @berkseo. Thanks for the suggestion, but could you describe in more detail? As for my TODO list, there is already a task to add 485 interface to the gateway. My latest device "xRoom" have this interface.
ps/ Where have you gone?
I have been working on "xRoom" shield. A small announce:
Do you remember the discussion about multinode? So, it will be available soon))
slight bump to this topic rather than starting a new one since I have some more questions
Are there any example sketches for setting variables on a node? Thinking I'd want at least 2 variables.
Is there a proper way for a node to report time to the controller or other nodes? This one will be powered 100% of the time so responding to messages shouldn't be a problem.
I'm pretty sure I know the answer to this one but best way to set up a sketch to report the temp every X when it isn't the main function of the node.
Thanks in advance.
@Michael_K ,
If we go from the front to the back this is what is needed:
1 Node: For example a door bell.
This node sends information to a gateway.
2 The gateway takes the message from the node and sends this to a controller. For instance Openhab or Domotics. This can be done in several ways. MqTT being one.
3 Controller: takes the information and displays it to you.
So in my case, I hardcode Node ID and CHILD ID (the complete door bell is a NODE whereas CHILD IDs may be the button pressed and maybe temperature reading at the same time).
This sends to Gate way that takes the information and creates a MqTT message.
What this message is, please read the instructions on this site.
@legeantvert said:
On the same way, i dont understand how and where are stored the values inside the gateway if not used on each reception, are they stored somewhere to be able to answer them when serial request arrive?
You could bypass this on some kind of events obviously !
Actually my perl gateway is acting as the server Vera is for the arduino gateway. So from there I can trigger external URL, store data in a sqlite3 database... and so on !
I use a cheap Chinese 5100 module together with the MQTT gateway and it is warm but have not measured any actual temperature. Works 24 hours a day (now for a couple of months). Most problems have been due to the MQTT code implementation itself . But for most "simple" sensors it runs OK with Openhab.
@Eric-Buhring I found that changing the line in the my sensors program that sends the message as below allowed me to use a Contact rather than a Switch
if (value != sentValue2) {
// Value has changed from last transmission, send the updated value
send(msg2.set(value==HIGH?"OPEN":"CLOSED"));
sentValue2 = value;
}
wdt.h is included on Arduino IDE.
This example show how it's work:
#include <avr/wdt.h>
int counter=0;
void setup(){
wdt_disable();
Serial.begin(9600);
Serial.println("Starting...");
delay(1000);
wdt_enable(WDTO_8S);
}
void loop(){
wdt_reset();
Serial.println(counter);
counter++;
if(counter==5){
while(true){}
}
delay(500);
}```