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. Troubleshooting
  3. Ethernet/WiFi-Client Gateway

Ethernet/WiFi-Client Gateway

Scheduled Pinned Locked Moved Troubleshooting
15 Posts 4 Posters 902 Views 3 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.
  • P Offline
    P Offline
    Peter Loeffler
    wrote on last edited by
    #1

    hi everyone

    I have a bunch of ESP32DEVKIT modules lying arround and want to use them with wifi (please no discussion about the seperation of wifi and sensors...thats a wifi with only sensors, no IP connection to the inetrent is possible).

    so following the istructions I thought I understand teh following:
    if definde MY_GATEWAY_ESP32 and an IP-address in MY_CONTROLLER_IP let's the "gateway" act as a "client" and would connect to the "controller" via tcp/5003.

    but fact is: there is no outgoing connect to the given p-address :(

    did I get something wrong ?

    cheers
    peter

    mfalkviddM 1 Reply Last reply
    0
    • P Peter Loeffler

      hi everyone

      I have a bunch of ESP32DEVKIT modules lying arround and want to use them with wifi (please no discussion about the seperation of wifi and sensors...thats a wifi with only sensors, no IP connection to the inetrent is possible).

      so following the istructions I thought I understand teh following:
      if definde MY_GATEWAY_ESP32 and an IP-address in MY_CONTROLLER_IP let's the "gateway" act as a "client" and would connect to the "controller" via tcp/5003.

      but fact is: there is no outgoing connect to the given p-address :(

      did I get something wrong ?

      cheers
      peter

      mfalkviddM Offline
      mfalkviddM Offline
      mfalkvidd
      Mod
      wrote on last edited by
      #2

      @peter-loeffler yes that should work. What does the debug output from the gateway say? Does it get an ip address (if using DHCP) / what settings are you using (if using static ip)? Is the controller on the same subnet or a different net?

      Did you set MY_CONTROLLER_IP (which doesn't exist) or did you set MY_CONTROLLER_IP_ADDRESS?

      P 1 Reply Last reply
      0
      • mfalkviddM mfalkvidd

        @peter-loeffler yes that should work. What does the debug output from the gateway say? Does it get an ip address (if using DHCP) / what settings are you using (if using static ip)? Is the controller on the same subnet or a different net?

        Did you set MY_CONTROLLER_IP (which doesn't exist) or did you set MY_CONTROLLER_IP_ADDRESS?

        P Offline
        P Offline
        Peter Loeffler
        wrote on last edited by
        #3

        @mfalkvidd sorry, my typo ... is did set MY_CONTROLLER_IP_ADDRESS ;)

        1 Reply Last reply
        0
        • P Offline
          P Offline
          Peter Loeffler
          wrote on last edited by
          #4

          UPDATE ... started with a completely empty example-sketch and ip-connection to the controller works, but: why is there no registration towards the controller?

          mfalkviddM 1 Reply Last reply
          0
          • P Peter Loeffler

            UPDATE ... started with a completely empty example-sketch and ip-connection to the controller works, but: why is there no registration towards the controller?

            mfalkviddM Offline
            mfalkviddM Offline
            mfalkvidd
            Mod
            wrote on last edited by mfalkvidd
            #5

            @peter-loeffler could you clarify what you mean by registration?

            P 1 Reply Last reply
            0
            • mfalkviddM mfalkvidd

              @peter-loeffler could you clarify what you mean by registration?

              P Offline
              P Offline
              Peter Loeffler
              wrote on last edited by
              #6

              @mfalkvidd I thought, that when a gateway is on client mode, it would connect to the controller, ask for a "outside_node_id" and present itself and the topology behind ...

              mfalkviddM 1 Reply Last reply
              0
              • P Peter Loeffler

                @mfalkvidd I thought, that when a gateway is on client mode, it would connect to the controller, ask for a "outside_node_id" and present itself and the topology behind ...

                mfalkviddM Offline
                mfalkviddM Offline
                mfalkvidd
                Mod
                wrote on last edited by mfalkvidd
                #7

                @peter-loeffler a MySensors gateway always has MySensors node id 0. I am not sure what you mean by "outside_node_id" but by default the gateway will not ask the controller for anything.

                If the gateway has local sensors, these sensors will be presented if you have added stuff to the present() function in the gateway sketch.

                If a MySensors node presents itself, the gateway will forward this presentation to the controller when the presentation is received by the gateway.

                The gateway will store no information except the MySensors routing table. (The routing table won't be shared with the controller.

                1 Reply Last reply
                0
                • CarywinC Offline
                  CarywinC Offline
                  Carywin
                  wrote on last edited by
                  #8

                  If you’re using sensors over wifi you don’t need MySensors, you can just use PubSubClient. MySensors is primarily for mesh network sensors not using wifi.

                  1 Reply Last reply
                  1
                  • scalzS Offline
                    scalzS Offline
                    scalz
                    Hardware Contributor
                    wrote on last edited by scalz
                    #9

                    note: MySensors is using tree network topology, not mesh.

                    I also agree with carywin comment, for wifi/ethernet nodes it's a lot more simple to use pubsub, or even using http calls/rest.

                    P 1 Reply Last reply
                    0
                    • scalzS scalz

                      note: MySensors is using tree network topology, not mesh.

                      I also agree with carywin comment, for wifi/ethernet nodes it's a lot more simple to use pubsub, or even using http calls/rest.

                      P Offline
                      P Offline
                      Peter Loeffler
                      wrote on last edited by Peter Loeffler
                      #10

                      @scalz more simple? I don't agree!
                      for example:
                      I have like 20 equal sensors /4way soilmoisture per greenhouse (40mx8m) ... in 12 houses overall. they would all come with the same topic-id...so: no way!

                      what I have built so far: wifi-ap with a telnetserver on 5003 that is bridget to a serial interface connected to an esp8266 gateway. The Idea was, that the esp32-gateways connect to that port and get rs485 nodes there.

                      so I resume: i have to do the tcp-transport stuff myself, when I want simple nodes to connect via TCP...

                      1 Reply Last reply
                      0
                      • scalzS Offline
                        scalzS Offline
                        scalz
                        Hardware Contributor
                        wrote on last edited by scalz
                        #11

                        @Peter-Loeffler
                        well just re-read what I said, and what infos you gave us ;)
                        even atm I still don't really get it, you're now talking about rs485, serial to esp8266.. but you started by telling us "I have a bunch of ESP32DEVKIT modules lying arround and want to use them with wifi" . not much more

                        mfalkvidd also explained that esp8266/32 can be used in gateway mode, and gateway id is 0.
                        I don't see why topic-id would be the same when using a dedicated mqtt, rest lib

                        what's the hw for the sensors nodes(I guess when you say 20 equal sensors you mean 20 nodes with 4 connected sensors per node)? gateways specs? your controller sw? the architecture (rs485, wifi, serial connections)? etc..
                        then maybe I hope we can help/guide you better

                        P 1 Reply Last reply
                        0
                        • scalzS scalz

                          @Peter-Loeffler
                          well just re-read what I said, and what infos you gave us ;)
                          even atm I still don't really get it, you're now talking about rs485, serial to esp8266.. but you started by telling us "I have a bunch of ESP32DEVKIT modules lying arround and want to use them with wifi" . not much more

                          mfalkvidd also explained that esp8266/32 can be used in gateway mode, and gateway id is 0.
                          I don't see why topic-id would be the same when using a dedicated mqtt, rest lib

                          what's the hw for the sensors nodes(I guess when you say 20 equal sensors you mean 20 nodes with 4 connected sensors per node)? gateways specs? your controller sw? the architecture (rs485, wifi, serial connections)? etc..
                          then maybe I hope we can help/guide you better

                          P Offline
                          P Offline
                          Peter Loeffler
                          wrote on last edited by Peter Loeffler
                          #12

                          @scalz

                          ok, maybe the sort version was not so easy to nderstand. I give the long version a try:
                          each of my big greenhouses will get the following quipment:
                          WemosMiniD1Pro --> MySensors ESP8266Gateway (Wifi of the "backbone") and MY_RS485 (reasons: external antenna connector, seperation of all the following from the "internet")

                          So Inside the greenhouse I could have 254 nodes comming from the RS485 side. that would make a cobweb of cables. So I decided to add a "wifi to serial bridge" aka esp8266 as WifI-AP (greenhouse-wifi), Telnetserver running on port 5003,sending everyting to serial1, where there is the mentioned Mini waiting.

                          when I now deploy 20 SoilMoisturesensors (in every greenhouse) I dont want to do a seperate code for each sensor eg to set topics etc.
                          they should connect to the telnetserver and act as nodes.
                          May Idea was to make them GATEWAY_ESP32 with clientmode. (what sounded to be a "client")

                          +*+
                          OpenHAB gets configured one mysensors-ethernetgateway per greenhouse and everything is done.

                          mfalkviddM 1 Reply Last reply
                          0
                          • P Peter Loeffler

                            @scalz

                            ok, maybe the sort version was not so easy to nderstand. I give the long version a try:
                            each of my big greenhouses will get the following quipment:
                            WemosMiniD1Pro --> MySensors ESP8266Gateway (Wifi of the "backbone") and MY_RS485 (reasons: external antenna connector, seperation of all the following from the "internet")

                            So Inside the greenhouse I could have 254 nodes comming from the RS485 side. that would make a cobweb of cables. So I decided to add a "wifi to serial bridge" aka esp8266 as WifI-AP (greenhouse-wifi), Telnetserver running on port 5003,sending everyting to serial1, where there is the mentioned Mini waiting.

                            when I now deploy 20 SoilMoisturesensors (in every greenhouse) I dont want to do a seperate code for each sensor eg to set topics etc.
                            they should connect to the telnetserver and act as nodes.
                            May Idea was to make them GATEWAY_ESP32 with clientmode. (what sounded to be a "client")

                            +*+
                            OpenHAB gets configured one mysensors-ethernetgateway per greenhouse and everything is done.

                            mfalkviddM Offline
                            mfalkviddM Offline
                            mfalkvidd
                            Mod
                            wrote on last edited by mfalkvidd
                            #13

                            @peter-loeffler you can set one of these in the gateway sketch to differentiate between the gateways:
                            MY_MQTT_CLIENT_ID
                            MY_MQTT_PUBLISH_TOPIC_PREFIX

                            I am not aware of any way a controller can supply a unique ID to a gateway unfortunately, but maybe the gateway<->controller interface can be extended to support that, so the gateway can set one of the above parameters.

                            An alternative might be to set the value of one of the above parameters using a custom/dummy "sensor" on the gateway (using V_TEXT perhaps)

                            P 1 Reply Last reply
                            0
                            • mfalkviddM mfalkvidd

                              @peter-loeffler you can set one of these in the gateway sketch to differentiate between the gateways:
                              MY_MQTT_CLIENT_ID
                              MY_MQTT_PUBLISH_TOPIC_PREFIX

                              I am not aware of any way a controller can supply a unique ID to a gateway unfortunately, but maybe the gateway<->controller interface can be extended to support that, so the gateway can set one of the above parameters.

                              An alternative might be to set the value of one of the above parameters using a custom/dummy "sensor" on the gateway (using V_TEXT perhaps)

                              P Offline
                              P Offline
                              Peter Loeffler
                              wrote on last edited by
                              #14

                              @mfalkvidd not the gateways ar the "problem" - the nodes inside are (in a way). I thought that a gateway in client mode would act as one...

                              but what I dont get: @scalz says its a "tree-topology" how would you be able to make tree, if the gateways dont bundly their nodes and forward it to the uplink ?

                              -----anyway----
                              a feature lik "MY_SERIALoverIP" would be cool anyway...or a ethernet-gateway that is worth the name ;)

                              mfalkviddM 1 Reply Last reply
                              0
                              • P Peter Loeffler

                                @mfalkvidd not the gateways ar the "problem" - the nodes inside are (in a way). I thought that a gateway in client mode would act as one...

                                but what I dont get: @scalz says its a "tree-topology" how would you be able to make tree, if the gateways dont bundly their nodes and forward it to the uplink ?

                                -----anyway----
                                a feature lik "MY_SERIALoverIP" would be cool anyway...or a ethernet-gateway that is worth the name ;)

                                mfalkviddM Offline
                                mfalkviddM Offline
                                mfalkvidd
                                Mod
                                wrote on last edited by
                                #15

                                Sorry, it seems like I have misunderstood what the problem is. Would you mind explaining the problem in a different way? Or maybe I should just step back and let someone else (who understands the problem) answer.

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


                                29

                                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