AP+STA mode



  • Hi,

    how to use both AP + STA mode
    I can start wifi in STA_AP
    i then can send data to the server
    but what i must do in
    while true: loop to add possibility to connect to AP?

    e.g. in loop i do

    while true:
      s.send(xxx)
      sleep_ms(100) # is this totally block current main thread?
      machine.idle() # is this enought to gain control to AP?
    


  • @livius Great that is working. I believe it is something nasty/delays with the Win10 routing table. Careful on closed loop: if you have your laptop wired/lan connected on the same Wifi router and your laptop connected to WiPy.



  • @Colateral
    Tested - but i do not restart windows only disable wifi connection and reenable it after wipy changed to sta_ap mode and it work now :)
    Interesting that it work also if i now restart windows and during work change to sta_ap mode. It looks like this operation is needed only once per Windows...

    Thank you for tip about Windows issue - now i can change my dev comunication protocol strategy
    and have STA_AP instead changing from STA to AP and back to STA cycle :)



  • @Colateral
    No, i have not problem to connect to router (STA part).
    My problem is thet i can not connect to AP.

    I can send data from Wipy to server and i see Wipy on list of avaiable networks.
    But i can not connect to it at network step. FTP is the next step.

    sumarize
    If i run Wipy in WLAN.STA no problem to connect to router
    If i run Wipy in WLAN.AP no ptoblem to connect to Wipy from computer
    If i run Wipy in WLAN.STA_AP no problem to connect to router but problem with connecting to Wipy from computer.

    But i did not tried this step:

    I saw also that is working hazardous on WIndows10 ... you need to reboot computer in order to make it work.

    I will try it in the evening and back with results.
    if it's true there is a terrible piece of junk implemented in Windows



  • WLAN.init has to be called for for STA_AP providing AP cfg
    then WLAN.connect() has to be called to connect as STA to an external Wifispot. Don't try to call connect several times... use connect then disconnect to be sure that everything was released. Once connected, check your firewall.

    I saw also that is working hazardous on WIndows10 ... you need to reboot computer in order to make it work.



  • i also have problem in AP+STA mode stability (1.6.1 firmware)
    it looks like:

    I (4660107) wifi: bcn_timout,ap_probe_send_start
    [UID=24:0a:c4:00:6e:c2] 2162, 27, 35, 0
    I (4662608) wifi: ap_probe_send over, resett wifi status to disassoc
    I (4662609) wifi: state: run -> init (1)
    I (4662609) wifi: n:9 0, o:9 2, ap:9 2, sta:9 2, prof:9
    

Log in to reply
 

Pycom on Twitter