Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. General Discussion
  3. Mysensors 2.0 ESP8266 serial gateway

Mysensors 2.0 ESP8266 serial gateway

Scheduled Pinned Locked Moved General Discussion
2 Posts 1 Posters 1.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Fat FlyF Offline
    Fat FlyF Offline
    Fat Fly
    wrote on last edited by
    #1

    I set in sketch static ip aadress and if esp booting and connected to lan i see in serial monitor
    Connected with home, channel 1
    dhcp client start...
    chg_B1:-40
    0;255;3;0;9;TSM:READY
    f r-40, scandone
    ...................pm open,type:2 0
    ......................................................................................................................................................................................................................................................................................................................0�~?�4�����OCAZ��0;255;3;0;9;MCO:BGN:INIT GW,CP=RNNGE--,VER=2.0.1-beta
    0;255;3;0;9;TSM:INIT
    0;255;3;0;9;TSM:INIT:TSP OK
    0;255;3;0;9;TSM:INIT:GW MODE
    scandone
    state: 0 -> 2 (b0)
    state: 2 -> 3 (0)
    state: 3 -> 5 (10)
    add 0
    aid 1
    cnt
    chg_B1:-40

    1 Reply Last reply
    0
    • Fat FlyF Offline
      Fat FlyF Offline
      Fat Fly
      wrote on last edited by
      #2

      #include <EEPROM.h>
      #include <SPI.h>
      #include <ArduinoOTA.h>

      // 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_GATEWAY_ESP8266

      #define MY_ESP8266_SSID "home"
      #define MY_ESP8266_PASSWORD "123456789"

      // 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 "ota-gateway-CH.100"

      // Enable UDP communication
      //#define MY_USE_UDP

      // Enable MY_IP_ADDRESS here if you want a static ip address (no DHCP)
      #define MY_IP_ADDRESS 10, 124, 77, 101

      // If using static ip you need to define Gateway and Subnet address as well
      #define MY_IP_GATEWAY_ADDRESS 10, 124, 77, 176
      #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 1

      // 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 10, 124, 77, 46

      // 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

      // Flash leds on rx/tx/err
      // #define MY_LEDS_BLINKING_FEATURE
      // Set blinking period
      // #define MY_DEFAULT_LED_BLINK_PERIOD 300

      // 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>
      #else
      #include <ESP8266WiFi.h>
      #endif

      #include <MySensors.h>

      void setup() {

      ArduinoOTA.onStart( {
      Serial.println("ArduinoOTA start");
      });
      ArduinoOTA.onEnd( {
      Serial.println("\nArduinoOTA end");
      });
      ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {
      Serial.printf("OTA Progress: %u%%\r", (progress / (total / 100)));
      });
      ArduinoOTA.onError([](ota_error_t error) {
      Serial.printf("Error[%u]: ", error);
      if (error == OTA_AUTH_ERROR) Serial.println("Auth Failed");
      else if (error == OTA_BEGIN_ERROR) Serial.println("Begin Failed");
      else if (error == OTA_CONNECT_ERROR) Serial.println("Connect Failed");
      else if (error == OTA_RECEIVE_ERROR) Serial.println("Receive Failed");
      else if (error == OTA_END_ERROR) Serial.println("End Failed");
      });
      ArduinoOTA.begin();
      Serial.println("Ready");
      Serial.print("IP address: ");
      Serial.println(WiFi.localIP());

      }

      void presentation() {
      // Present locally attached sensors here
      }

      void loop() {
      // Send locally attech sensors data here
      ArduinoOTA.handle();
      }

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      12

      Online

      11.7k

      Users

      11.2k

      Topics

      113.1k

      Posts


      Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • MySensors
      • OpenHardware.io
      • Categories
      • Recent
      • Tags
      • Popular