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
H

hyla

@hyla
About
Posts
38
Topics
13
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • MT681 - Energy Meter
    H hyla

    Hi,

    my electricity supplier swapped meters: we've now got a MT681 and I was forced to get rid of my old sensor.
    So far things seem to work okay-ish, but there are a few things I don't quite understand...

    I've adapted the current "EnergyMeterPulseSensor" example.
    The optical sensor is connected to a ESP32 which is doubling as a Gateway.

    These are "MyMessages":

    MyMessage wattMsg(CHILD_ID, V_WATT);
    MyMessage kWhMsg(CHILD_ID, V_KWH);
    

    The Sketch Info:

    sendSketchInfo(F("Energy Meter"), F("1.1"));
    

    B.t.w.: what's the "F" for? That didn't use to be there ... :)
    I then present the device to Domoticz:

    present(CHILD_ID, S_POWER);
    

    And in the loop I send my data:

    send(kWhMsg.set(kWh, 4));             // Send kWh value to gw
    send(wattMsg.set(Watt,0));            // Send watt value to gw
    

    "Watt" being the current usage, "kWh" the total consumption that was registrated by my fancy MT681
    since we received it.
    In Domoticz I get just one device: Type "general", Subtype "kWh". In the log I get a "Power Usage" graph
    and a block graph telling me the "Energy usage" during one hour. Is there a way to display the current energy
    counter state as well. I seem to remember that it used to show up somewhere...

    In the hardware section my gateway/sensor node has 7 children with curious values:
    children.jpg
    How did that happen? I would expect to have three children there: S_Power, S_Custom and the S_Arduino_Node...

    S_Custom was an experiment to add a RSSI value (via "WiFi.RSSI()"). Didn't work though. I did get values for RSSI
    but couldn't figure out as what/how to send them to Domoticz. Any ideas here?

    Thanks everybody!
    Christoph

    Domoticz

  • Use sensors with serial output
    H hyla

    Hi,

    I'd like to connect my Smart Meter to Domoticz. I thought about using an ESP32 as a gateway/sensor combination.
    So. The ESP32 would have to run a serial port somehow which would receive the serial data from the smart meter
    (just 9600 Baud) and at the same time act as a gateway in the Mysensors environment.
    Is anyone aware of an example for that? I don't think I have to reinvent any wheels here. Life's short ;)

    Christoph

    Edit: A MySensors node, connected to a nearby gateway would probably work just as well...

    General Discussion

  • MySensors 2.3.1 released
    H hyla

    Hi,

    did some experiments: switched

    #define MY_RADIO_NRF24
    

    to

    #define MY_RADIO_RF24
    

    : no error. So my MySensors version seems to be okay.

    And then I changed the #warning in MyConfig.h into an #error and that actually did throw an error.

    So maybe it's got to do with warning levels? We are just not being displayed the warnings?
    And that's when I had a look at the settings for my Arduino IDE and found "none" for compiler warnings.
    And that was it ;)

    "Your monkey's got it right"
    :)

    Christoph

    Announcements

  • MySensors 2.3.1 released
    H hyla

    @skywatch said in MySensors 2.3.1 released:

    @mfalkvidd I am using arduino 1.8.7 on win10 and I do not see any message like you illustrated. I just tested it with the gateway sketch and it just compiles with no error or warning.

    With 'nrf' in the define the text is in black, removing the 'n' at the front and it turns light blue as a recognised entity. But either way it just compilies fine. I'm not complaining, just curious now ;)

    Hi,

    same thing here: Win10, Arduino 1.8.7, updated to Mysensors 2.3.1 and no warning:

    C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Christoph\AppData\Local\Arduino15\packages -hardware C:\Users\Christoph\Dropbox\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Christoph\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Christoph\Dropbox\Arduino\libraries -fqbn=arduino:avr:pro:cpu=16MHzatmega328 -ide-version=10807 -build-path C:\Users\CHRIST~1\AppData\Local\Temp\arduino_build_347589 -warnings=none -build-cache C:\Users\CHRIST~1\AppData\Local\Temp\arduino_cache_573993 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\Christoph\Desktop\TestMe\TestMe.ino
    C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Christoph\AppData\Local\Arduino15\packages -hardware C:\Users\Christoph\Dropbox\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Christoph\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Christoph\Dropbox\Arduino\libraries -fqbn=arduino:avr:pro:cpu=16MHzatmega328 -ide-version=10807 -build-path C:\Users\CHRIST~1\AppData\Local\Temp\arduino_build_347589 -warnings=none -build-cache C:\Users\CHRIST~1\AppData\Local\Temp\arduino_cache_573993 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\Christoph\Desktop\TestMe\TestMe.ino
    Using board 'pro' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
    Using core 'arduino' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
    Detecting libraries used...
    "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10807 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "C:\\Users\\CHRIST~1\\AppData\\Local\\Temp\\arduino_build_347589\\sketch\\TestMe.ino.cpp" -o nul
    "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10807 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "-IC:\\Users\\Christoph\\Dropbox\\Arduino\\libraries\\MySensors" "C:\\Users\\CHRIST~1\\AppData\\Local\\Temp\\arduino_build_347589\\sketch\\TestMe.ino.cpp" -o nul
    "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10807 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "-IC:\\Users\\Christoph\\Dropbox\\Arduino\\libraries\\MySensors" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src" "C:\\Users\\CHRIST~1\\AppData\\Local\\Temp\\arduino_build_347589\\sketch\\TestMe.ino.cpp" -o nul
    Using cached library dependencies for file: C:\Users\Christoph\Dropbox\Arduino\libraries\MySensors\MyASM.S
    Using cached library dependencies for file: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src\SPI.cpp
    Generating function prototypes...
    "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10807 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "-IC:\\Users\\Christoph\\Dropbox\\Arduino\\libraries\\MySensors" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src" "C:\\Users\\CHRIST~1\\AppData\\Local\\Temp\\arduino_build_347589\\sketch\\TestMe.ino.cpp" -o "C:\\Users\\CHRIST~1\\AppData\\Local\\Temp\\arduino_build_347589\\preproc\\ctags_target_for_gcc_minus_e.cpp"
    "C:\\Program Files (x86)\\Arduino\\tools-builder\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\Users\\CHRIST~1\\AppData\\Local\\Temp\\arduino_build_347589\\preproc\\ctags_target_for_gcc_minus_e.cpp"
    Compiling sketch...
    "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10807 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs" "-IC:\\Users\\Christoph\\Dropbox\\Arduino\\libraries\\MySensors" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src" "C:\\Users\\CHRIST~1\\AppData\\Local\\Temp\\arduino_build_347589\\sketch\\TestMe.ino.cpp" -o "C:\\Users\\CHRIST~1\\AppData\\Local\\Temp\\arduino_build_347589\\sketch\\TestMe.ino.cpp.o"
    Compiling libraries...
    Compiling library "MySensors"
    Using previously compiled file: C:\Users\CHRIST~1\AppData\Local\Temp\arduino_build_347589\libraries\MySensors\MyASM.S.o
    Compiling library "SPI"
    Using previously compiled file: C:\Users\CHRIST~1\AppData\Local\Temp\arduino_build_347589\libraries\SPI\SPI.cpp.o
    Compiling core...
    Using precompiled core: C:\Users\CHRIST~1\AppData\Local\Temp\arduino_cache_573993\core\core_arduino_avr_pro_cpu_16MHzatmega328_0c812875ac70eb4a9b385d8fb077f54c.a
    Linking everything together...
    "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o "C:\\Users\\CHRIST~1\\AppData\\Local\\Temp\\arduino_build_347589/TestMe.ino.elf" "C:\\Users\\CHRIST~1\\AppData\\Local\\Temp\\arduino_build_347589\\sketch\\TestMe.ino.cpp.o" "C:\\Users\\CHRIST~1\\AppData\\Local\\Temp\\arduino_build_347589\\libraries\\MySensors\\MyASM.S.o" "C:\\Users\\CHRIST~1\\AppData\\Local\\Temp\\arduino_build_347589\\libraries\\SPI\\SPI.cpp.o" "C:\\Users\\CHRIST~1\\AppData\\Local\\Temp\\arduino_build_347589/..\\arduino_cache_573993\\core\\core_arduino_avr_pro_cpu_16MHzatmega328_0c812875ac70eb4a9b385d8fb077f54c.a" "-LC:\\Users\\CHRIST~1\\AppData\\Local\\Temp\\arduino_build_347589" -lm
    "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "C:\\Users\\CHRIST~1\\AppData\\Local\\Temp\\arduino_build_347589/TestMe.ino.elf" "C:\\Users\\CHRIST~1\\AppData\\Local\\Temp\\arduino_build_347589/TestMe.ino.eep"
    "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-objcopy" -O ihex -R .eeprom "C:\\Users\\CHRIST~1\\AppData\\Local\\Temp\\arduino_build_347589/TestMe.ino.elf" "C:\\Users\\CHRIST~1\\AppData\\Local\\Temp\\arduino_build_347589/TestMe.ino.hex"
    Using library MySensors at version 2.3.1 in folder: C:\Users\Christoph\Dropbox\Arduino\libraries\MySensors 
    Using library SPI at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI 
    "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-size" -A "C:\\Users\\CHRIST~1\\AppData\\Local\\Temp\\arduino_build_347589/TestMe.ino.elf"
    Sketch uses 6096 bytes (19%) of program storage space. Maximum is 30720 bytes.
    Global variables use 322 bytes (15%) of dynamic memory, leaving 1726 bytes for local variables. Maximum is 2048 bytes.
    

    I do find the warning line in MySensors.h:

    // legacy - remove for 3.0.0
    /**
    * @def MY_RADIO_NRF24
    * @brief Define this to use a RF24-based radio transport for sensor network communication.
    * @deprecated This flag is deprecated and replaced by @ref MY_RADIO_RF24
    */
    #ifdef MY_RADIO_NRF24
    #warning MY_RADIO_NRF24 is deprecated, use MY_RADIO_RF24 instead.
    #undef MY_RADIO_NRF24
    #define MY_RADIO_RF24
    #endif
    

    I've got my sketches folder on Dropbox so there are potential traps there like additional copies of the MySensors folder and such but I can't find any.

    Christoph

    Announcements

  • Heltec esp32 LoRa oled
    H hyla

    Hi,

    I'm using above module for a LoRa gateway. Works, too ...
    Now, I'd like to display the data the gateway received via LoRa on the OLED-display.

    I can show some text on the display but can anyone tell me how to get the actual data onto
    the display?

    Christoph

    Hardware

  • Get status of connection
    H hyla

    @gohan Hi. I'm actually using it as a sensor node, not as a gateway. I need the WiFi function anyway to connect the sensor to another network device (KEBA Wallbox :) ) and in order not to make things too
    complicated I decided to connect this sensor to Domoticz as a gateway. I could also hook up an NRF module and use that but that would add complexity ;)

    Thing is, connecting a gateway to Domoticz can take a few minutes and sometimes it doesn't work at all.
    So in order to make sure I got the gateway reconnected properly after a nap I have to find out if and
    when reconnection happened. Is there any variable in the MySensors world that lets me find that out?

    Christoph

    Development esp8266 sleep

  • Get status of connection
    H hyla

    Hi,

    is it possible to determine the status of a sensor connect?

    I would like to use an ESP8266 module as a gateway/sensor. In order to save air traffic and battery
    I would put the sensor to sleep for most of the time. But I cannot put it to sleep if it hasn't sent its values
    yet, worse: gateway or sensor node may not even have connected yet to my controller.

    So, can I somehow get these informations from MySensors by code? I know of course that informations
    about this are sent to the terminal when debugging mode is used. But I've got no idea how to get this
    data... some variable somewhere I can check? How would You do something like that?

    Thanks,
    Christoph

    Development esp8266 sleep

  • Max. Number of Children?
    H hyla

    @gohan

    Yes, they are/were.
    Alas, case solved... I have lost a line of code somehow. Which in this case meant that
    presentation was done correctly but these "missing values" were never actually sent,
    thereby keepin Domoticz from accepting them (seems every parameter to be recognized
    must actually have been sent once).
    Anyway, sorry for bothering You and thanks again,

    Christoph

    Domoticz keba domoticz wallbox

  • Max. Number of Children?
    H hyla

    Hi,

    of the 35 CHILD_IDs that are presented in my code's "void(presentation)" only 25 are actually recognized as new devices in Domoticz's Setup/Devices menu. Those 25 devices can be properly
    added and appear under the "Utility" tab which is okay for now. The rest never shows up. Which is a
    pity because those values are the most needed ones ;)

    If I take a look at the gateway in Setup/Hardware/(my gate)/Setup I am shown 27 entries one of which
    is the ID 255 (S_ARDUINO_NODE). One is another child ID (32) that was seen recently but strangely
    is not shown in the list of new found devices.

    Ideas, anyone?

    Thanks,
    Christoph

    Domoticz keba domoticz wallbox

  • Max. Number of Children?
    H hyla

    Hi,

    does anybody here happen to know how many children per node are supported by Domoticz?
    I'm trying to get data from a KEBA wallbox into Domoticz. For that I am using an ESP8266 NodeMCU module which doubles as a gateway to Domoticz and a parser for the wallbox data which is sent by UDP.
    So far there are 33 children/values but during presentation only 25 of these are recognized by Domoticz.

    Is there a limit to the number of children per node? Or am I being stupid somehow?
    .And if there is indeed a limit: any easy work-around for this in MySensors?

    Thanks,
    Christoph

    Domoticz keba domoticz wallbox

  • KEBA sensor
    H hyla

    Hi everyone,

    got a brand new KEBA p30c wallbox and I'd like to introduce this into MySensors. Some general outlines...

    One can communicate with the KEBA by sending commands using the UDP protocol.
    I've decided to create a sensor which can read data from the wallbox by sending requests to and parse replies from the wallbox.
    In a final step this data could then be presented to a smart home server (which is Domoticz in my case).

    The data I am receiving is of a variety of different types like "time", "milliamps", "text" or "binary" among others.
    All in all, I guess I've got about 50 different variables to expect.

    So far I haven't gotten much. I chose a Mega 2560 and an Arduino Ethernet shield. The Mega is programmed as a gateway; there's no radio because the sole purpose of the device is to be the connection between KEBA and MySensors/Domoticz.
    Right now I can send a command to the wallbox, receive the answer, print that in the serial monitor and send some data to Domoticz.

    That's actually one of the many questions I've got :)

    What's the correct way to send text data?
    I am receiving a string of data from KEBA and -just for starters- would like to display the data as ASCII characters in Domotics. The data there is displayed by clicking on the "Log" button of my MySensors "text sensor").

    Some fragments:

    The data from KEBA is stored in array:

    char packetBuffer[UDP_MAX];      // buffer to hold incoming packet,
    
    MyMessage infoMsg(CHILD_ID_INFO, V_TEXT);
    

    and I present my sensor ...

    present(CHILD_ID_INFO, S_INFO);
    

    and then I send a string in "packetBuffer" ...

    send(infoMsg.set (packetBuffer, 1));
    

    What's the correct format for sending text here?
    If I omit the ",1" Domoticz gets but the first ASCII character which is a bracket.
    With a ",1", in Domoticz I get "7B" which is the hex code for said bracket.
    What would I have to do to get a real ASCII string displayed in the log file in Domoticz?

    Just in case anyone's interested :

    /**
     * The MySensors Arduino library handles the wireless radio link and protocol
     * between your home built sensors/actuators and HA controller of choice.
     * The sensors forms a self healing radio network with optional repeaters. Each
     * repeater and gateway builds a routing tables in EEPROM which keeps track of the
     * network topology allowing messages to be routed to nodes.
     *
     * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
     * Copyright (C) 2013-2015 Sensnology AB
     * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
     *
     * Documentation: http://www.mysensors.org
     * Support Forum: http://forum.mysensors.org
     *
     * This program is free software; you can redistribute it and/or
     * modify it under the terms of the GNU General Public License
     * version 2 as published by the Free Software Foundation.
     *
     *******************************
     *
     * REVISION HISTORY
     * Version 1.0 - Henrik EKblad
     * Contribution by a-lurker and Anticimex,
     * Contribution by Norbert Truchsess <norbert.truchsess@t-online.de>
     * Contribution by Tomas Hozza <thozza@gmail.com>
     */
    
    
    
    // Enable debug prints to serial monitor
    #define MY_DEBUG  
    
    // Enable gateway ethernet module type
    #define MY_GATEWAY_W5100
    
    // fixed IP address
    #define MY_IP_ADDRESS 192,168,2,159   // 
    
    // The port to keep open on node server mode / or port to contact in client mode
    #define MY_PORT 5003
    
    // MAC address
    #define MY_MAC_ADDRESS 0xDE, 0xAC, 0xBE, 0xEF, 0xFE, 0xEA 
    
    #include <Ethernet.h>
    #include <MySensors.h>
    #include <EthernetUdp.h>
    
    #define UDP_MAX 345               // just to test
    
    byte mac[] = {MY_MAC_ADDRESS}; 
    IPAddress ip(MY_IP_ADDRESS); 
    IPAddress remIP(192, 168, 2, 83);
    unsigned long localPort = 7090;     // local port to listen on
    unsigned long remPort = 7090;       // KEBA port to send to
    
    char packetBuffer[UDP_MAX];         // buffer to hold incoming packet,
    char  ReplyBuffer[] = "report 2";   // command to be sent to KEBA for testing
    
    // An EthernetUDP instance to let us send and receive packets over UDP
    EthernetUDP Udp;
    
    #define MY_NODE_ID 33                    // 
    #define SN "KEBA Wallbox"
    #define SV "2.00"
    
    // #define MY_PARENT_ID 0
    #define CHILD_ID_INFO 0
    
    MyMessage infoMsg(CHILD_ID_INFO, V_TEXT);
    
    void before()
    {
      
    }
    
    void presentation()
    {
      // Send the sketch version information to the gateway and Controller
      sendSketchInfo(SN, SV);
      present(CHILD_ID_INFO, S_INFO);
      wait(10);
    }
    
    void setup()
    {
      // start the Ethernet and UDP:
      Ethernet.begin(mac, ip);
      Udp.begin(localPort);
    
      Serial.begin(115200);
      Udp.remoteIP() = remIP;
    
      Serial.println("------------------------------------------");
      Serial.print("KEBA IP: ");
      Serial.println(remIP);
      Serial.print("KEBA Port: ");
      Serial.println(remPort);
      Serial.println("------------------------------------------");  
    }
    
    void loop()
    {
      getKEBA();
      delay( 20000);  // for testing purps
    }
    
    void getKEBA()
    {
      Udp.beginPacket(remIP, remPort);          
      Udp.write(ReplyBuffer);
      Udp.endPacket();
    
      int packetSize = Udp.parsePacket();
      if (packetSize)                           // if there's data available, read a packet
      {
        Serial.println("------------------------------------------");
        Serial.print("Received packet of size ");
        Serial.println(packetSize);
        Serial.print("From ");
        IPAddress remote = Udp.remoteIP();
        for (int i = 0; i < 4; i++)
        {
          Serial.print(remote[i], DEC);
          if (i < 3)
          {
            Serial.print(".");
          }
        }
        Serial.print(", port ");
        Serial.println(Udp.remotePort());
    
        // read the packet into packetBufffer
        Udp.read(packetBuffer, UDP_MAX);
        Serial.print("Contents: ");
        Serial.println(packetBuffer);
        send(infoMsg.set (packetBuffer, 1));
      }
      delay(10);  
    }
    
    void parseKEBA()
    {
      
    }
    
    

    Thanks for any input!

    Christoph

    Development

  • Ethernet Sensor
    H hyla

    Once again toying with this idea... I've got to connect to a device via Network (UDP).
    I'd like to do this with an Arduino Uno. It would have to listen to the Intranet, call for and
    parse incoming Messages and present the results to Domoticz as a MySensors sensor.

    If I remember correctly it is possible to have an Ethernet node also have sensor functions
    even it is not recommended. True? Can something like this be done? How? ;)

    Christoph

    Hardware

  • Strange behaviour in creating Nodes
    H hyla

    You say that Your sensors are identical. What about the software You're flashing into them?
    Put the software side by side and compare.
    And You'd probably get more answers if You'd add Your firmware to Your post since Your
    problem is almost certainly software related.

    Did You use the "beta" version of MySensors for all of Your sensors?

    What's Your problem with the additional child anyway? It won't change the sensor's performance
    (some of my sensors do that, some don't, no matter!"). And seriously, one can't have too many children ;)

    Bye,
    C.

    Domoticz

  • GATEWAYW5100 with 2.0 beta working?
    H hyla

    Hi,

    I'm experimenting with MySensors 2.0 beta and have reflashed my Ethernet gateway today.
    Which doesn't seem to work: I can't ping it from my windows machine. The gateway receives
    sensor data but the data doesn't get send to my Domoticz controller.

    The code I used is pure demo code (all Ichanged was the IP-address).

    One thing I did notice when looking at the debug output in Arduino's serial monitor:

    0;255;3;0;9;Starting gateway (RNNGA-, 2.0.0-beta)
    0;255;3;0;9;Radio init successful.
    IP: 0.0.0.0
    0;255;3;0;9;Init complete, id=0, parent=0, distance=0
    0;255;3;0;9;read: 11-11-0 s=255,c=3,t=0,pt=1,l=1,sg=0:86
    0;255;3;0;9;read: 11-11-0 s=0,c=1,t=0,pt=7,l=5,sg=0:19.9
    0;255;3;0;9;read: 11-11-0 s=1,c=1,t=38,pt=7,l=5,sg=0:5.8

    The IP address is given with 0.0.0.0 no matter what I enter.

    Is this code example ( GatewayW5100.ino ) supposed to be working at this time?

    Christoph

    Development

  • Raspberry Pi Ethernet Gateway
    H hyla

    @GertSanders Let me see if I got that right:
    You are using the Raspi as the controller for Domoticz and instead of adding a standard serial gateway You add the nrf24 module to the Raspi directly. True?
    If true that's close, but not close enough to what I need: I'd like to use the Raspi as an Ethernet Gateway that is detected
    as such by Domoticz. Can that be done with Your project or can one adapt Your stuff for that?

    Thanks,
    Christoph

    Development

  • Repeater Node via Ethernet?
    H hyla

    Okay, tried it today (with very little time). I found that inspite of changing the channel (from 76 to 77) all of my devices were listed under the new gateway.
    I then removed them all and after that I got the one device I had the channel changed on. But also one where I hadn't. I'll have to look into that again...
    In Wireshark I get messages on both channels but the one changed to channel 77 has got a "?" for the source. Is that supposed to happen? Anyway I'd have expected not to receive stuff for the other channel at all...

    Still, all very promising :)

    Christoph

    Hardware

  • Repeater Node via Ethernet?
    H hyla

    @mfalkvidd

    Let me get this straight: I could build another Ethernet gateway, place it in the cellar and my MySensors sensors would happily connect to it? What would be it's ID (my gateway right now is "0" of course) ? Won't the two gateways puzzle those sensors that can actually see both?
    Have You done this?

    Thanks. Very interesting.
    Christoph

    Hardware

  • Repeater trouble
    H hyla

    Hi,

    looking into the problem with my just occasionally working repeaters. Using Yveaux' sniffer I find that my repeater (13)keeps asking for a parent:
    13 255 mysensors 17 Cmd:INTERNAL, ReqAck:0, IsAck:0, Type:FIND_PARENT, Sns:255

    Occasionally this is answered:
    0 13 mysensors 18 Cmd:INTERNAL, ReqAck:0, IsAck:0, Type:FIND_PARENT_RESPONSE, Sns:255, Data:0 [BYTE]

    Nevertheless, repeater node 13 keeps asking ...

    An idea anyone? Repeater asks for parent, is answered but keeps asking?

    Thanks for any help,
    Christoph

    Hardware

  • Repeater Node via Ethernet?
    H hyla

    Hi,

    got problems with my Mysensors architecture. I'm living in a house with 3 1/2 floors. The controller, Domoticz on a Raspberry Pi and the Mysensors Ethernet gateway are on the top floor. The devices furthest away are in the cellar, some are outdoors. In order to reach my devices I've introduced repeater nodes, one on the top floor right outside the room with my controller/gateway. One two floors down in the cellar [side question: the idea is that the repeater in the cellar will connect to the repeater on the top floor which then connects the both of them to the gateway. Will this work at all? Has anyone got this running?]. Now, connection to these repeaters are happening rather infrequently: I've implemented simple clients in my repeaters which toggle a switch every few minutes the value of which is sent to the controller. Sometimes this value is updated correctly, sometimes there are long gaps. I'm using the antenna version of the nrf24 modules and robust power supplies. I've added condensators to the radio modules. As I said, sometimes it works, sometimes it doesn't.

    Since using this for a reliable system doesn't make sense/won't work I'm looking for other means to connect to my sensors. Since I've got "Ethernet over powerline" in the house I thought about creating a long range connection between gateway/controller and repeater nodes via Ethernet and then connect sensors locally via nrf24 modules. Could that be done? HAS anyone done that? What do I need for that?

    Help anyone? I'm losing patience finally ;) Two weeks ago I got a new gas meter which now COULD be connected to Mysensors and I can't get myself to do that because what's the use if I can't GET the data then?

    Thanks,
    Christoph

    Hardware

  • Reset problem with ethernet gateway and a sensor
    H hyla

    Hi,

    posted that on Domoticz, too...

    Strange thing here: I've got a MySensors sensor here (some variety of a temperature-humidity sensor).
    Gateway I'm using is the ethernet version. Whenever I reset my sensor the ethernet gateway resets too:

    2016-02-27 10:14:12.664 MySensors: Connection reset!
    2016-02-27 10:14:12.665 TCP: Reconnecting in 30 seconds...
    2016-02-27 10:14:37.607 Hardware Monitor: Fetching data (System sensors)
    2016-02-27 10:14:42.669 TCP: Reconnecting...
    2016-02-27 10:14:42.669 MySensors: connected to: 192.168.2.155:5003
    2016-02-27 10:14:43.670 MySensors: Gateway Ready...
    2016-02-27 10:14:43.670 MySensors: Gateway Version: 1.5.1
    2016-02-27 10:14:44.672 MySensors: Gateway Version: 1.5.1

    Each and every time.

    In the WireShark protocol this is reported:

    27 20.628064000 8 0 mysensors 20 Cmd:PRESENTATION, ReqAck:0, IsAck:0, Type:ARDUINO_NODE, Sns:255, Data:'1.5' [STRING]
    28 20.635184000 8 0 mysensors 18 Cmd:INTERNAL, ReqAck:0, IsAck:0, Type:CONFIG, Sns:255, Data:0 [BYTE]
    29 21.662740000 0 8 mysensors 18 Cmd:INTERNAL, ReqAck:0, IsAck:0, Type:CONFIG, Sns:255, Data:'M' [STRING]
    33 22.656000000 8 0 mysensors 25 Cmd:INTERNAL, ReqAck:0, IsAck:0, Type:SKETCH_NAME, Sns:255, Data:'Humidity' [STRING]
    34 22.658412000 8 0 mysensors 25 Cmd:INTERNAL, ReqAck:0, IsAck:0, Type:SKETCH_NAME, Sns:255, Data:'Humidity' [STRING]
    35 22.666184000 8 0 mysensors 21 Cmd:INTERNAL, ReqAck:0, IsAck:0, Type:SKETCH_VERSION, Sns:255, Data:'1.02' [STRING]
    36 22.673444000 8 0 mysensors 17 Cmd:PRESENTATION, ReqAck:0, IsAck:0, Type:HUM, Sns:0
    37 22.675600000 8 0 mysensors 17 Cmd:PRESENTATION, ReqAck:0, IsAck:0, Type:HUM, Sns:0
    38 22.682072000 8 0 mysensors 17 Cmd:PRESENTATION, ReqAck:0, IsAck:0, Type:TEMP, Sns:1
    39 22.684236000 8 0 mysensors 17 Cmd:PRESENTATION, ReqAck:0, IsAck:0, Type:TEMP, Sns:1
    40 24.701744000 8 0 mysensors 22 Cmd:SET, ReqAck:0, IsAck:0, Type:TEMP, Sns:1, Data:1102105856,000000 [FLOAT32]
    41 24.709544000 8 0 mysensors 22 Cmd:SET, ReqAck:0, IsAck:0, Type:HUM, Sns:0, Data:1109970176,000000 [FLOAT32]

    So the gateway seems to answer once (29) and then it resets.

    So far this type of sensor is the only one who does this.
    I do have another practically identical sensor who has the same effect. Both have worked before.
    Although I might have changed something in between. Other sensors work flawlessly...
    Electrically sensor and gateway are completely separated (sensor driven on a battery, gateway feeds on a 2A wall wart).
    The sensor is not detected (anymore).

    This is what I get from the serial port when connecting to that:

    send: 8-8-0-0 s=255,c=0,t=17,pt=0,l=3,sg=0,st=ok:1.5
    send: 8-8-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,st=ok:0
    read: 0-0-8 s=255,c=3,t=6,pt=0,l=1,sg=0:M
    sensor started, id=8, parent=0, distance=1
    send: 8-8-0-0 s=255,c=3,t=11,pt=0,l=8,sg=0,st=ok:Humidity
    send: 8-8-0-0 s=255,c=3,t=12,pt=0,l=4,sg=0,st=ok:1.02
    send: 8-8-0-0 s=0,c=0,t=7,pt=0,l=0,sg=0,st=ok:
    send: 8-8-0-0 s=1,c=0,t=6,pt=0,l=0,sg=0,st=ok:
    send: 8-8-0-0 s=1,c=1,t=0,pt=7,l=5,sg=0,st=ok:22.2
    T: 22.20
    send: 8-8-0-0 s=0,c=1,t=1,pt=7,l=5,sg=0,st=ok:41.8
    H: 41.80

    Any ideas?

    Thanks,

    Christoph

    Hardware
  • Login

  • Don't have an account? Register

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