Strange routing and sensor assignments
-
Collected a test circuit from a gateway and one sensor. Hardware in both cases is the same, Vetos d1 r1 + nRF24L01.
I registered the gateway to MQTT myself, the rest was picked up automatically. But, I'm a little confused, because in my opinion everything was determined incorrectly ..
And when testing MQTT topics from an external dash program, the paths of topics look very strange. For example:gw-out/21/1/1/0/16 gw-in/0/21/1
and the topology doesn't look natural
Sketch Gateway:
#define MY_WIFI_SSID "xxxx" #define MY_WIFI_PASSWORD "xxxxxxx" #define MY_DEBUG #define MY_SPECIAL_DEBUG #define MY_DEBUG_VERBOSE #define MY_DEBUG_VERBOSE_RF24 #define MY_DEBUG_VERBOSE_SIGNING #define MY_RADIO_RF24 #define MY_RF24_PA_LEVEL RF24_PA_HIGH // #define MY_RF24_ENABLE_ENCRYPTION #define MY_GATEWAY_ESP8266 #define MY_REPEATER_FEATURE #define MY_NODE_ID 0 #define MY_BAUD_RATE 115200 #define MY_GATEWAY_MQTT_CLIENT #define MY_MQTT_PUBLISH_TOPIC_PREFIX "gw-out" #define MY_MQTT_SUBSCRIBE_TOPIC_PREFIX "gw-in" #define MY_MQTT_CLIENT_ID "myqw-mqtt-client" #define MY_HOSTNAME "ESP8266_MQTT_GW" #define MY_CONTROLLER_IP_ADDRESS 192, 168, 0, 105 #define MY_PORT 1883 #define MY_GATEWAY_MAX_CLIENTS 8 #define MY_SMART_SLEEP_WAIT_DURATION_MS (2000ul) #define NODE_SENSOR_ID 1 .... void presentation() { sendSketchInfo("ESP MQTT Gateway", "1.1"); }
Sketch Fake Sensor:
#define MY_DEBUG #define MY_DEBUG_VERBOSE_SIGNING #define MY_RADIO_RF24 #define MY_RF24_CE_PIN D2 #define MY_RF24_CS_PIN D4 #define MY_RF24_PA_LEVEL RF24_PA_HIGH //#define MY_RF24_ENABLE_ENCRYPTION #define MY_BAUD_RATE 115200 #define MY_NODE_ID (AUTO) #define MY_PARENT_NODE_ID 0 #define MY_PARENT_NODE_IS_STATIC #define MY_HOSTNAME "FAKE_SENSOR_1" #include <MySensors.h> #define OPEN 1 #define CLOSE 0 #define CHILD_ID 1 #define NODE_SENSOR_ID 1 MyMessage msg(CHILD_ID, V_TRIPPED); int cnt = 0; uint8_t value = OPEN; void setup() {} void presentation() { sendSketchInfo("Fake Sensor", "1.1"); present(CHILD_ID, S_DOOR); } void loop() { if (++cnt >= 60 ) { value = ((value == OPEN) ? CLOSE : OPEN); send(msg.set(value)); Serial.printf("Set DOOR status = %d\n", (int) value); cnt = 0; } delay(100); }
Gateway RF:
19125773 RF24:WBR:REG=7,VAL=64 19125776 TSF:MSG:READ,21-21-0,s=1,c=1,t=16,pt=1,l=1,sg=0:1 19125781 GWT:TPS:TOPIC=gw-out/21/1/1/0/16,MSG SENT 19131805 RF24:RXM:LEN=8 19131807 RF24:WBR:REG=7,VAL=64 19131810 TSF:MSG:READ,21-21-0,s=1,c=1,t=16,pt=1,l=1,sg=0:0 19131816 GWT:TPS:TOPIC=gw-out/21/1/1/0/16,MSG SENT 19137845 RF24:RXM:LEN=8 19137847 RF24:WBR:REG=7,VAL=64 19137850 TSF:MSG:READ,21-21-0,s=1,c=1,t=16,pt=1,l=1,sg=0:1 19137856 GWT:TPS:TOPIC=gw-out/21/1/1/0/16,MSG SENT 19143892 RF24:RXM:LEN=8 19143894 RF24:WBR:REG=7,VAL=64 19143897 TSF:MSG:READ,21-21-0,s=1,c=1,t=16,pt=1,l=1,sg=0:0 19143903 GWT:TPS:TOPIC=gw-out/21/1/1/0/16,MSG SENT 19149944 RF24:RXM:LEN=8 19149946 RF24:WBR:REG=7,VAL=64 19149949 TSF:MSG:READ,21-21-0,s=1,c=1,t=16,pt=1,l=1,sg=0:1 19149955 GWT:TPS:TOPIC=gw-out/21/1/1/0/16,MSG SENT 19155988 RF24:RXM:LEN=8 19155990 RF24:WBR:REG=7,VAL=64 19155993 TSF:MSG:READ,21-21-0,s=1,c=1,t=16,pt=1,l=1,sg=0:0 19155999 GWT:TPS:TOPIC=gw-out/21/1/1/0/16,MSG SENT
Sensor RF:
Set DOOR status = 0 19162221 TSF:MSG:SEND,21-21-0-0,s=1,c=1,t=16,pt=1,l=1,sg=0,ft=0,st=OK:1 Set DOOR status = 1 19168276 TSF:MSG:SEND,21-21-0-0,s=1,c=1,t=16,pt=1,l=1,sg=0,ft=0,st=OK:0 Set DOOR status = 0 19174328 TSF:MSG:SEND,21-21-0-0,s=1,c=1,t=16,pt=1,l=1,sg=0,ft=0,st=OK:1 Set DOOR status = 1 19180364 TSF:MSG:SEND,21-21-0-0,s=1,c=1,t=16,pt=1,l=1,sg=0,ft=0,st=OK:0 Set DOOR status = 0 19186403 TSF:MSG:SEND,21-21-0-0,s=1,c=1,t=16,pt=1,l=1,sg=0,ft=0,st=OK:1 Set DOOR status = 1 19192436 TSF:MSG:SEND,21-21-0-0,s=1,c=1,t=16,pt=1,l=1,sg=0,ft=0,st=OK:0 Set DOOR status = 0 19198493 TSF:MSG:SEND,21-21-0-0,s=1,c=1,t=16,pt=1,l=1,sg=0,ft=0,st=OK:1 Set DOOR status = 1 19204541 TSF:MSG:SEND,21-21-0-0,s=1,c=1,t=16,pt=1,l=1,sg=0,ft=0,st=OK:0 Set DOOR status = 0 19210586 TSF:MSG:SEND,21-21-0-0,s=1,c=1,t=16,pt=1,l=1,sg=0,ft=0,st=OK:1 Set DOOR status = 1 19216634 TSF:MSG:SEND,21-21-0-0,s=1,c=1,t=16,pt=1,l=1,sg=0,ft=0,st=OK:0 Set DOOR status = 0 19222695 TSF:MSG:SEND,21-21-0-0,s=1,c=1,t=16,pt=1,l=1,sg=0,ft=0,st=OK:1 Set DOOR status = 1
Gateway settings:
Nodes settings:
how to be in such a situation?
-
@Clone-Tv do you see any error log related to this on mycontroller.log?
to get complete topology, on the gateway page select a gateway and on actions click,Discover
and the get node information clickRefresh nodes info
-
Thanks for the quick reply, but I did not look at the log at the time of adding. Or rather, no recordings caught my attention when I watched it later! With sensor detection and information I tried it, unfortunately the topology hasn't changed. It seems to me that this is due to the fact that the auto gateway is registered in the repeater state. I will check this later.
I have one more question: how to change the built-in MQTT broker to use SSL?
The various options for moquette described in the myController configuration do not change its initialization..
(I guess I'll create a separate question on this topic )