Is routing possible in STA_AP mode?



  • 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.



  • @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?



  • 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.



  • @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.



  • 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..



  • @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.



  • @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



  • @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.



  • 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.


Log in to reply
 

Pycom on Twitter