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

    connect 2 wipy2.0 by WiFi

    Scheduled Pinned Locked Moved WiPy 2&3
    17 Posts 3 Posters 5.8k 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.
    • A Offline
      abilio @livius
      last edited by

      @livius. I'm going to run some tests later and come back to you with a result.

      1 Reply Last reply Reply Quote 1
      • A Offline
        abilio @livius
        last edited by

        @livius, I tried something similar to your setup, and wasn't able to reproduce it. Using two LoPys (internally just a WiPy with the LoRa radio attached), I proceed to connect over serial port to both. Did this in one of them over the REPL:

        from network import WLAN
        
        wlan = WLAN(mode=WLAN.STA)
        nets = wlan.scan() # just to get a list
        print(str(nets))
        
        wlan.connect(ssid='lopy-wlan-be54', auth=(WLAN.WPA2, 'www.pycom.io')) # put your ssid here
        
        # waited for a few seconds (counted to 10)
        wlan.isconnected() # this printed true
        

        That's the most trivial test I could run. To rule out some possible causes, I want to ask you to try the same, using your own ssid, over serial REPL, and come back with the results to me.

        PS: I also tried the version with the loop, and it worked the way it's supposed

        1 Reply Last reply Reply Quote 0
        • L Offline
          livius
          last edited by

          testet from REPL - result are near to positive

          >>> import os
          >>> os.uname()
          (sysname='WiPy', nodename='WiPy', release='0.9.6.b1', version='v1.8.6-40-gd10463e on 2016-11-25', machine='WiPy with ESP32')
          >>> from network import WLAN
          >>> wlan = WLAN(mode=WLAN.STA)
          mode : sta(24:0a:c4:00:a8:be)
          >>> nets = wlan.scan()
          >>> print(str(nets))
          [(ssid='UPC0838976', bssid=b'\x8c\x04\xff\xf5\xae\x8a', sec=4, channel=1, rssi=-42), (ssid='wipy-wlan-6ec2', bssid=b'$\n\xc4\x00n\xc3', sec=3, channel=6, rssi=-42), (ssid='UPC Wi-Free', bssid=b'\x8e\x04\xff\xf5\xae\x8c', sec=5, channel=1, rssi=-44), (ssid='vnet-509F64', bssid=b'pT\xd2b\xc4\xda', sec=4, channel=11, rssi=-49), (ssid='livius', bssid=b'\x000O\x8b\x0c\x08', sec=4, channel=9, rssi=-50), (ssid='2.4G-Vectra-WiFi-B7C11C', bssid=b'\x84\x00-  <', sec=4, channel=1, rssi=-65), (ssid='2.4G-vnet-1C0A58', bssid=b't\x85*3 \xd7', sec=4, channel=1, rssi=-75), (ssid='UPC1387285', bssid=b'\x8c\x04\xff{bL', sec=4, channel=1, rssi=-79), (ssid='UPC Wi-Free', bssid=b'\x8e\x04\xff{bN', sec=5, channel=1, rssi=-80), (ssid='TP-LINK_9A6D1E', bssid=b'\xb0Hz\x9am\x1e', sec=3, channel=1, rssi=-80), (ssid='keke', bssid=b'\xb0Hz\xbe\xf6\xa4', sec=3, channel=4, rssi=-84), (ssid='Misza', bssid=b'\x00\x1d~\x91]\x07', sec=3, channel=6, rssi=-88), (ssid='vnet-A6EA06', bssid=b'\x0cT\xa5E*\xc9', sec=4, channel=11, rssi=-88), (ssid='vnet-EC0D8E', bssid=b'T\xbe\xf7\nEN', sec=4, channel=11, rssi=-88), (ssid='UPC Wi-Free', bssid=b'\x02&$>\xaa\x9b', sec=5, channel=7, rssi=-90)]
          >>> wlan.connect(ssid='wipy-wlan-6ec2', auth=(WLAN.WPA2, 'www.pycom.io'))
          >>> I (283825) wifi: n:6 1, o:6 0, ap:255 255, sta:6 1, prof:6
          I (284800) wifi: state: 0 -> 2 (b0)
          I (284804) wifi: state: 2 -> 3 (0)
          I (284820) wifi: state: 3 -> 5 (10)
          I (284836) wifi: connected with wipy-wlan-6ec2, channel 6
          wlan.isconnected()
          True
          >>> 
          

          but here we have different timings between commands - in real script i have not pauses between commands as i have b etween typing by REPL

          and as you can see above there is same but only once response with lines:

          >>> I (283825) wifi: n:6 1, o:6 0, ap:255 255, sta:6 1, prof:6
          I (284800) wifi: state: 0 -> 2 (b0)
          I (284804) wifi: state: 2 -> 3 (0)
          I (284820) wifi: state: 3 -> 5 (10)
          

          think about people first, then computers

          A 1 Reply Last reply Reply Quote 0
          • A Offline
            abilio @livius
            last edited by

            @livius, ok, at least we know you get similar results to me. Let me try again to reproduce yours. Thanks a lot for your feedback.

            1 Reply Last reply Reply Quote 0
            • L Offline
              livius
              last edited by

              i can provide you my files
              if you will be unable to reproduce issue

              think about people first, then computers

              A 1 Reply Last reply Reply Quote 0
              • A Offline
                abilio @livius
                last edited by

                @livius, I've been caught in several things but I didn't forget you. If you can place your code in pastebin and pass the link, that will let us reproduce it perfectly ;)

                1 Reply Last reply Reply Quote 0
                • L Offline
                  livius
                  last edited by livius

                  the files are:
                  http://konwertuj.com/content/main.py.txt
                  http://konwertuj.com/content/boot.py.txt
                  http://konwertuj.com/content/wifi_sta.py.txt
                  http://konwertuj.com/content/wifi_ap.py.txt

                  remove .txt extension after download

                  think about people first, then computers

                  1 Reply Last reply Reply Quote 0
                  • L Offline
                    livius
                    last edited by

                    with newest firmware 9.7 same

                    UPC1334070
                    I (6398) wifi: n:6 1, o:6 0, ap:255 255, sta:6 1, prof:6
                    I (7374) wifi: state: 0 -> 2 (b0)
                    I (7376) wifi: state: 2 -> 3 (0)
                    I (7380) wifi: state: 3 -> 5 (10)
                    I (17381) wifi: state: 5 -> 0 (2)
                    I (17381) wifi: n:6 0, o:6 1, ap:255 255, sta:6 1, prof:6
                    I (17502) wifi: n:6 1, o:6 0, ap:255 255, sta:6 1, prof:6
                    I (17503) wifi: state: 0 -> 2 (b0)
                    I (17504) wifi: state: 2 -> 3 (0)
                    I (17507) wifi: state: 3 -> 5 (10)
                    I (27508) wifi: state: 5 -> 0 (2)
                    

                    and this is on WiPy in AP mode

                    I (1018844) wifi: station: 24:0a:c4:00:a8:be leave, AID = 1
                    I (1018844) wifi: n:6 1, o:6 1, ap:6 1, sta:255 255, prof:6
                    I (1018982) wifi: n:6 1, o:6 1, ap:6 1, sta:255 255, prof:6
                    I (1018982) wifi: station: 24:0a:c4:00:a8:be join, AID = 1, n, 40U
                    I (1028985) wifi: station: 24:0a:c4:00:a8:be leave, AID = 1
                    I (1028986) wifi: n:6 1, o:6 1, ap:6 1, sta:255 255, prof:6
                    I (1029109) wifi: n:6 1, o:6 1, ap:6 1, sta:255 255, prof:6
                    I (1029109) wifi: station: 24:0a:c4:00:a8:be join, AID = 1, n, 40U
                    

                    think about people first, then computers

                    1 Reply Last reply Reply Quote 0
                    • L Offline
                      livius
                      last edited by livius

                      this is what i got when i added sleep_ms(100) between every commands
                      maybe this is much more informative (file name - wdev.c)

                      rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
                      configsip: 0, SPIWP:0x00
                      clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
                      mode:QIO, clock div:2
                      load:0x3fff9010,len:8
                      load:0x3fff9018,len:812
                      ho 0 tail 12 room 4
                      load:0x40078000,len:3692
                      load:0x4009f000,len:944
                      entry 0x4009f1f0
                      rtc v134 Oct 20 2016 12:36:18
                      XTAL 40M
                      I (858) phy: phy_version: 246, Nov 18 2016, 17:30:07, 0, 0
                      
                      tcpip_task_hdlxxx : 3ffdf30c, prio:18,stack:2048
                      frc2_timer_task_hdl:3ffdfe14, prio:22, stack:2048
                      I (1005) wifi: pp_task_hdl : 3ffeb6cc, prio:23, stack:8192
                      wdev.c 1327
                      

                      and wipy hang totally
                      but after manual restart same info as before:

                      I (67836) wifi: state: 5 -> 0 (2)
                      I (67836) wifi: n:6 0, o:6 1, ap:255 255, sta:6 1, prof:6
                      I (67957) wifi: n:6 1, o:6 0, ap:255 255, sta:6 1, prof:6
                      I (67958) wifi: state: 0 -> 2 (b0)
                      I (67962) wifi: state: 2 -> 3 (0)
                      I (67998) wifi: state: 3 -> 5 (10)
                      

                      think about people first, then computers

                      A 1 Reply Last reply Reply Quote 0
                      • A Offline
                        abilio @livius
                        last edited by

                        @livius, thanks for your status update. We're still looking into this issue. I'll come back at you when I get more information.

                        1 Reply Last reply Reply Quote 0
                        • L Offline
                          livius
                          last edited by livius

                          with newest firmware still the same :(

                          >>> os.uname()
                          (sysname='WiPy', nodename='WiPy', release='1.0.0.b1', version='v1.8.6-251-g2fb950d on 2016-12-16', machine='WiPy with ESP32')
                          
                          rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
                          configsip: 0, SPIWP:0x00
                          clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
                          mode:QIO, clock div:2
                          load:0x3fff9010,len:8
                          load:0x3fff9018,len:812
                          ho 0 tail 12 room 4
                          load:0x40078000,len:3692
                          load:0x4009f000,len:944
                          entry 0x4009f1f0
                          tcpip_task_hdlxxx : 3ffedb2c, prio:18,stack:2048
                          I (2440) wifi: frc2_timer_task_hdl:3ffef74c, prio:22, stack:2048
                          I (2451) wifi: pp_task_hdl : 3fff20c8, prio:23, stack:8192
                          I (3427) wifi: mode : softAP (24:0a:c4:00:a8:bf)
                          dhcp server start:(ip: 192.168.4.1, mask: 255.255.255.0, gw: 192.168.4.1)
                          wifi_sta
                          I (3613) wifi: mode : sta (24:0a:c4:00:a8:be)
                          vnet-509F64
                          wipy-wlan-6ec2
                          SoftAP-9F
                          UPC0838976
                          UPC Wi-Free
                          2.4G-vnet-1C0A58
                          TP-LINK_9A6D1E
                          keke
                          UPC Wi-Free
                          2.4G-Vectra-WiFi-B7C11C
                          DIRECT-y6-BRAVIA
                          UPC0040392
                          UPC Wi-Free
                          vnet-EC0D8E
                          I (7001) wifi: n:6 1, o:6 0, ap:255 255, sta:6 1, prof:6
                          I (7977) wifi: state: init -> auth (b0)
                          I (7983) wifi: state: auth -> assoc (0)
                          I (7989) wifi: state: assoc -> run (10)
                          I (17989) wifi: state: run -> init (2)
                          I (17990) wifi: n:6 0, o:6 1, ap:255 255, sta:6 1, prof:6
                          I (18111) wifi: n:6 1, o:6 0, ap:255 255, sta:6 1, prof:6
                          I (18111) wifi: state: init -> auth (b0)
                          I (18113) wifi: state: auth -> assoc (0)
                          I (18128) wifi: state: assoc -> run (10)
                          I (28128) wifi: state: run -> init (2)
                          I (28129) wifi: n:6 0, o:6 1, ap:255 255, sta:6 1, prof:6
                          I (28250) wifi: n:6 1, o:6 0, ap:255 255, sta:6 1, prof:6
                          I (28250) wifi: state: init -> auth (b0)
                          I (28255) wifi: state: auth -> assoc (0)
                          I (28269) wifi: state: assoc -> run (10)
                          I (38269) wifi: state: run -> init (2)
                          I (38270) wifi: n:6 0, o:6 1, ap:255 255, sta:6 1, prof:6
                          I (38391) wifi: n:6 1, o:6 0, ap:255 255, sta:6 1, prof:6
                          I (38392) wifi: state: init -> auth (b0)
                          I (38396) wifi: state: auth -> assoc (0)
                          I (38404) wifi: state: assoc -> run (10)
                          I (48404) wifi: state: run -> init (2)
                          I (48404) wifi: n:6 0, o:6 1, ap:255 255, sta:6 1, prof:6
                          I (48526) wifi: n:6 1, o:6 0, ap:255 255, sta:6 1, prof:6
                          I (48526) wifi: state: init -> auth (b0)
                          I (48528) wifi: state: auth -> assoc (0)
                          I (48545) wifi: state: assoc -> run (10)
                          I (58546) wifi: state: run -> init (2)
                          I (58546) wifi: n:6 0, o:6 1, ap:255 255, sta:6 1, prof:6
                          I (58667) wifi: n:6 1, o:6 0, ap:255 255, sta:6 1, prof:6
                          I (58668) wifi: state: init -> auth (b0)
                          I (58673) wifi: state: auth -> assoc (0)
                          I (58677) wifi: state: assoc -> run (10)
                          I (68677) wifi: state: run -> init (2)
                          I (68678) wifi: n:6 0, o:6 1, ap:255 255, sta:6 1, prof:6
                          I (68799) wifi: n:6 1, o:6 0, ap:255 255, sta:6 1, prof:6
                          I (68800) wifi: state: init -> auth (b0)
                          I (68802) wifi: state: auth -> assoc (0)
                          I (68808) wifi: state: assoc -> run (10)
                          I (78809) wifi: state: run -> init (2)
                          I (78809) wifi: n:6 0, o:6 1, ap:255 255, sta:6 1, prof:6
                          I (78930) wifi: n:6 1, o:6 0, ap:255 255, sta:6 1, prof:6
                          I (78931) wifi: state: init -> auth (b0)
                          I (78934) wifi: state: auth -> assoc (0)
                          I (78939) wifi: state: assoc -> run (10)
                          I (88940) wifi: state: run -> init (2)
                          I (88940) wifi: n:6 0, o:6 1, ap:255 255, sta:6 1, prof:6
                          I (89061) wifi: n:6 1, o:6 0, ap:255 255, sta:6 1, prof:6
                          I (89062) wifi: state: init -> auth (b0)
                          I (89065) wifi: state: auth -> assoc (0)
                          I (89074) wifi: state: assoc -> run (10)
                          

                          think about people first, then computers

                          1 Reply Last reply Reply Quote 0
                          • L Offline
                            livius
                            last edited by

                            this is amazing that this was so simple like wrong password from some old documentation :)
                            connected two wipy2 together

                            rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
                            configsip: 0, SPIWP:0x00
                            clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
                            mode:QIO, clock div:2
                            load:0x3fff9010,len:8
                            load:0x3fff9018,len:812
                            ho 0 tail 12 room 4
                            load:0x40078000,len:3692
                            load:0x4009f000,len:944
                            entry 0x4009f1f0
                            tcpip_task_hdlxxx : 3ffedcb0, prio:18,stack:2048
                            I (1843) wifi: frc2_timer_task_hdl:3ffef8a8, prio:22, stack:2048
                            I (1849) wifi: pp_task_hdl : 3fff2170, prio:23, stack:8192
                            I (2825) wifi: mode : softAP (24:0a:c4:00:a8:bf)
                            dhcp server start:(ip: 192.168.4.1, mask: 255.255.255.0, gw: 192.168.4.1)
                            wifi_sta
                            I (3008) wifi: mode : sta (24:0a:c4:00:a8:be)
                            wipy-wlan-6ec2
                            UPC0838976
                            UPC Wi-Free
                            vnet-509F64
                            TP-LINK_9A6D1E
                            2.4G-Vectra-WiFi-B7C11C
                            2.4G-vnet-1C0A58
                            UPC Wi-Free
                            keke
                            UPC1387285
                            vnet-EC0D8E
                            UPC Wi-Free
                            UPC8578324
                            DIRECT-y6-BRAVIA
                            STAWIK iNTERNET
                            UPC Wi-Free
                            I (6100) wifi: n:6 1, o:6 0, ap:255 255, sta:6 1, prof:6
                            I (7074) wifi: state: init -> auth (b0)
                            I (7077) wifi: state: auth -> assoc (0)
                            I (7086) wifi: state: assoc -> run (10)
                            I (7101) wifi: connected with wipy-wlan-6ec2, channel 6
                            WLAN connection succeeded!
                            MicroPython v1.8.6-251-g2fb950d on 2016-12-16; WiPy with ESP32
                            Type "help()" for more information.
                            >>> Connected to AP wipy-wlan-6ec2 channel 6I (17086) wifi: pm open, type:0, st: 0, sending null data: 0
                            

                            think about people first, then computers

                            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