Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to discovery devices maybe in different net segment via UDP
QtWS25 Last Chance

How to discovery devices maybe in different net segment via UDP

Scheduled Pinned Locked Moved Unsolved General and Desktop
14 Posts 5 Posters 3.1k Views
  • 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.
  • brucezcgB brucezcg

    I had A PC and some devices connected to router, but I don't know the IP address of each device, May be not same net segment as my PC.
    So how can I discovery all devices please?

    I tried UDP broadcast, But if not same net segment, I cannot communicate with device via UDP.

    JKSHJ Offline
    JKSHJ Offline
    JKSH
    Moderators
    wrote on last edited by
    #2

    https://stackoverflow.com/questions/379015/udp-broadcast-packets-across-subnets

    Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

    1 Reply Last reply
    2
    • brucezcgB Offline
      brucezcgB Offline
      brucezcg
      wrote on last edited by
      #3

      Thanks.
      As UDP may be require router configure carefully, Is there other way to reslove this kind of problem.

      raven-worxR 1 Reply Last reply
      0
      • brucezcgB brucezcg

        Thanks.
        As UDP may be require router configure carefully, Is there other way to reslove this kind of problem.

        raven-worxR Offline
        raven-worxR Offline
        raven-worx
        Moderators
        wrote on last edited by
        #4

        @brucezcg
        i dont quite understand what you want to achieve.
        There is a reason why there is something like the subnet concept. It's intention exactly is that machines don't see each other across subnets!

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        brucezcgB 1 Reply Last reply
        5
        • raven-worxR raven-worx

          @brucezcg
          i dont quite understand what you want to achieve.
          There is a reason why there is something like the subnet concept. It's intention exactly is that machines don't see each other across subnets!

          brucezcgB Offline
          brucezcgB Offline
          brucezcg
          wrote on last edited by
          #5

          @raven-worx : Thanks.

          I have many devices (Smart Cameras) connected to my router, each camera have isolate IP address. I run my Application on my PC, In order to connect each camera, First I should Discovery all cameras connected to router. but may be cameras in different subnet.
          So If the camera IP:192.168.11.11
          My PC's IP:199.55.55.44

          How can I discovery the camera from my PC?

          raven-worxR JKSHJ 3 Replies Last reply
          0
          • brucezcgB brucezcg

            @raven-worx : Thanks.

            I have many devices (Smart Cameras) connected to my router, each camera have isolate IP address. I run my Application on my PC, In order to connect each camera, First I should Discovery all cameras connected to router. but may be cameras in different subnet.
            So If the camera IP:192.168.11.11
            My PC's IP:199.55.55.44

            How can I discovery the camera from my PC?

            raven-worxR Offline
            raven-worxR Offline
            raven-worx
            Moderators
            wrote on last edited by raven-worx
            #6

            @brucezcg
            why are they in a different subnet in the first place?!
            Are they connected to the same router? Don't they get their IPs from the same DHCP?

            I don't see any chance getting them accessible, when the subnet mask prevents it.

            --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
            If you have a question please use the forum so others can benefit from the solution in the future

            brucezcgB 1 Reply Last reply
            2
            • brucezcgB brucezcg

              @raven-worx : Thanks.

              I have many devices (Smart Cameras) connected to my router, each camera have isolate IP address. I run my Application on my PC, In order to connect each camera, First I should Discovery all cameras connected to router. but may be cameras in different subnet.
              So If the camera IP:192.168.11.11
              My PC's IP:199.55.55.44

              How can I discovery the camera from my PC?

              JKSHJ Offline
              JKSHJ Offline
              JKSH
              Moderators
              wrote on last edited by
              #7

              @brucezcg said in How to discovery devices maybe in different net segment via UDP:

              I have many devices (Smart Cameras) connected to my router, each camera have isolate IP address.... but may be cameras in different subnet.

              You should put all cameras and your PC on the same subnet. Usually, people give all devices Static IP addresses OR they enable DHCP (like @raven-worx said). With DHCP, your router automatically puts all cameras and your PC on the same subnet.

              How can I discovery the camera from my PC?

              If they are on different subnets, then you probably cannot discover them.

              Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

              1 Reply Last reply
              3
              • brucezcgB brucezcg

                @raven-worx : Thanks.

                I have many devices (Smart Cameras) connected to my router, each camera have isolate IP address. I run my Application on my PC, In order to connect each camera, First I should Discovery all cameras connected to router. but may be cameras in different subnet.
                So If the camera IP:192.168.11.11
                My PC's IP:199.55.55.44

                How can I discovery the camera from my PC?

                raven-worxR Offline
                raven-worxR Offline
                raven-worx
                Moderators
                wrote on last edited by
                #8

                @brucezcg said in How to discovery devices maybe in different net segment via UDP:

                My PC's IP:199.55.55.44

                btw this IP isn't even in the private IP range. So why has your PC such an IP address assigned?!

                --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                If you have a question please use the forum so others can benefit from the solution in the future

                1 Reply Last reply
                1
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #9

                  Hi,

                  To add to my fellow, are you camera using zeroconf or something similar to advertise their presence ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  brucezcgB 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    Hi,

                    To add to my fellow, are you camera using zeroconf or something similar to advertise their presence ?

                    brucezcgB Offline
                    brucezcgB Offline
                    brucezcg
                    wrote on last edited by
                    #10

                    @SGaist The camera will not inform its exist. they work alone, so I want to use UDP/ARP to discover them

                    1 Reply Last reply
                    0
                    • raven-worxR raven-worx

                      @brucezcg
                      why are they in a different subnet in the first place?!
                      Are they connected to the same router? Don't they get their IPs from the same DHCP?

                      I don't see any chance getting them accessible, when the subnet mask prevents it.

                      brucezcgB Offline
                      brucezcgB Offline
                      brucezcg
                      wrote on last edited by
                      #11

                      @raven-worx The camera may be work in static IP address mode, so If someone change the IP to different subnet, How can I know?

                      raven-worxR 1 Reply Last reply
                      0
                      • brucezcgB brucezcg

                        @raven-worx The camera may be work in static IP address mode, so If someone change the IP to different subnet, How can I know?

                        raven-worxR Offline
                        raven-worxR Offline
                        raven-worx
                        Moderators
                        wrote on last edited by raven-worx
                        #12

                        @brucezcg said in How to discovery devices maybe in different net segment via UDP:

                        The camera may be work in static IP address mode, so If someone change the IP to different subnet, How can I know?

                        as i said. if they are configured to be in a different subnet you won't have a chance to discover them, because only devices in the same subnet. The subnet range is determined by the subnet mask.

                        You want to use UDP to discover them. Do you even know if they would respond to your UDP request?
                        I mean do you know for sure that the camera lets it self discover by listening to a UDP network request - provides a service to do so?

                        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                        If you have a question please use the forum so others can benefit from the solution in the future

                        1 Reply Last reply
                        5
                        • brucezcgB Offline
                          brucezcgB Offline
                          brucezcg
                          wrote on last edited by
                          #13

                          Is there any good ideas?

                          1 Reply Last reply
                          0
                          • VRoninV Offline
                            VRoninV Offline
                            VRonin
                            wrote on last edited by
                            #14

                            The standard way is a known central location. A "server" (using the term very loosely here) that both cameras and PCs know about. Cameras will connect to it and tell it their IP, PC will connect to it to retrieve the list of registered cameras

                            "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
                            ~Napoleon Bonaparte

                            On a crusade to banish setIndexWidget() from the holy land of Qt

                            1 Reply Last reply
                            1

                            • Login

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • Users
                            • Groups
                            • Search
                            • Get Qt Extensions
                            • Unsolved