Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Is routing possible in STA_AP mode?

    Scheduled Pinned Locked Moved LoPy
    9 Posts 3 Posters 64 Views 3 Watching
    Loading More Posts
    • 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.
    • T Offline
      Thierry
      last edited by Thierry

      Hello,
      Is it possible to make the LoPy as a mini-router beetween a station in the AP network and another one in the STA network?
      Very simple tests do not work.
      Thanks.

      J 1 Reply Last reply Reply Quote 0
      • G Offline
        Gijs
        last edited by

        Hi,
        The LoPy only has 1 WiFi radio, meaning that you will have to keep switching between the modes and cannot operate as a STA and AP at the same time. Because of this, it is not very useful as a transparent bridge.
        The main feature (where I think STA_AP is useful), is the ability of the device to scan for SSIDs while other stations can connect to its AP. I would not recommend using it to pass large amounts of data.

        T 1 Reply Last reply Reply Quote 0
        • T Offline
          Thierry @Gijs
          last edited by

          @Gijs
          "The LoPy only has 1 WiFi radio, meaning that you will have to keep switching between the modes and cannot operate as a STA and AP at the same time. "

          Nevertheless, using the STA_AP mode, I managed to make an AP while picking an IP address from my own AP. I agree, this is strange for a device with only 1 WiFi radio.

          "Because of this, it is not very useful as a transparent bridge."
          And indeed, it does not work.

          "The main feature (where I think STA_AP is useful), is the ability of the device to scan for SSIDs while other stations can connect to its AP. I would not recommend using it to pass large amounts of data."
          This sounds good.

          Thanks.

          1 Reply Last reply Reply Quote 0
          • G Offline
            Gijs
            last edited by

            @Thierry said in Is routing possible in STA_AP mode?:

            Nevertheless, using the STA_AP mode, I managed to make an AP while picking an IP address from my own AP. I agree, this is strange for a device with only 1 WiFi radio.

            That is indeed quite odd. I have never been able (and I hope that is a good thing) to pick up the AP's own signal on a scan operation.

            In theory, you could connect 2 Lopy's over UART and make a 'transparent' bridge that way, altough it would be quite a hassle and you'd be off cheaper and better with a commercial solution ;)

            Gijs

            T 1 Reply Last reply Reply Quote 1
            • T Offline
              Thierry @Gijs
              last edited by

              @Gijs
              "In theory, you could connect 2 Lopy's over UART and make a 'transparent' bridge that way, altough it would be quite a hassle and you'd be off cheaper and better with a commercial solution ;)"
              Probably right but a bit heavy :-)

              "That is indeed quite odd."
              Odd but interesting to provide a configuration interface. But not sure it works.

              "I have never been able (and I hope that is a good thing) to pick up the AP's own signal on a scan operation."
              Right, a scan on the lopy does not show the local AP.

              1 Reply Last reply Reply Quote 1
              • G Offline
                Gijs
                last edited by

                Ah sorry, I misunderstood. You mean you can connect to your router's AP with a Lopy, while also providing an AP on the Lopy? Im guessing that could indeed work, but not very reliably..

                T 1 Reply Last reply Reply Quote 0
                • T Offline
                  Thierry @Gijs
                  last edited by

                  @Gijs Sorrry for my bad english :-/

                  But this time you understood me :-)

                  The next challenge is to understand how to manage sockets.
                  The link between sockets and interfaces is not clear for me. But as there is just one interface may be simple.

                  1 Reply Last reply Reply Quote 0
                  • G Offline
                    Gijs
                    last edited by

                    For the sockets its a little more complicated. All INET interfaces (WLAN and LTE) use the same socket interface. Im not exactly sure what happens if you want to use one socket on the AP and one socket on the STA mode, as there is no specific way to assign them. (Also I do not know exactly what will happen for using WLAN and LTE simultaneously, I think that is a more common usecase). LoRa and SigFox sockets do not suffer from this 'problem' as they use a different method alltogether.

                    1 Reply Last reply Reply Quote 0
                    • J Offline
                      jcaron @Thierry
                      last edited by

                      @Thierry See https://esp32.com/viewtopic.php?t=9#p43120 for a discussion on the subject (note that this would be routing, not bridging).

                      It seems you would need to recompile the firmware with different ESP-IDF settings, and there are some limitations due to limited routing capabilities (I'm not even sure how the default route would be set?).

                      An alternative would be to do this on a higher layer, by running a proxy on the module to relay traffic. Depending on what exactly you are trying to achieve (raw TCP, raw UDP, HTTP, HTTPS...) there could be a number of options to achieve that.

                      What exactly is your intended setup and what are you trying to forward?

                      1 Reply Last reply Reply Quote 0

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better 💗

                      Register Login
                      • 1 / 1
                      • First post
                        Last post

                      Pycom on Twitter

                      Pycom