Hello,
I use a esp8266 de type CH340 NodeMcu V3 .
here is my code:
// 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 9600
// Enables and select radio type (if attached)
#define MY_RADIO_NRF24
//#define MY_RADIO_RFM69
//#define MY_RADIO_RFM95
#define MY_GATEWAY_ESP8266
#define MY_WIFI_SSID "yyyyyyy"
#define MY_WIFI_PASSWORD "xxxxxx"
// Enable UDP communication
//#define MY_USE_UDP // If using UDP you need to set MY_CONTROLLER_IP_ADDRESS below
// Set the hostname for the WiFi Client. This is the hostname
// it will pass to the DHCP server if not static.
//#define MY_HOSTNAME "sensor-gateway"
// Enable MY_IP_ADDRESS here if you want a static ip address (no DHCP)
//#define MY_IP_ADDRESS 192,168,1,102
// If using static ip you can define Gateway and Subnet address as well
//#define MY_IP_GATEWAY_ADDRESS 192,168,1,254
//#define MY_IP_SUBNET_ADDRESS 255,255,255,0
// 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
// Controller ip address. Enables client mode (default is "server" mode).
// Also enable this if MY_USE_UDP is used and you want sensor data sent somewhere.
//#define MY_CONTROLLER_IP_ADDRESS 192, 168, 178, 68
// 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 D1
// 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>
#define CHILD_ID 30
volatile uint32_t watt = 10;
MyMessage msgContacteur(CHILD_ID, V_TRIPPED);
//uint32_t SEND_FREQUENCY = 20000; // Minimum time between send (in milliseconds). We don't want to spam the gateway.
MyMessage wattMsg(CHILD_ID,V_WATT);
MyMessage kWhMsg(CHILD_ID,V_KWH);
MyMessage pcMsg(CHILD_ID,V_VAR1);
void setup()
{
// Setup locally attached sensors
}
void presentation()
{
sendSketchInfo("MySensors Watt", "1.0");
present(CHILD_ID, S_POWER);
}
void loop()
{
// Send locally attached sensors data here
send(wattMsg.set(watt)); // Send watt value to gw
Serial.print("Watt:");
Serial.println(watt);
}
here are the errors:
90 TSF:LRT:OK
105 TSM:INIT
119 TSF:WUR:MS=0
142 !TSM:INIT:TSP FAIL
166 TSM:FAIL:CNT=1
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 3
cnt
connected with yyyyyyyyyy, channel 1
dhcp client start...
334 TSM:FAIL:DIS
352 TSF:TDI:TSL
ip:192.168.1.102,mask:255.255.255.0,gw:192.168.1.254
10370 TSM:FAIL:RE-INIT
10394 TSM:INIT
10415 !TSM:INIT:TSP FAIL
10441 TSM:FAIL:CNT=2
10463 TSM:FAIL:DIS
10483 TSF:TDI:TSL
do you have an idea about the problem?
cordially