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

    Crash when connecting to my home Wifi router

    Scheduled Pinned Locked Moved LoPy
    26 Posts 6 Posters 10.8k Views 6 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.
    • J Offline
      JF002
      last edited by JF002

      Hello!
      I have a brand new Lopy, that was first upgraded to firmware version 0.9.6.b1 and now to version 0.9.7.b1.
      I have an issue with the wifi with both version: it some seconds after a successful connection to my home router.

      from network import WLAN
      >>> wlan = WLAN(mode=WLAN.STA)
      mode : sta(24:0a:c4:00:c0:52)
      >>> wlan.connect('MY_SSID', auth=('WLAN.WPA2', '**************'))
      >>> I (61450) wifi: n:9 0, o:6 0, ap:255 255, sta:9 0, prof:6
      I (62424) wifi: state: 0 -> 2 (b0)
      I (62432) wifi: state: 2 -> 3 (0)
      I (62435) wifi: state: 3 -> 5 (10)
      I (62448) wifi: connected with MY_SSID, channel 9
      
      # wait 10 seconds
      
      Guru Meditation Error of type InstrFetchProhibited occurred on core   0. Exception was unhandled.
      Register dump:
      PC      :  002c002c  PS      :  00060330  A0      :  8012228a  A1      :  3ffdfcf0  
      A2      :  00000001  A3      :  3ffd96f0  A4      :  002c002c  A5      :  00000008  
      A6      :  00000000  A7      :  3ffd33b4  A8      :  8011bf0c  A9      :  00000002  
      A10     :  3ffd96f0  A11     :  00000001  A12     :  3ffd4f30  A13     :  00000000  
      A14     :  3ffdf600  A15     :  3ffd4d14  SAR     :  00000019  EXCCAUSE:  00000014  
      EXCVADDR:  002c002c  LBEG    :  00000000  LEND    :  00000000  LCOUNT  :  00000000  
      Rebooting...
      ets Jun  8 2016 00:22:57
      
      rst:0x3 (SW_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 (887) phy: phy_version: 246, Nov 18 2016, 17:30:07, 0, 0
      
      tcpip_task_hdlxxx : 3ffe800c, prio:18,stack:2048
      frc2_timer_task_hdl:3ffe9a24, prio:22, stack:2048
      I (1028) wifi: pp_task_hdl : 3ffec248, prio:23, stack:8192
      mode : softAP(24:0a:c4:00:c0:53)
      dhcp server start:(ip: 192.168.4.1, mask: 255.255.255.0, gw: 192.168.4.1)
      MicroPython v1.8.6-234-g765f2bc on 2016-12-02; LoPy with ESP32
      Type "help()" for more information.
      >>> 
      >>> 
      

      Version:

      (sysname='LoPy', nodename='LoPy', release='0.9.7.b1', version='v1.8.6-234-g765f2bc on 2016-12-02', machine='LoPy with ESP32')
      

      Any idea ?

      Thanks

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

        @JF002, I'm sad to see updating didn't do the trick, but it was worth the shot.

        In order to further diagnose, can I ask you for 2 things? First would your router access. Second, can you try connecting with a fixed IP address (See how here). Probably you'll have to modify the numbers so they'll match your network. If you need further help on how to do this, please write me.

        Regards,
        Abilio

        J 1 Reply Last reply Reply Quote 0
        • M Offline
          macfreek
          last edited by macfreek

          I have the same problem after I just upgraded to 0.9.6.b1.
          The error is identical (except for a few registers).

          For me, the exception occurs 1-2 seconds after another device joins the local wifi network. I've tested with my laptop and iPhone, and got the same result. For the record, here is my boot.py. My main.py is empty.

          # boot.py -- run on boot-up
          
          # Allow serial connections
          import os
          from machine import UART
          uart = UART(0, 115200)
          os.dupterm(uart)
          
          # connect to wifi
          # see https://docs.pycom.io/lopy/lopy/tutorial/wlan.html
          import machine
          from network import WLAN
          wlan = WLAN(mode=WLAN.STA)
          nets = wlan.scan()
          for net in nets:
              if net.ssid == 'MySSID':
                  wlan.connect(net.ssid, auth=(net.sec, 'my_password_'), timeout=5000)
                  while not wlan.isconnected():
                      machine.idle() # save power while waiting
                  break
          

          Edit: the problem also occurs when I configure an static IP address on my LoPy.

          Edit: I also tried with a brand new WiPy 2.0, which I received today. The factory firmware is 0.9.0b, which works fine (except that network.WLAN.ifconfig() method does not exist yet). After I upgrade the firmware to 0.9.6.b1, the crash can easily be reproduced, by turning the sleep mode of my phone on and off. The crash occurs just after the phone requests a DHCP lease on the same network as the WiPy. The crash can also be reproduced by having any other device on the network renew it's DHCP lease.

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

            @abilio No worry, we'll find a solution :)

            I didn't understand the first question. The router is accessible and working, as my laptop and phone are connected to it. I have full access to the router (it's running the OpenWRT firmware, so I can connect as root on it if necessary).

            I tried connecting with a fixed IP, with the same result :/

            Connecting to a Pycom device...
            Connected
            >>> from network import WLAN
            >>> wlan = WLAN(mode=WLAN.STA)
            mode : sta(24:0a:c4:00:c0:52)
            >>> wlan.ifconfig(config=('192.168.1.194', '255.255.255.0','192.168.1.1','192.168.1.1'))
            >>> wlan.connect(ssid='MY_SSID', auth=(WLAN.WPA2, '*-*********'))
            >>> I (169398) wifi: n:9 0, o:6 0, ap:255 255, sta:9 0, prof:6
            I (170372) wifi: state: 0 -> 2 (b0)
            I (170374) wifi: state: 2 -> 3 (0)
            I (170377) wifi: state: 3 -> 5 (10)
            I (170390) wifi: connected with MY_SSID, channel 9
            
            >>> wlan.isconnected()
            True
            >>> wlan.ifconfig()
            ('192.168.1.194', '255.255.255.0', '192.168.1.1', '192.168.1.1')
            >>> Guru Meditation Error of type InstrFetchProhibited occurred on core   0. Exception was unhandled.
            Register dump:
            PC      :  002c002c  PS      :  00060330  A0      :  8012228a  A1      :  3ffdfe10  
            A2      :  00000001  A3      :  3ffd9808  A4      :  002c002c  A5      :  00000008  
            A6      :  00000000  A7      :  3ffd33b4  A8      :  8011bf0c  A9      :  00000002  
            A10     :  3ffd9808  A11     :  00000001  A12     :  3ffd4f30  A13     :  00000000  
            A14     :  3ffdf718  A15     :  3ffd4d14  SAR     :  00000019  EXCCAUSE:  00000014  
            EXCVADDR:  002c002c  LBEG    :  00000000  LEND    :  00000000  LCOUNT  :  00000000  
            Rebooting...
            ets Jun  8 2016 00:22:57
            
            rst:0x3 (SW_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 (864) phy: phy_version: 246, Nov 18 2016, 17:30:07, 0, 0
            
            tcpip_task_hdlxxx : 3ffe800c, prio:18,stack:2048
            frc2_timer_task_hdl:3ffe9a24, prio:22, stack:2048
            I (1593) wifi: pp_task_hdl : 3ffec27c, prio:23, stack:8192
            mode : softAP(24:0a:c4:00:c0:53)
            dhcp server start:(ip: 192.168.4.1, mask: 255.255.255.0, gw: 192.168.4.1)
            MicroPython v1.8.6-234-g765f2bc on 2016-12-02; LoPy with ESP32
            Type "help()" for more information.
            >>> 
            >>> 
            
            A 1 Reply Last reply Reply Quote 0
            • A Offline
              abilio @JF002
              last edited by

              @JF002, sorry ... don't know how the word access ended up there :P I was looking for model, but autocomplete/dictionary in cellphones always play games. I already see you have OpenWRT running (personal favorite). Thanks for trying with a static IP.

              Your tests, together with @macfreek report, will help us out finding the origin of the issue. I'll report back as soon as I have news.

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

                @macfreek, just to try ease the detective work, when you mean it happened after 0.9.6, does it mean it didn't happen to you in 0.9.5?

                M 1 Reply Last reply Reply Quote 0
                • J Offline
                  JF002 @abilio
                  last edited by

                  @abilio said in Crash when connecting to my home Wifi router:

                  @JF002, sorry ... don't know how the word access ended up there :P I was looking for model, but autocomplete/dictionary in cellphones always play games. I already see you have OpenWRT running (personal favorite). Thanks for trying with a static IP.

                  Oh Ok :) It's a TP-Link TL-WDR3600 running OpenWrt 15.05, and only the 2.4Ghz radio is enabled. Multiple devices are connected to it : smartphone, laptop, PS3, RaspberryPi3, another dev board based on ESP8266,...

                  Your tests, together with @macfreek report, will help us out finding the origin of the issue. I'll report back as soon as I have news.

                  Just ask if you need other test :) I'll wait for your update!

                  1 Reply Last reply Reply Quote 0
                  • M Offline
                    macfreek @abilio
                    last edited by

                    @abilio I have only tested 0.9.0 and 0.9.6. I'm happy to test other versions. Where can I download them? So far I only used the full installer but am happy to use OTA, TFTP or serial as soon as I find a howto.

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

                      @macfreek, old versions are still available in the server. https://software.pycom.io/downloads/pycom_firmware_update_0.9.5.b1.dmg will lead you to version 0.9.5.b1 for example. Take into account that for some versions we had to re-release the installer to fix issues, so some of them will be named a bit different. Here the list of those specific cases, for mac: pycom_update_0.9.6.b1a.dmg, pycom_update_0.9.3.b2a.dmg. 0.9.3 also got a b1, pycom_update_0.9.3.b1.dmg.

                      Thats for the mac (taking into account your nickname ;) ) in case you want Windows, they are called a bit different (ie: pycom_firmware_update_0.9.5.b1.exe). Linux version is called the same as mac, but the extension is .tar.gz instead of .dmg .

                      For other users that might look at this post, please don't downgrade your board unless you want to test something very specific, like in this case.

                      Thanks for offering you help in the investigation,

                      Abilio

                      M 1 Reply Last reply Reply Quote 0
                      • M Offline
                        macfreek @abilio
                        last edited by macfreek

                        @abilio That URL only shows the text "Unauthorized" for me (though the HTTP code is just 200 instead of 401). As for your PM, I'm afraid my availability today is rather limited. I hope to test it today, but it may be tomorrow. And good guess about the OS preference (despite that I have the nickname for over 20 years).

                        Edit: there was a typo in the URL you posted. The correct URL is: https://software.pycom.io/downloads/pycom_update_0.9.5.b1.dmg. I'm going to download it, and test if the problem occurs in that version as well.

                        1 Reply Last reply Reply Quote 0
                        • R Offline
                          rdixey
                          last edited by

                          Hello Abilio,

                          This WIFI bug continues the same with firmware 0.9.7.b1 as I reported a week ago for firmware 0.9.6.b1.

                          Am I assuming correctly that you are a Pycom engineer?

                          Who at Pycom is responsible for correcting firmware bugs?

                          What is Pycom's SLA for correcting defects with released firmware?

                          Robert Dixey

                          1 Reply Last reply Reply Quote 0
                          • W Offline
                            williamv
                            last edited by

                            hi, same issue here with my new LoPy with 0.9.6.b1a firmware, Netgear R7000 router. Wifi crashes after 1-2-3 minutes. Fixed ip does not make a difference.
                            Let me know if you need more info or if i can do any testing to get this resolved.

                            MicroPython v1.8.6-40-gd10463e on 2016-11-25; LoPy with ESP32
                            Type "help()" for more information.

                            I (434227) wifi: n:3 0, o:6 0, ap:255 255, sta:3 0, prof:6
                            I (435201) wifi: state: 0 -> 2 (b0)
                            I (435204) wifi: state: 2 -> 3 (0)
                            I (435208) wifi: state: 3 -> 5 (10)
                            I (435231) wifi: connected with xyzssid, channel 3
                            Guru Meditation Error of type InstrFetchProhibited occurred on core 0. Exception was unhandled.
                            Register dump:
                            PC : 002c002c PS : 00060330 A0 : 801252ce A1 : 3ffdf9f0
                            A2 : 00000001 A3 : 3ffd96ac A4 : 002c002c A5 : 00000008
                            A6 : 00000000 A7 : 3ffd3398 A8 : 8011ef50 A9 : 00000002
                            A10 : 3ffd96ac A11 : 00000001 A12 : 3ffd4f14 A13 : 00000000
                            A14 : 3ffdf2fc A15 : 3ffd4cf8 SAR : 00000019 EXCCAUSE: 00000014
                            EXCVADDR: 002c002c LBEG : 00000000 LEND : 00000000 LCOUNT : 00000000
                            Rebooting...
                            ets Jun 8 2016 00:22:57

                            rst:0x3 (SW_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 (879) phy: phy_version: 246, Nov 18 2016, 17:30:07, 0, 0

                            tcpip_task_hdlxxx : 3ffdfba4, prio:18,stack:2048
                            frc2_timer_task_hdl:3ffe972c, prio:22, stack:2048
                            I (1576) wifi: pp_task_hdl : 3ffebf50, prio:23, stack:8192
                            mode : softAP(24:0a:c4:00:92:77)
                            dhcp server start:(ip: 192.168.4.1, mask: 255.255.255.0, gw: 192.168.4.1)
                            MicroPython v1.8.6-40-gd10463e on 2016-11-25; LoPy with ESP32
                            Type "help()" for more information.

                            1 Reply Last reply Reply Quote 0
                            • M Offline
                              macfreek
                              last edited by macfreek

                              FYI, the crash does not occur with firmware 0.9.5.b1, only with 0.9.6.b1 and 0.9.7.b1.

                              Just a little help in tracking it down, the following DHCP request packet will NOT crash the micropython board (generated with the dhcping tool):

                              22:45:15.298227 IP 172.25.129.170.68 > 255.255.255.255.67: BOOTP/DHCP, Request from f4:5c:89:8d:0b:dd, length 250

                              while the following DHCP request DOES crash the micropython board (generated by renewing the IPv4 lease):

                              22:43:13.382647 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from f4:5c:89:8d:0b:dd, length 300

                              The obvious difference is in the sender IP address, but given the difference in length, there may be more differences.

                              Edit: the above packet turned out not to be the cause, but it seems that the likely cause is the SLAAC packet (an ICMPv6 router sollicitation packet), that is often send at the same time as a DHCPv4 request.

                              Good luck hunting down this bug, and let us know if we can be of any assistence.

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

                                Yes, I'm an engineer at Pycom, and our team of firmware engineers (lead by Daniel) take turns into fixing bugs. We prioritize them by severity (this one is a severe one).

                                Sadly, in this case, we've checked and believe is something related with changes in Espressif's IDF in between 0.9.5 and 0.9.6. We're filling a bug report with them. As soon as we get a response, it will be included in that week's release.

                                Thanks everyone for your patience :)

                                J 1 Reply Last reply Reply Quote 0
                                • J Offline
                                  JF002 @abilio
                                  last edited by

                                  @abilio I hope it will be fixed soon :) Keep us up to date!

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

                                    It seems that this bug was reported in parallel by another ESP32 user. The suspected cause is an issue with IPV6. If you want to keep track of the issue, see here:

                                    https://github.com/espressif/esp-idf/issues/133

                                    J 1 Reply Last reply Reply Quote 0
                                    • M Offline
                                      macfreek
                                      last edited by

                                      Thanks. From that thread it seems that the culprit was IPv6 router solliciation (as needed for SLAAC, which is often used in conjunction with DHCPv4). It seems I was looking at the correct event, but the wrong packet. My apologies for that. I have not yet reproduced it, but this seems very likely. I will follow the other thread for the upstream bug. Could you report back here once upstream is fixed and a new firmware for the pycom boards is available?

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

                                        @macfreek, We'll report any progress here. Expect it to be included in the release after a solution is found :)

                                        1 Reply Last reply Reply Quote 0
                                        • W Offline
                                          williamv
                                          last edited by

                                          good find @abilio !! i changed ipv6 settings on my wireless router Netgear R7000 from 6to4-tunnel to Disabled and have not seen the crash again for the last 30 min ;-)

                                          1 Reply Last reply Reply Quote 0
                                          • J Offline
                                            JF002 @abilio
                                            last edited by

                                            @abilio I disabled the IPV6 interface on my router, and indeed, my Lopy does not crash any more.

                                            I'll leave the IPV6 interface disabled for now, but this is a workaround until it is fixed in the firmware :)

                                            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
                                            • 2
                                            • 1 / 2
                                            • First post
                                              Last post

                                            Pycom on Twitter

                                            Pycom