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. Controllers
  3. FHEM
  4. Not getting Node ID assigned

Not getting Node ID assigned

Scheduled Pinned Locked Moved FHEM
11 Posts 3 Posters 5.7k Views 2 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.
  • bigalB Offline
    bigalB Offline
    bigal
    wrote on last edited by
    #2

    I still can't work this out. If i turn on inclusion-mode on the serial gateway I always get NODE ID 254 assigned. And if I add a second node it shares the same node id and I end up with attributes for many sensor type all in the same node. It lways gets named MYSENSOR_254. Pulling my hair out for 5 days now... can anyone help?

    1 Reply Last reply
    0
    • hekH Offline
      hekH Offline
      hek
      Admin
      wrote on last edited by
      #3

      Did you try asking for help over at the FHEM forum?

      1 Reply Last reply
      0
      • bigalB Offline
        bigalB Offline
        bigal
        wrote on last edited by
        #4

        I will try. I did Google searches but mostly answers are in German.

        m26872M 1 Reply Last reply
        0
        • bigalB bigal

          I will try. I did Google searches but mostly answers are in German.

          m26872M Offline
          m26872M Offline
          m26872
          Hardware Contributor
          wrote on last edited by m26872
          #5

          @bigal

          Use MySensors v1.4.2 in your gateway? I only use Ethernet (W5100) gateway so I can't test, but MySensors v1.5 and later isn't supported by Fhem yet AFAIK.

          Tried static Node IDs?

          Post your fhem.cfg, or at least the relevant parts.

          bigalB 1 Reply Last reply
          0
          • m26872M m26872

            @bigal

            Use MySensors v1.4.2 in your gateway? I only use Ethernet (W5100) gateway so I can't test, but MySensors v1.5 and later isn't supported by Fhem yet AFAIK.

            Tried static Node IDs?

            Post your fhem.cfg, or at least the relevant parts.

            bigalB Offline
            bigalB Offline
            bigal
            wrote on last edited by bigal
            #6

            Aha! I thought it might have been a gateway issue. Yes of course I am running ver 1.5 so I will try v1.4.2 and report back how it goes!
            In the meantime here are my configs.
            I have loaded the UV node information into Fhem but it still will not recognize the node.

            Here is my Fhem config.

            attr global userattr cmdIcon devStateIcon devStateStyle icon sortby webCmd widgetOverride
            attr global autoload_undefined_devices 1
            attr global logfile ./log/fhem-%Y-%m.log
            attr global modpath .
            attr global motd SecurityCheck:\
              \
            WEB,WEBphone,WEBtablet has no associated allowed device with basicAuth.\
            telnetPort has no associated allowed device with password/globalpassword.\
            \
            Restart FHEM for a new check if the problem is fixed,\
            or set the global attribute motd to none to supress this message.\
            
            attr global statefile ./log/fhem.save
            attr global updateInBackground 1
            attr global verbose 3
            
            define telnetPort telnet 7072 global
            
            define WEB FHEMWEB 8083 global
            
            define WEBphone FHEMWEB 8084 global
            attr WEBphone stylesheetPrefix smallscreen
            
            define WEBtablet FHEMWEB 8085 global
            attr WEBtablet stylesheetPrefix touchpad
            
            # Fake FileLog entry, to access the fhem log from FHEMWEB 
            define Logfile FileLog ./log/fhem-%Y-%m.log fakelog
            
            define autocreate autocreate
            attr autocreate filelog ./log/%NAME-%Y.log
            
            define eventTypes eventTypes ./log/eventTypes.txt
            
            # Disable this to avoid looking for new USB devices on startup
            define initialUsbCheck notify global:INITIALIZED usb create
            define gateway MYSENSORS /dev/ttyUSB0@57600
            attr gateway autocreate 1
            attr gateway first-sensorid 10
            attr gateway icon it_wireless_dcf77
            attr gateway stateFormat connection
            define UVSensor MYSENSORS_DEVICE 10
            attr UVSensor IODev gateway
            attr UVSensor mapReading_uv 0 uv
            attr UVSensor mode node
            attr UVSensor version 1.2
            

            And a standard UV mysensor Arduino code (no mods).

            /**
             * 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 - epierre
             * Contribution: bulldoglowell, gizmocuz
             * 
             * DESCRIPTION
             * Arduino UVM-30A
             * Index table taken from: http://www.elecrow.com/sensors-c-111/environment-c-111_112            
            /uv-sensor-moduleuvm30a-p-716.html
             * Because this table is pretty lineair, we can calculate a UVI with one decimal 
             *
             * Connect sensor:
             *
             *   +   >>> 5V
             *   -   >>> GND
             *   out >>> A0     
             * 
             * License: Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0)
             */
            
            #include <SPI.h>
            #include <MySensor.h>  
            #include <MySensor.h>  
            #include <SPI.h>
            
            #define UV_SENSOR_ANALOG_PIN 0
            
            #define CHILD_ID_UV 0
            
            unsigned long SLEEP_TIME = 30*1000; // Sleep time between reads (in milliseconds)
            
            MySensor gw;
            MyMessage uvMsg(CHILD_ID_UV, V_UV);
            
            unsigned long lastSend =0; 
            float uvIndex;
            float lastUV = -1;
            uint16_t uvIndexValue [12] = { 50, 227, 318, 408, 503, 606, 696, 795, 881, 976, 1079, 1170};
            
            void setup()  
            { 
              gw.begin();
            
              // Send the sketch version information to the gateway and Controller
              gw.sendSketchInfo("UV Sensor", "1.2");
            
              // Register all sensors to gateway (they will be created as child devices)
              gw.present(CHILD_ID_UV, S_UV);
            }
            
            void loop()      
            {
              unsigned long currentTime = millis();
            
              uint16_t uv = analogRead(UV_SENSOR_ANALOG_PIN);// Get UV value
              if (uv>1170)
                uv=1170;
            
              //Serial.print("UV Analog reading: ");
              //Serial.println(uv);
            
              int i;
              for (i = 0; i < 12; i++)
              {
                if (uv <= uvIndexValue[i]) 
                {
                  uvIndex = i;
                  break;
                }
              }
            
              //calculate 1 decimal if possible
              if (i>0) {
                float vRange=uvIndexValue[i]-uvIndexValue[i-1];
                float vCalc=uv-uvIndexValue[i-1];
                uvIndex+=(1.0/vRange)*vCalc-1.0;
              }
            
              //Serial.print("UVI: ");
              //Serial.println(uvIndex,2);
            
              //Send value to gateway if changed, or at least every 5 minutes
              if ((uvIndex != lastUV)||(currentTime-lastSend >= 5UL*60UL*1000UL)) {
                  lastSend=currentTime;
                  gw.send(uvMsg.set(uvIndex,2));
                  lastUV = uvIndex;
              }
            
              gw.sleep(SLEEP_TIME);
            

            }

            m26872M 2 Replies Last reply
            0
            • bigalB bigal

              Aha! I thought it might have been a gateway issue. Yes of course I am running ver 1.5 so I will try v1.4.2 and report back how it goes!
              In the meantime here are my configs.
              I have loaded the UV node information into Fhem but it still will not recognize the node.

              Here is my Fhem config.

              attr global userattr cmdIcon devStateIcon devStateStyle icon sortby webCmd widgetOverride
              attr global autoload_undefined_devices 1
              attr global logfile ./log/fhem-%Y-%m.log
              attr global modpath .
              attr global motd SecurityCheck:\
                \
              WEB,WEBphone,WEBtablet has no associated allowed device with basicAuth.\
              telnetPort has no associated allowed device with password/globalpassword.\
              \
              Restart FHEM for a new check if the problem is fixed,\
              or set the global attribute motd to none to supress this message.\
              
              attr global statefile ./log/fhem.save
              attr global updateInBackground 1
              attr global verbose 3
              
              define telnetPort telnet 7072 global
              
              define WEB FHEMWEB 8083 global
              
              define WEBphone FHEMWEB 8084 global
              attr WEBphone stylesheetPrefix smallscreen
              
              define WEBtablet FHEMWEB 8085 global
              attr WEBtablet stylesheetPrefix touchpad
              
              # Fake FileLog entry, to access the fhem log from FHEMWEB 
              define Logfile FileLog ./log/fhem-%Y-%m.log fakelog
              
              define autocreate autocreate
              attr autocreate filelog ./log/%NAME-%Y.log
              
              define eventTypes eventTypes ./log/eventTypes.txt
              
              # Disable this to avoid looking for new USB devices on startup
              define initialUsbCheck notify global:INITIALIZED usb create
              define gateway MYSENSORS /dev/ttyUSB0@57600
              attr gateway autocreate 1
              attr gateway first-sensorid 10
              attr gateway icon it_wireless_dcf77
              attr gateway stateFormat connection
              define UVSensor MYSENSORS_DEVICE 10
              attr UVSensor IODev gateway
              attr UVSensor mapReading_uv 0 uv
              attr UVSensor mode node
              attr UVSensor version 1.2
              

              And a standard UV mysensor Arduino code (no mods).

              /**
               * 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 - epierre
               * Contribution: bulldoglowell, gizmocuz
               * 
               * DESCRIPTION
               * Arduino UVM-30A
               * Index table taken from: http://www.elecrow.com/sensors-c-111/environment-c-111_112            
              /uv-sensor-moduleuvm30a-p-716.html
               * Because this table is pretty lineair, we can calculate a UVI with one decimal 
               *
               * Connect sensor:
               *
               *   +   >>> 5V
               *   -   >>> GND
               *   out >>> A0     
               * 
               * License: Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0)
               */
              
              #include <SPI.h>
              #include <MySensor.h>  
              #include <MySensor.h>  
              #include <SPI.h>
              
              #define UV_SENSOR_ANALOG_PIN 0
              
              #define CHILD_ID_UV 0
              
              unsigned long SLEEP_TIME = 30*1000; // Sleep time between reads (in milliseconds)
              
              MySensor gw;
              MyMessage uvMsg(CHILD_ID_UV, V_UV);
              
              unsigned long lastSend =0; 
              float uvIndex;
              float lastUV = -1;
              uint16_t uvIndexValue [12] = { 50, 227, 318, 408, 503, 606, 696, 795, 881, 976, 1079, 1170};
              
              void setup()  
              { 
                gw.begin();
              
                // Send the sketch version information to the gateway and Controller
                gw.sendSketchInfo("UV Sensor", "1.2");
              
                // Register all sensors to gateway (they will be created as child devices)
                gw.present(CHILD_ID_UV, S_UV);
              }
              
              void loop()      
              {
                unsigned long currentTime = millis();
              
                uint16_t uv = analogRead(UV_SENSOR_ANALOG_PIN);// Get UV value
                if (uv>1170)
                  uv=1170;
              
                //Serial.print("UV Analog reading: ");
                //Serial.println(uv);
              
                int i;
                for (i = 0; i < 12; i++)
                {
                  if (uv <= uvIndexValue[i]) 
                  {
                    uvIndex = i;
                    break;
                  }
                }
              
                //calculate 1 decimal if possible
                if (i>0) {
                  float vRange=uvIndexValue[i]-uvIndexValue[i-1];
                  float vCalc=uv-uvIndexValue[i-1];
                  uvIndex+=(1.0/vRange)*vCalc-1.0;
                }
              
                //Serial.print("UVI: ");
                //Serial.println(uvIndex,2);
              
                //Send value to gateway if changed, or at least every 5 minutes
                if ((uvIndex != lastUV)||(currentTime-lastSend >= 5UL*60UL*1000UL)) {
                    lastSend=currentTime;
                    gw.send(uvMsg.set(uvIndex,2));
                    lastUV = uvIndex;
                }
              
                gw.sleep(SLEEP_TIME);
              

              }

              m26872M Offline
              m26872M Offline
              m26872
              Hardware Contributor
              wrote on last edited by
              #7

              @bigal (Please indent your code by 4 spaces or 'tab', it will then show up in nice black boxes in your forum posts.)

              1 Reply Last reply
              0
              • bigalB bigal

                Aha! I thought it might have been a gateway issue. Yes of course I am running ver 1.5 so I will try v1.4.2 and report back how it goes!
                In the meantime here are my configs.
                I have loaded the UV node information into Fhem but it still will not recognize the node.

                Here is my Fhem config.

                attr global userattr cmdIcon devStateIcon devStateStyle icon sortby webCmd widgetOverride
                attr global autoload_undefined_devices 1
                attr global logfile ./log/fhem-%Y-%m.log
                attr global modpath .
                attr global motd SecurityCheck:\
                  \
                WEB,WEBphone,WEBtablet has no associated allowed device with basicAuth.\
                telnetPort has no associated allowed device with password/globalpassword.\
                \
                Restart FHEM for a new check if the problem is fixed,\
                or set the global attribute motd to none to supress this message.\
                
                attr global statefile ./log/fhem.save
                attr global updateInBackground 1
                attr global verbose 3
                
                define telnetPort telnet 7072 global
                
                define WEB FHEMWEB 8083 global
                
                define WEBphone FHEMWEB 8084 global
                attr WEBphone stylesheetPrefix smallscreen
                
                define WEBtablet FHEMWEB 8085 global
                attr WEBtablet stylesheetPrefix touchpad
                
                # Fake FileLog entry, to access the fhem log from FHEMWEB 
                define Logfile FileLog ./log/fhem-%Y-%m.log fakelog
                
                define autocreate autocreate
                attr autocreate filelog ./log/%NAME-%Y.log
                
                define eventTypes eventTypes ./log/eventTypes.txt
                
                # Disable this to avoid looking for new USB devices on startup
                define initialUsbCheck notify global:INITIALIZED usb create
                define gateway MYSENSORS /dev/ttyUSB0@57600
                attr gateway autocreate 1
                attr gateway first-sensorid 10
                attr gateway icon it_wireless_dcf77
                attr gateway stateFormat connection
                define UVSensor MYSENSORS_DEVICE 10
                attr UVSensor IODev gateway
                attr UVSensor mapReading_uv 0 uv
                attr UVSensor mode node
                attr UVSensor version 1.2
                

                And a standard UV mysensor Arduino code (no mods).

                /**
                 * 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 - epierre
                 * Contribution: bulldoglowell, gizmocuz
                 * 
                 * DESCRIPTION
                 * Arduino UVM-30A
                 * Index table taken from: http://www.elecrow.com/sensors-c-111/environment-c-111_112            
                /uv-sensor-moduleuvm30a-p-716.html
                 * Because this table is pretty lineair, we can calculate a UVI with one decimal 
                 *
                 * Connect sensor:
                 *
                 *   +   >>> 5V
                 *   -   >>> GND
                 *   out >>> A0     
                 * 
                 * License: Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0)
                 */
                
                #include <SPI.h>
                #include <MySensor.h>  
                #include <MySensor.h>  
                #include <SPI.h>
                
                #define UV_SENSOR_ANALOG_PIN 0
                
                #define CHILD_ID_UV 0
                
                unsigned long SLEEP_TIME = 30*1000; // Sleep time between reads (in milliseconds)
                
                MySensor gw;
                MyMessage uvMsg(CHILD_ID_UV, V_UV);
                
                unsigned long lastSend =0; 
                float uvIndex;
                float lastUV = -1;
                uint16_t uvIndexValue [12] = { 50, 227, 318, 408, 503, 606, 696, 795, 881, 976, 1079, 1170};
                
                void setup()  
                { 
                  gw.begin();
                
                  // Send the sketch version information to the gateway and Controller
                  gw.sendSketchInfo("UV Sensor", "1.2");
                
                  // Register all sensors to gateway (they will be created as child devices)
                  gw.present(CHILD_ID_UV, S_UV);
                }
                
                void loop()      
                {
                  unsigned long currentTime = millis();
                
                  uint16_t uv = analogRead(UV_SENSOR_ANALOG_PIN);// Get UV value
                  if (uv>1170)
                    uv=1170;
                
                  //Serial.print("UV Analog reading: ");
                  //Serial.println(uv);
                
                  int i;
                  for (i = 0; i < 12; i++)
                  {
                    if (uv <= uvIndexValue[i]) 
                    {
                      uvIndex = i;
                      break;
                    }
                  }
                
                  //calculate 1 decimal if possible
                  if (i>0) {
                    float vRange=uvIndexValue[i]-uvIndexValue[i-1];
                    float vCalc=uv-uvIndexValue[i-1];
                    uvIndex+=(1.0/vRange)*vCalc-1.0;
                  }
                
                  //Serial.print("UVI: ");
                  //Serial.println(uvIndex,2);
                
                  //Send value to gateway if changed, or at least every 5 minutes
                  if ((uvIndex != lastUV)||(currentTime-lastSend >= 5UL*60UL*1000UL)) {
                      lastSend=currentTime;
                      gw.send(uvMsg.set(uvIndex,2));
                      lastUV = uvIndex;
                  }
                
                  gw.sleep(SLEEP_TIME);
                

                }

                m26872M Offline
                m26872M Offline
                m26872
                Hardware Contributor
                wrote on last edited by
                #8

                @bigal Also, I think there can be issues with that particular UV-sensor sketch example. The gw.sleep() function stops timers and will make the millis() function hard to use.

                1 Reply Last reply
                0
                • bigalB Offline
                  bigalB Offline
                  bigal
                  wrote on last edited by
                  #9

                  Not concerned with bugs in the UV Sketch as I will make my own sketches once I get the controller to recognize the nodes.
                  My plan is to adapt some code to make tank level sensors and an analog (not pulse based) kWh meter. Also planning to control some pumps, so those will be outputs.
                  So should I use Arduino 1.4.2 for compiling code for Gateway and all the nodes, yes?

                  m26872M 1 Reply Last reply
                  0
                  • bigalB bigal

                    Not concerned with bugs in the UV Sketch as I will make my own sketches once I get the controller to recognize the nodes.
                    My plan is to adapt some code to make tank level sensors and an analog (not pulse based) kWh meter. Also planning to control some pumps, so those will be outputs.
                    So should I use Arduino 1.4.2 for compiling code for Gateway and all the nodes, yes?

                    m26872M Offline
                    m26872M Offline
                    m26872
                    Hardware Contributor
                    wrote on last edited by
                    #10

                    @bigal Only gateway. The nodes work fine on v1.5

                    1 Reply Last reply
                    0
                    • bigalB Offline
                      bigalB Offline
                      bigal
                      wrote on last edited by
                      #11

                      I just compiled the Gateway in the 1.4.2 Mysensors bundle. I compiled a LUX node and a Pressure node, but still no luck, I always get the nodes showing up as Node 254 and overwriting each other.
                      So seems my issue may not related to the Gateway Version.

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


                      22

                      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