Pycom 1.20.2.r2 firmware OTA not updating



  • I've usually been able to update the firmware OTA using the pybytes website. This latest release has failed on all 12 LoPy4 devices I have remotely connected to Wifi. Is it just me, or is anyone else having issues updating from 1.20.2.r1 to 1.20.2.r2?



  • @Xykon I had several other units I tried to fix and get online that still wouldn't flash OTA.

    When I ran your debug commands, it did go thru.

    >>> import pycom
    >>> pycom.nvs_set('pybytes_debug', 5)
    >>> ets Jun  8 2016 00:22:57        
    
    rst:0x1 (POWERON_RESET),boot:0x32 (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:2140 
    ho 0 tail 12 room 4      
    load:0x4009fa00,len:19760
    entry 0x400a05bc
     ssl_params={'ca_certs': '/flash/cert/pycom-ca.pem'} 
    ets Jun  8 2016 00:22:57
    
    rst:0x1 (POWERON_RESET),boot:0x32 (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:2140
    ho 0 tail 12 room 4
    load:0x4009fa00,len:19760
    entry 0x400a05bc
     ssl_params={'ca_certs': '/flash/cert/pycom-ca.pem'} 
    LIS2HH12 not imported
    ets Jun  8 2016 00:22:57
    
    rst:0x1 (POWERON_RESET),boot:0x32 (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:2140
    ho 0 tail 12 room 4
    load:0x4009fa00,len:19760
    entry 0x400a05bc
     ssl_params={'ca_certs': '/flash/cert/pycom-ca.pem'} 
    LIS2HH12 not imported
     ssl_params={'ca_certs': '/flash/cert/pycom-ca.pem'} 
    WMAC: 807D3A937CD8
    Firmware: 1.20.2.r1
    Pybytes: 1.6.0
    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
    (ssid='AREDN-20-v3', bssid=b'$\xa4<t\xfd#', sec=0, channel=1, rssi=-36)
    (ssid='DesertIslandSupplyCo', bssid=b"X\x90C'\x9a&", sec=3, channel=11, rssi=-41)
    (ssid='Ericsson2.4G-2-1', bssid=b'\x00\rgv\xb6\xc9', sec=0, channel=1, rssi=-48)
    (ssid='AREDN-20-v3', bssid=b'hrQn.\xe0', sec=0, channel=1, rssi=-51)
    (ssid='ATTqsHdTxi_Ext', bssid=b'\xc4A\x1e^\xe0E', sec=3, channel=11, rssi=-52)
    (ssid='Red_Mountain_Makers', bssid=b'\xf0\x9f\xc2=!b', sec=3, channel=6, rssi=-56)
    (ssid='ATTqsHdTxi', bssid=b'\xf8-\xc0dUp', sec=3, channel=11, rssi=-56)
    (ssid='ATT6SH58Na', bssid=b'\xec\xa9@\xbb\xe8p', sec=3, channel=6, rssi=-59)
    (ssid='Red_Mountain_Makers', bssid=b'\xa0\x8ex2\x9f\xae', sec=3, channel=6, rssi=-63)
    (ssid='ATTqsHdTxi_Ext_Ext', bssid=b'\xc4A\x1e^\xe0G', sec=3, channel=11, rssi=-64)
    (ssid='DesertIslandSupplyCo', bssid=b'hrQ\x84Y\x9e', sec=3, channel=11, rssi=-67)
    (ssid='DIRECT-3D-HP OfficeJet Pro 7740', bssid=b'B\xb04vj=', sec=3, channel=6, rssi=-74)
    (ssid='woodrow hall-guest', bssid=b'\xc0\xc1\xc0\xc6@\x86', sec=0, channel=11, rssi=-83)
    (ssid='OpenEVSE_1678039', bssid=b'^\xcf\x7f\x19\x9a\xd7', sec=3, channel=1, rssi=-84)
    (ssid='Red_Mountain_Makers', bssid=b'\x00\x1d~\x97\xf8\x96', sec=3, channel=11, rssi=-86)
    WiFi connection established
    MQTT Protocol
    Packet sent. (Length: 118)
    This is PybytesProtocol.start_MQTT
    Packet sent. (Length: 44)
    Connected to MQTT mqtt.pybytes.pycom.io
    Pybytes connected successfully (using the built-in pybytes library)
    This is pack_info_message()
    __pack_message: b'010404a00581000000'
    MQTT Protocol
    Packet sent. (Length: 50)
    Pybytes configuration read from /flash/pybytes_config.json
    Pycom MicroPython 1.20.2.r1 [v1.11-a5aa0b8] on 2020-09-09; LoPy4 with ESP32
    Pybytes Version: 1.6.0
    Type "help()" for more information.
    >>> This is PybytesProtocol.__process_recv_message()
    This is PybytesLibrary.unpack_message(message=b'\x85')
    Performing OTA
    Requesting: manifest.json?current_ver=1.20.2.r1&sysname=LoPy4&wmac=807d3a937cd8&ota_slot=0x210000 to software.pycom.io:443 with SSL? True
    Wrapping socket
    Sending request
    Result: b'HTTP/1.1 200 OK\r\nServer: nginx\r\nDate: Fri, 27 Nov '
    Requesting: downloads/appimg/firmware_LoPy4_1.20.2.r2-pybytes.bin to software.pycom.io:443 with SSL? True
    Wrapping socket
    Sending request
    Result: b'HTTP/1.1 200 OK\r\nServer: nginx\r\nDate: Fri, 27 Nov '
    Sending OTA result back 2
    __pack_message: b'0502'
    MQTT Protocol
    Packet sent. (Length: 47)
    ets Jun  8 2016 00:22:57
    
    rst:0x7 (TG0WDT_SYS_RESET),boot:0x32 (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:2140
    ho 0 tail 12 room 4
    load:0x4009fa00,len:19760
    entry 0x400a05bc
     ssl_params={'ca_certs': '/flash/cert/pycom-ca.pem'} 
    LIS2HH12 not imported
     ssl_params={'ca_certs': '/flash/cert/pycom-ca.pem'} 
    WMAC: 807D3A937CD8
    Firmware: 1.20.2.r2
    Pybytes: 1.6.1
    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
    (ssid='DesertIslandSupplyCo', bssid=b"X\x90C'\x9a&", sec=3, channel=11, rssi=-40)
    (ssid='AREDN-20-v3', bssid=b'hrQn.\xe0', sec=0, channel=1, rssi=-46)
    (ssid='Ericsson2.4G-2-1', bssid=b'\x00\rgv\xb6\xc9', sec=0, channel=1, rssi=-48)
    (ssid='ATTqsHdTxi_Ext', bssid=b'\xc4A\x1e^\xe0E', sec=3, channel=11, rssi=-52)
    (ssid='ATT6SH58Na', bssid=b'\xec\xa9@\xbb\xe8p', sec=3, channel=6, rssi=-53)
    (ssid='Red_Mountain_Makers', bssid=b'\xf0\x9f\xc2=!b', sec=3, channel=6, rssi=-55)
    (ssid='ATTqsHdTxi', bssid=b'\xf8-\xc0dUp', sec=3, channel=11, rssi=-56)
    (ssid='Red_Mountain_Makers', bssid=b'\xa0\x8ex2\x9f\xae', sec=3, channel=6, rssi=-60)
    (ssid='AREDN-20-v3', bssid=b'hrQf\x9e\xf0', sec=0, channel=1, rssi=-62)
    (ssid='ATTqsHdTxi_Ext_Ext', bssid=b'\xc4A\x1e^\xe0G', sec=3, channel=11, rssi=-64)
    (ssid='HVP_b82ca091985a', bssid=b'\xb8,\xa0\x91\x98b', sec=5, channel=6, rssi=-65)
    (ssid='DesertIslandSupplyCo', bssid=b'hrQ\x84Y\x9e', sec=3, channel=11, rssi=-66)
    (ssid='DIRECT-3D-HP OfficeJet Pro 7740', bssid=b'B\xb04vj=', sec=3, channel=6, rssi=-72)
    (ssid='OpenEVSE_1678039', bssid=b'^\xcf\x7f\x19\x9a\xd7', sec=3, channel=1, rssi=-84)
    (ssid='Red_Mountain_Makers', bssid=b'\x00\x1d~\x97\xf8\x96', sec=3, channel=11, rssi=-85)
    (ssid='ATT-WI-6871', bssid=b'\xb0\xc1\x9e\x14mH', sec=3, channel=6, rssi=-90)
    WiFi connection established
    MQTT Protocol
    Packet sent. (Length: 118)
    This is PybytesProtocol.start_MQTT
    Packet sent. (Length: 44)
    Connected to MQTT mqtt.pybytes.pycom.io
    Pybytes connected successfully (using the built-in pybytes library)
    This is pack_info_message()
    __pack_message: b'010404a00582000000'
    MQTT Protocol
    Packet sent. (Length: 50)
    Pybytes configuration read from /flash/pybytes_config.json
    Pycom MicroPython 1.20.2.r2 [v1.11-3a7776d] on 2020-11-23; LoPy4 with ESP32
    Pybytes Version: 1.6.1
    Type "help()" for more information.
    >>>
    


  • @Xykon I was able to flash all my devices up now.. Whatever was changed between this morning and now, it works. Also, devices are reporting 'online' now, where earlier, everything was offline even though it was updating pybytes..



  • @Xykon

    Flashing this device while in debug mode, it finally took it

    Pycom MicroPython 1.20.2.r1 [v1.11-a5aa0b8] on 2020-09-09; LoPy4 with ESP32
    Pybytes Version: 1.6.0
    Type "help()" for more information.
    >>> This is PybytesProtocol.__keep_connection(alarm=<Alarm>)
    MQTT Protocol
    Packet sent. (Length: 42)
    This is PybytesProtocol.__process_recv_message()
    This is PybytesLibrary.unpack_message(message=b'\x07')
    This is PybytesProtocol.__keep_connection(alarm=<Alarm>)
    MQTT Protocol
    Packet sent. (Length: 42)
    This is PybytesProtocol.__process_recv_message()
    This is PybytesLibrary.unpack_message(message=b'\x07')
    This is PybytesProtocol.__process_recv_message()
    This is PybytesLibrary.unpack_message(message=b'\x85')
    Performing OTA
    Requesting: manifest.json?current_ver=1.20.2.r1&sysname=LoPy4&wmac=240ac4c73304&ota_slot=0x10000 to software.pycom.io:443 with SSL? True
    Wrapping socket
    Sending request
    Result: b'HTTP/1.1 200 OK\r\nServer: nginx\r\nDate: Wed, 25 Nov '
    Requesting: downloads/appimg/firmware_LoPy4_1.20.2.r2-pybytes.bin to software.pycom.io:443 with SSL? True
    Wrapping socket
    Sending request
    Result: b'HTTP/1.1 200 OK\r\nServer: nginx\r\nDate: Wed, 25 Nov '
    Sending OTA result back 2
    __pack_message: b'0502'
    MQTT Protocol
    Packet sent. (Length: 47)
    ets Jun  8 2016 00:22:57
    


  • @Xykon

    rst:0x1 (POWERON_RESET),boot:0x32 (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:2140
    ho 0 tail 12 room 4
    load:0x4009fa00,len:19760
    entry 0x400a05bc
     ssl_params={'ca_certs': '/flash/cert/pycom-ca.pem'}
    LIS2HH12 not imported
     ssl_params={'ca_certs': '/flash/cert/pycom-ca.pem'}
    WMAC: 240AC4C73304
    Firmware: 1.20.2.r1
    Pybytes: 1.6.0
    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
    (ssid='Ericsson2.4G-2-1', bssid=b'\x00\rgv\xb6\xc9', sec=0, channel=1, rssi=-51)
    (ssid='AREDN-20-v3', bssid=b'$\xa4<t\xfd#', sec=0, channel=1, rssi=-52)
    (ssid='DesertIslandSupplyCo', bssid=b"X\x90C'\x9a&", sec=3, channel=11, rssi=-56)
    (ssid='ATT6SH58Na', bssid=b'\xec\xa9@\xbb\xe8p', sec=3, channel=6, rssi=-59)     
    (ssid='Red_Mountain_Makers', bssid=b'\xf0\x9f\xc2=!b', sec=3, channel=6, rssi=-63)
    (ssid='ATTqsHdTxi_Ext', bssid=b'\xc4A\x1e^\xe0E', sec=3, channel=11, rssi=-64)    
    (ssid='ATTqsHdTxi_Ext_Ext', bssid=b'\xc4A\x1e^\xe0G', sec=3, channel=11, rssi=-69)   
    (ssid='Red_Mountain_Makers', bssid=b'\xa0\x8ex2\x9f\xae', sec=3, channel=6, rssi=-70)
    (ssid='DesertIslandSupplyCo', bssid=b'hrQ\x84Y\x9e', sec=3, channel=11, rssi=-71)       
    (ssid='ATTqsHdTxi', bssid=b'\xf8-\xc0dUp', sec=3, channel=11, rssi=-74)
    (ssid='DIRECT-3D-HP OfficeJet Pro 7740', bssid=b'B\xb04vj=', sec=3, channel=6, rssi=-77)
    (ssid='woodrow hall', bssid=b'\xc0\xc1\xc0\xc6@\x84', sec=4, channel=11, rssi=-79)      
    (ssid='woodrow hall-guest', bssid=b'\xc0\xc1\xc0\xc6@\x86', sec=0, channel=11, rssi=-80)
    (ssid='HVP_b82ca091985a', bssid=b'\xb8,\xa0\x91\x98b', sec=5, channel=6, rssi=-83)       
    (ssid='The Hangout Bham-2G', bssid=b'\xd8\xa7V\x9a\x07\xd6', sec=3, channel=11, rssi=-86)
    (ssid='OpenEVSE_1678039', bssid=b'^\xcf\x7f\x19\x9a\xd7', sec=3, channel=6, rssi=-87)
    (ssid='tla00317', bssid=b'\x88j\xe3\xa0\x03\x17', sec=3, channel=11, rssi=-92)       
    WiFi connection established
    MQTT Protocol
    Packet sent. (Length: 118)
    This is PybytesProtocol.start_MQTT
    Packet sent. (Length: 44)
    Connected to MQTT mqtt.pybytes.pycom.io
    Pybytes connected successfully (using the built-in pybytes library)
    This is pack_info_message()
    __pack_message: b'010404a00581000000'
    MQTT Protocol
    Packet sent. (Length: 50)
    Pybytes configuration read from /flash/pybytes_config.json
    Scanning for known wifi nets
    Connected to Red_Mountain_Makers with IP address:0.0.0.0
    Watchdog timeout has been increased to 2147483647 ms
    self.__connection_status=1 | self.__network_type=0
    MQTT over WIFI||LTE... disconnecting MQTT
    Socket send error [Errno 118] EHOSTUNREACH
    Connected over WIFI... disconnecting
    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
    (ssid='DesertIslandSupplyCo', bssid=b"X\x90C'\x9a&", sec=3, channel=11, rssi=-46)
    (ssid='AREDN-20-v3', bssid=b'$\xa4<t\xfd#', sec=0, channel=1, rssi=-51)
    (ssid='Ericsson2.4G-2-1', bssid=b'\x00\rgv\xb6\xc9', sec=0, channel=1, rssi=-53)
    (ssid='ATT6SH58Na', bssid=b'\xec\xa9@\xbb\xe8p', sec=3, channel=6, rssi=-59)
    (ssid='ATTqsHdTxi_Ext', bssid=b'\xc4A\x1e^\xe0E', sec=3, channel=11, rssi=-59)
    (ssid='ATTqsHdTxi_Ext_Ext', bssid=b'\xc4A\x1e^\xe0G', sec=3, channel=11, rssi=-63)
    (ssid='Red_Mountain_Makers', bssid=b'\xf0\x9f\xc2=!b', sec=3, channel=6, rssi=-64)
    (ssid='Red_Mountain_Makers', bssid=b'\xa0\x8ex2\x9f\xae', sec=3, channel=6, rssi=-65)
    (ssid='DesertIslandSupplyCo', bssid=b'hrQ\x84Y\x9e', sec=3, channel=11, rssi=-69)
    (ssid='ATTqsHdTxi', bssid=b'\xf8-\xc0dUp', sec=3, channel=11, rssi=-74)
    (ssid='DIRECT-3D-HP OfficeJet Pro 7740', bssid=b'B\xb04vj=', sec=3, channel=6, rssi=-78)
    (ssid='woodrow hall', bssid=b'\xc0\xc1\xc0\xc6@\x84', sec=4, channel=11, rssi=-79)
    (ssid='woodrow hall-guest', bssid=b'\xc0\xc1\xc0\xc6@\x86', sec=0, channel=11, rssi=-80)
    (ssid='OpenEVSE_1678039', bssid=b'^\xcf\x7f\x19\x9a\xd7', sec=3, channel=6, rssi=-85)
    (ssid='Red_Mountain_Makers', bssid=b'\x00\x1d~\x97\xf8\x96', sec=3, channel=11, rssi=-89)
    (ssid='ATT-WI-6871', bssid=b'\xb0\xc1\x9e\x14mH', sec=3, channel=6, rssi=-90)
    WiFi connection established
    MQTT Protocol
    Packet sent. (Length: 118)
    This is PybytesProtocol.start_MQTT
    Packet sent. (Length: 44)
    Connected to MQTT mqtt.pybytes.pycom.io
    Pybytes connected successfully (using the built-in pybytes library)
    This is pack_info_message()
    __pack_message: b'010404a00581000000'
    MQTT Protocol
    Packet sent. (Length: 50)
    This is pack_pybytes_message_variable(5, 2, bytearray(b'\x00\x00\x00\x00\x00'))
    __pack_message: b'0e05020000000000'
    MQTT Protocol
    turning fan off
    Removed default channels
    Packet sent. (Length: 49)
    US channels set
    This is pack_pybytes_message_variable(5, 2, bytearray(b'\x00\x00\x00\x04\x00'))
    __pack_message: b'0e05020000000400'
    MQTT Protocol
    Joining LoRa via OTAA
    Packet sent. (Length: 49)
    Not yet joined...
    Not yet joined...
    Not yet joined...
    This is pack_pybytes_message_variable(5, 2, bytearray(b'\x00\x00\x00\x00\x00'))
    __pack_message: b'0e05020000000000'
    MQTT Protocol
    Starting
    This is pack_pybytes_message_variable(5, 2, bytearray(b'\x00\x00\x00\x01\x00'))
    __pack_message: b'0e05020000000100'
    MQTT Protocol
    Looping
    turning fan on
    Packet sent. (Length: 49)
    Packet sent. (Length: 49)
    turning fan off
    Battery Voltage =  2.745413
    Sending data!
    This is pack_pybytes_message_variable(5, 0, bytearray(b'\x00\x00\x00\x00\x00'))
    __pack_message: b'0e05000000000000'
    MQTT Protocol
    Packet sent. (Length: 49)
    This is pack_pybytes_message_variable(5, 1, bytearray(b'\x00\x00\x00\x00\x00'))
    __pack_message: b'0e05010000000000'
    MQTT Protocol
    
    


  • @Xykon I will later tonight. They're all remotely mounted around the metro area about 100 miles away


  • administrators

    @dnear1 Can you please run the following on the LoPy4?

    import pycom
    pycom.nvs_set('pybytes_debug', 5)
    

    Then please reset the module and provide the output.



  • I tried several but still getting failures.

    I'll also note that since about the time I upgraded to 1.20.2.r1, the devices seem to ping pybytes far less frequently. That's maybe a good thing if it's a cellular connection, but could it be contributing to this and other code update problems I've had? My code uses time.sleep(300) between sends. Has the pybytes behavior during time.sleep changed? Do I need to have a send_ping or similar at some interval between sleep or some other method to provide a regular heartbeat to pybytes when I want it to "be online"?


  • administrators

    @dnear1 Can you please try again? We changed the way the binary images are stored on the software server but noticed that in the firmware up until 1.20.2.r1 it was using a static path.

    I added symlinks on the software server so the upgrade image should now be found even on devices with older firmware.

    Please let me know if that fixes your issue.


Log in to reply
 

Pycom on Twitter