Problems with Pybytes and Lopy4



  • Hello, I'm trying a new Lopy4 and I connected it to Pybytes with the app.
    It worked, but then the connection with the board failed and I wasn't able to update the files. I tried to restore it and I didn't get it. In that situation I thought I could delete the device and then add it again with the app.
    Unfortunately, the app isn't working now and the lopy4 doesn't appear on the screen.
    I don't have an Expansion Board and I can't get one soon.
    Is there any possibility to make it work?



  • @Gijs
    This is what I get:

    >>> pybytes.smart_config(True)
    Smart Provisioning started in the background
    See https://docs.pycom.io/smart for details
    >>> Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.
    Core 0 register dump:
    PC      : 0x4015259c  PS      : 0x00060f30  A0      : 0x80152bff  A1      : 0x3ffd3860  
    A2      : 0x00000000  A3      : 0x00000001  A4      : 0x3ffdfbbc  A5      : 0x00000001  
    A6      : 0x000000fe  A7      : 0x00000001  A8      : 0x800967f0  A9      : 0x3ffd3880  
    A10     : 0x00000003  A11     : 0x00060f23  A12     : 0x00060f20  A13     : 0x00000001  
    A14     : 0x000000fe  A15     : 0x00000000  SAR     : 0x00000020  EXCCAUSE: 0x0000001c  
    EXCVADDR: 0x00000010  LBEG    : 0x40094230  LEND    : 0x4009425e  LCOUNT  : 0xffffffff  
    
    ELF file SHA256: 0000000000000000000000000000000000000000000000000000000000000000
    
    Backtrace: 0x4015259c:0x3ffd3860 0x40152bfc:0x3ffd38a0 0x401583ac:0x3ffd38d0
    
    ================= CORE DUMP START =================
    
    ================= CORE DUMP END =================
    Rebooting...
    ets Jun  8 2016 00:22:57
    
    rst:0xc (SW_CPU_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT)
    configsip: 0, SPIWP:0xee
    clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
    mode:DIO, clock div:1
    load:0x3fff8020,len:8
    load:0x3fff8028,len:2128
    load:0x4009fa00,len:19760
    entry 0x400a05bc
    

    It stays at this point until I reboot or something. And when I press reset it goes back to the loop problem.



  • Once the device is provisioned to pybytes (ie, showing the whole connection procedure and trying to connect to wlan), it will not start the smart config automatically anymore as its not needed, meaning you will not find it in the app. You can manually start the smart config by calling:

    pybytes.smart_config(True)
    

    This will show (something like) the following in the REPL:

    >>> pybytes.smart_config(True)
    Disconnecting current connection!
    Watchdog timeout has been increased to 2147483647 ms
    Smart Provisioning started in the background
    See https://docs.pycom.io/smart for details
    

    Next to that, the device will show up in the Pybytes app after about a minute, automatically provisioning to Pybytes. Once the device shows in the app and is provisioned, you'll get this on the REPL:

    >>> Wifi connection established... activating device!
    Successfully created /flash/cert/pycom-ca.pem
    WMAC: {redacted}
    Firmware: 1.20.2.r4
    Pybytes: 1.6.1
    Initialized watchdog for WiFi and LTE connection with timeout 1260000 ms
    WiFi connection established
    Connected to MQTT mqtt.pybytes.pycom.io
    Pybytes connected successfully (using the built-in pybytes library)
    
    

    Note that my device does not mention ' activating device!' as its already activated with the platform. Now Im curious why yours will not activate

    Let me know
    Gijs



  • @Gijs I updated the firmware with the firmware updater. It's all I did, and then just tried code in the REPL. Then I tried to write the main and boot to solve the problem, but I didn't work. It seems to be in an infinite loop when I reset the board. I've already run the tool with that boxes checked and it woks fine the first time, but when I push the reset button it goes back to the loop. The information about my wifi network is still on the output.

    I'm trying to do it again and it is not doing the loop. But I'm still not able to find it on the app.
    I think I'll just work with Atom.



  • Hi,
    I edited out the unnecesary coredump information to make the debug information more clear to review.

    In all three resets, I do not see the same information that we saw before. Did you make any other changes in the meantime?
    Could you use the firmware updater and in the advanced section, check the clear NVS and CONFIG boxes, together with erase flash. This should clear the device from all files in any case. Then, you should be able to follow the smart config tutorial again: https://docs.pycom.io/smart (make sure to either check the 'activate pybytes' in the firmware updater as well, or use the import listed here at the top of the page: https://docs.pycom.io/pybytes/api/



  • @Gijs said in Problems with Pybytes and Lopy4:

    import pycom; pycom.nvs_set('pybytes_debug', 99)

    I have more problems now. I'm working with Atom and I'm using the safe boot (CTRL+D) to exit the boot.py and main.py files. I'm trying to erased them or change but it isn't working.

    I used the debug flat set and this was the output:

    import pycom; pycom.nvs_set('pybytes_debug', 99)
    ets Jun 8 2016 00:22:57

    rst:0x1 (POWERON_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT)
    configsip: 0, SPIWP:0xee
    clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
    mode:DIO, clock div:1
    load:0x3fff8020,len:8
    load:0x3fff8028,len:2128
    load:0x4009fa00,len:19760
    entry 0x400a05bc
    {'ssl': False, 'wifi': {'ssid': 'MOVISTAR_C7A8', 'password': ''}, 'lte': {'apn': '', 'cid': 0, 'reset': False, 'carrier': '', 'band': 0, 'type': ''}, 'device_id': 'e69e8e35-a9b7-45cd-adad-3ef8aa6cf563', 'network_preferences': ['wifi', 'lora_otaa'], 'cfg_msg': 'Pybytes configuration read from /flash/pybytes_config.json', 'dump_ca': False, 'pybytes_autostart': True, 'server': 'mqtt.pybytes.pycom.io', 'lora': {'otaa': {'app_key': '4eed6e29fc3486a9c4da68ae23137d64', 'app_device_eui': 'c3ae3d1e6fb6cca8', 'app_eui': '70B3D57ED000AFA1'}}, 'wlan_antenna': 0, 'ota_server': {'port': 443, 'domain': 'software.pycom.io'}, 'username': 'adrianalonsovilar@gmail.com'}
    ssl_params={'ca_certs': '/flash/cert/pycom-ca.pem'}
    LIS2HH12 not imported
    ssl_params={'ca_certs': '/flash/cert/pycom-ca.pem'}
    WMAC: 10521C65DEB8
    Firmware: 1.20.2.r4
    Pybytes: 1.6.1
    {'ssl': False, 'wifi': {'ssid': 'MOVISTAR_C7A8', 'password': ''}, 'lte': {'apn': '', 'cid': 0, 'reset': False, 'carrier': '', 'band': 0, 'type': ''}, 'device_id': 'e69e8e35-a9b7-45cd-adad-3ef8aa6cf563', 'network_preferences': ['wifi', 'lora_otaa'], 'cfg_msg': 'Pybytes configuration read from /flash/pybytes_config.json', 'dump_ca': False, 'pybytes_autostart': True, 'server': 'mqtt.pybytes.pycom.io', 'lora': {'otaa': {'app_key': '4eed6e29fc3486a9c4da68ae23137d64', 'app_device_eui': 'c3ae3d1e6fb6cca8', 'app_eui': '70B3D57ED000AFA1'}}, 'wlan_antenna': 0, 'ota_server': {'port': 443, 'domain': 'software.pycom.io'}, 'username': 'adrianalonsovilar@gmail.com'}
    Attempting to connect with network wifi
    Initialized watchdog for WiFi and LTE connection with timeout 1260000 ms
    WLAN connected? False
    Wifi connection attempt: 1
    WLAN connected? False
    Guru Meditation Error: Core 1 panic'ed (IllegalInstruction). Exception was unhandled.
    Memory dump at 0x400f6be4: 00800000 00400504 0504a006
    Core 1 register dump:
    PC : 0x400f6bea PS : 0x00060330 A0 : 0x00000001 A1 : 0x3ffdb250
    A2 : 0x3ffc9308 A3 : 0x00000000 A4 : 0x3f4064e8 A5 : 0x0000ff00
    A6 : 0x00ff0000 A7 : 0xff000000 A8 : 0x800f6b16 A9 : 0x3ffdb230
    A10 : 0x00000000 A11 : 0x00001b73 A12 : 0x3ffbb35c A13 : 0x00000001
    A14 : 0x000000fe A15 : 0x00060023 SAR : 0x00000000 EXCCAUSE: 0x00000000
    EXCVADDR: 0x00000000 LBEG : 0x40094b21 LEND : 0x40094b37 LCOUNT : 0xfffffff9

    ELF file SHA256: 0000000000000000000000000000000000000000000000000000000000000000

    Backtrace: 0x400f6bea:0x3ffdb250 0x7ffffffe:0x3ffdb280

    ================= CORE DUMP START =================
    ...
    ================= CORE DUMP END =================
    Rebooting...
    ets Jun 8 2016 00:22:57

    rst:0xc (SW_CPU_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT)
    configsip: 0, SPIWP:0xee
    clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
    mode:DIO, clock div:1
    load:0x3fff8020,len:8
    load:0x3fff8028,len:2128
    load:0x4009fa00,len:19760
    entry 0x400a05bc
    {'ssl': False, 'wifi': {'ssid': 'MOVISTAR_C7A8', 'password': ''}, 'lte': {'apn': '', 'cid': 0, 'reset': False, 'carrier': '', 'band': 0, 'type': ''}, 'device_id': 'e69e8e35-a9b7-45cd-adad-3ef8aa6cf563', 'network_preferences': ['wifi', 'lora_otaa'], 'cfg_msg': 'Pybytes configuration read from /flash/pybytes_config.json', 'dump_ca': False, 'pybytes_autostart': True, 'server': 'mqtt.pybytes.pycom.io', 'lora': {'otaa': {'app_key': '4eed6e29fc3486a9c4da68ae23137d64', 'app_device_eui': 'c3ae3d1e6fb6cca8', 'app_eui': '70B3D57ED000AFA1'}}, 'wlan_antenna': 0, 'ota_server': {'port': 443, 'domain': 'software.pycom.io'}, 'username': 'adrianalonsovilar@gmail.com'}
    ssl_params={'ca_certs': '/flash/cert/pycom-ca.pem'}
    LIS2HH12 not imported
    ssl_params={'ca_certs': '/flash/cert/pycom-ca.pem'}
    WMAC: 10521C65DEB8
    Firmware: 1.20.2.r4
    Pybytes: 1.6.1
    {'ssl': False, 'wifi': {'ssid': 'MOVISTAR_C7A8', 'password': ''}, 'lte': {'apn': '', 'cid': 0, 'reset': False, 'carrier': '', 'band': 0, 'type': ''}, 'device_id': 'e69e8e35-a9b7-45cd-adad-3ef8aa6cf563', 'network_preferences': ['wifi', 'lora_otaa'], 'cfg_msg': 'Pybytes configuration read from /flash/pybytes_config.json', 'dump_ca': False, 'pybytes_autostart': True, 'server': 'mqtt.pybytes.pycom.io', 'lora': {'otaa': {'app_key': '4eed6e29fc3486a9c4da68ae23137d64', 'app_device_eui': 'c3ae3d1e6fb6cca8', 'app_eui': '70B3D57ED000AFA1'}}, 'wlan_antenna': 0, 'ota_server': {'port': 443, 'domain': 'software.pycom.io'}, 'username': 'adrianalonsovilar@gmail.com'}
    Attempting to connect with network wifi
    Initialized watchdog for WiFi and LTE connection with timeout 1260000 ms
    ets Jun 8 2016 00:22:57

    rst:0x7 (TG0WDT_SYS_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT)
    configsip: 0, SPIWP:0xee
    clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
    mode:DIO, clock div:1
    load:0x3fff8020,len:8
    load:0x3fff8028,len:2128
    load:0x4009fa00,len:19760
    entry 0x400a05bc
    Pycom MicroPython 1.20.2.r4 [v1.11-ffb0e1c] on 2021-01-12; LoPy4 with ESP32
    Pybytes Version: 1.6.1
    Type "help()" for more information.



  • Hi,
    could you give the output of the board with the following debug flag set:
    import pycom; pycom.nvs_set('pybytes_debug', 99). You'll need to reset the board to activate the flag.
    Let me know!
    Gijs



  • I got this result connecting by serial, I'm still trying to activate it but everything fails.

    Connected to MQTT mqtt.pybytes.pycom.io
    Pybytes connected successfully (using the built-in pybytes library)
    Pybytes configuration read from /flash/pybytes_config.json
    Disconnecting current connection!
    Watchdog timeout has been increased to 2147483647 ms
    Please wait while we try to connect to MOVISTAR_C7A8
    Wifi connection established... activating device!
    Activation failed!
    Pycom MicroPython 1.20.2.r0 [v1.11-783192e] on 2020-08-06; LoPy4 with ESP32
    Pybytes Version: 1.5.1
    Type "help()" for more information.



Pycom on Twitter