@blacey
Hi Thank you for hour help.
I do really need to solve it.
I prepared sample as simple as possible:
on ESP:
0;255;3;0;9;Client 0: 0;0;3;0;18;PING
0;255;3;0;9;Client 0: 0;0;3;0;18;PING
0;255;3;0;9;Client 0: 0;0;3;0;18;PING
On domoticz
2016-11-23 08:50:12.675 MySensors: Gateway Version: 2.0.1-beta
After restarting ESP (deploy code again)
On ESP:
áNɆŔü0;255;3;0;9;MCO:BGN:INIT GW,CP=R-NGE--,VER=2.0.1-beta
scandone
f 0, scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 3
cnt
connected with MK, channel 11
dhcp client start...
.....ip:192.168.1.129,mask:255.255.255.0,gw:192.168.1.1
.IP: 192.168.1.129
0;255;3;0;9;MCO:REG:NOT NEEDED
0;255;3;0;9;MCO:BGN:STP
Setup request sent [0]
0;255;3;0;9;MCO:BGN:INIT OK,ID=0,PAR=0,DIS=0,REG=1
pm open,type:2 0
On domoticz :
no new messages
Then silent
Then After Setup - >Hardware -> Click my device - > Click update
ON esp:
0;255;3;0;9;Client 0 connected
0;255;3;0;9;Client 0: 0;0;3;0;2;
0;255;3;0;9;Client 0: 0;0;3;0;2;Get Version
0;255;3;0;9;Client 0: 0;0;3;0;18;PING
0;255;3;0;9;Client 0: 0;0;3;0;18;PING
On domoticz:
2016-11-23 08:55:47.768 MySensors: TCP/IP Worker stopped...
2016-11-23 08:55:48.782 MySensors: trying to connect to: 192.168.1.129:5003
2016-11-23 08:55:49.783 MySensors: connected to: 192.168.1.129:5003
2016-11-23 08:55:49.784 MySensors: Gateway Ready...
2016-11-23 08:55:49.788 MySensors: Node: 0, Sketch Name: Relay
2016-11-23 08:55:49.790 MySensors: Node: 0, Sketch Version: 1.0
2016-11-23 08:55:50.793 MySensors: Gateway Version: 2.0.1-beta
2016-11-23 08:55:50.794 MySensors: Gateway Version: 2.0.1-beta
My sketch:
// Enable debug prints to serial monitor
#define MY_DEBUG
// Use a bit lower baudrate for serial prints on ESP8266 than default in MyConfig.h
#define MY_BAUD_RATE 115200
// Enables and select radio type (if attached)
//#define MY_RADIO_NRF24
//#define MY_RADIO_RFM69
#define MY_GATEWAY_ESP8266
#define MY_ESP8266_SSID "xxx"
#define MY_ESP8266_PASSWORD "xxx"
// Enable UDP communication
//#define MY_USE_UDP
// Set the hostname for the WiFi Client. This is the hostname
// it will pass to the DHCP server if not static.
#define MY_ESP8266_HOSTNAME "sensor-gateway"
// The port to keep open on node server mode
#define MY_PORT 5003
// How many clients should be able to connect to this gateway (default 1)
#define MY_GATEWAY_MAX_CLIENTS 2
// Enable inclusion mode
#define MY_INCLUSION_MODE_FEATURE
// Enable Inclusion mode button on gateway
// #define MY_INCLUSION_BUTTON_FEATURE
// Set inclusion mode duration (in seconds)
#define MY_INCLUSION_MODE_DURATION 60
// Digital pin used for inclusion mode button
#define MY_INCLUSION_MODE_BUTTON_PIN 3
// Set blinking period
// #define MY_DEFAULT_LED_BLINK_PERIOD 300
// Flash leds on rx/tx/err
// Led pins used if blinking feature is enabled above
#define MY_DEFAULT_ERR_LED_PIN 16 // Error led pin
#define MY_DEFAULT_RX_LED_PIN 16 // Receive led pin
#define MY_DEFAULT_TX_LED_PIN 16 // the PCB, on board LED
#if defined(MY_USE_UDP)
#include <WiFiUdp.h>
#endif
#include <ESP8266WiFi.h>
#include <MySensors.h>
void setup() {
bool ret=request(1, V_STATUS);
Serial.printf("Setup request sent [%d]\n",ret);
}
void presentation() {
// Present locally attached sensors here
sendSketchInfo("Relay", "1.0");
present(1, S_BINARY);
}
void loop() {
// Send locally attached sensors data here
}
void receive(const MyMessage &message) {
int cmd = mGetCommand(message);
Serial.printf("RECEIVE sensor [%d] type [%d] command [%d]\n",message.type, cmd);
}
Edited to use code blocks for readability.