Getting started with PyGos and Pylife


  • Global Moderator

    Welcome to the PyGo section of the forum. This is a space for discussion and help about development for PyGos.
    If you are looking for help with using PyGos with PyLife please look on the PyLife section of the forum.

    The first place to go to get started with PyGos is our documentation. This is being updated regularly, so worth keeping an eye on:
    https://docs.pycom.io/pylife/

    This should cover everything to get you up and running, and please say if there are things that aren't clear.

    For those of you who like to plug things in and try them out before reading and documentation: it is important to do a firmware upgrade as soon as you turn the PyGo on.

    If you are on Android, we are waiting for Google to approve the latest version of PyLife which improves the firmware upgrade process. The firmware upgrade should work with the existing version, but if it fails the restart upgrade may not succeed. The approval is taking rather a long time, so in the meantime we do have two alternatives.

    1. You can connect over USB and perform an update on PC. This is for advanced users but allows maximum flexibility.
      This is documented here: https://docs.pycom.io/pylife/fwupdate/#manual-firmware-update-from-computer
    2. As a temporary measure, you can install the updated Android app from our servers. This is easier, but not recommended as you lose the Play Store's security and automatic updates, but if you are happy doing this it gives a path to updating your PyGo. I will update these instructions shortly with the link to do this.

  • Pybytes Beta

    Ok tried it via the AP, had to use the Laptop with Wifi, now, see what happens

    I (2285978) [PyGo-Firmware Updater]: Receiving firmware image ...
    I (2285978) [PyGo-Firmware Updater]: Remaining 00227A50 
    I (2350078) [PyGo-Firmware Updater]: Binary Firmware image file received!
    I (2350078) [PyGo-Firmware Updater]: Length 2259536 bytes
    I (2374468) [PyGo-Firmware Updater]: Found header => FW-Header-1: ota-finish
    I (2374468) [PyGo-Firmware Updater]: Performing OTA-FINISH
    I (2418928) [PyGo-Firmware Updater]: Found header => FW-Header-1: ota-verify
    I (2418928) [PyGo-Firmware Updater]: Performing OTA-VERIFY
    E (2418958) esp_image: image at 0x110000 has invalid magic byte
    W (2418958) esp_image: image at 0x110000 has invalid SPI mode 68
    

    This looksl ike the firmware image firmware_pygo1_1.20.4.r4-pylife.bin does not fit, or what?


  • Pybytes Beta

    I got a gradle some days ago. I can connect to it using picocom. What I see is that the PyGo1 is rebooting and after some time waits for client connection

    UPDATE WiFi AP Started. Waiting client...
    

    But the update never finishes

        WiFi Client connected!
        Waiting HTTP UPDATE requests...
        I (56668) esp_netif_lwip: DHCP server assigned IP to a station, IP is: 192.168.4.2
        I (57928) [PyGo-Firmware Updater]: Found header => FW-Header-1: ota-init
        I (57928) [PyGo-Firmware Updater]: Performing OTA-INIT
        I (59108) [PyGo-Firmware Updater]: Found header => FW-Header-1: ota-update
        I (59108) [PyGo-Firmware Updater]: Performing OTA-UPDATE
        I (60238) [PyGo-Firmware Updater]: Receiving firmware image ...
        I (60238) [PyGo-Firmware Updater]: Remaining 00227A50 
        I (157778) wifi:station: de:72:61:b1:31:53 leave, AID = 1, bss_flags is 134243, bss:0x3f801718
        I (157778) wifi:new:<11,0>, old:<11,2>, ap:<11,2>, sta:<255,255>, prof:11
        I (157778) [PyGo-Firmware Updater]: Station is disconnected...
        I (157788) [PyGo-Firmware Updater]: operation_mode=5
        I (157788) [PyGo-Firmware Updater]: Update in progress but disconnected, reset...
    

    What can I do?



  • @robert-hh Actually, the reboot occurs every 30 seconds, and setting the WDT does not change the game.



  • @livius Thankl you for the response. Oh yes, in that minute I can write commands, and I used that already to clear the NVS. That changes the reason why boot fails. The problem now is, that update fails as well.
    Setting the WDT timeout to a long value might help. If still boot.py or main.py are executed for update(), then update() might run(). But in the first phase before I erased NVRAM, update was still possible, but did not change the picture.
    This PyGo story started bad and is now going worse.



  • @robert-hh
    During this 1 minute at REPL can you write any commands?
    If yes create wdt with different time. And then maybe you can anasyse something and find solution.
    e.g. you can clear NVRAM totally and maybe boot will write its default values (if such behaviour exists).
    But if it is realy during _boot.py or _main.py then probably only new firmware will really help.



  • @Pete-Allen-0 Hello Peter, I donot know whether you can answer my question, but you might know someone at Pycom who can.

    By just poking around, I have set a PyGo2 into a kind of zombie state, in which is tries to boot, fails in executing one of teh boot scripts (e.g. _boot.py or _main.py) and falls back into REPL, just to boot again after about a minute. I assume it's a watchdog timer which causes it to boot. upgrade() is not possible, safeboot() also does not stop the WDT. The behavior seems to be related to the keys and values stored in the NVRAM, which are somehow corrupted.

    Can you tell me the set of NVRAM keys and values that are required for proper operation?



  • @hjoe With a cradle. I got my PyGo with the second shipping batch, after Pycom decided to ship cradles as well.


  • Pybytes Beta

    @robert-hh How to you connect to your PyGos?

    Still waiting for the gradle but nothing besides silence from pycom



  • @robert-hh After sitting on the desk fpr a few hours, the PyGo2 is now in a kind of lock state. At the serial interface, it just prints:

    Performing i2c_hw_fsm_reset !I2C_SUPPORT_HW_FSM_RST
    This is i2c_master_clear_bus...
    
    

    No connection to PyLife,

    Edit: It seemed to be the state of empty battery. After some time of charging it started to boot.



  • @Pete-Allen-0 Another error when booting while the pylife app is open. Here is the boot sequence (including a secret key):

    Pylife start
    3 Set interrupt: Double Tap, 
    b'\x124\xc0\xde\x1a\xb5\x124\xc0\xde\x1a\xb5\xca\x1a\x11\x0f'
    RTC: (1970, 1, 1, 0, 0, 8, 31087, None)
    Coex register schm btdm cb faild
    BLE name: PyGo 15253
    Client connected
    Pycom MicroPython 1.20.4.r4 [v1.11-258cda230-dirty] on 2022-06-13; PyGo2 with ESP32
    Pybytes Version: 1.6.1
    Pymesh Version: 1.4.0
    Type "help()" for more information.
    >>> {}
    power up pygo2
    wait
    Traceback (most recent call last):
      File "_ble_rpc.py", line 260, in resolve
      File "_ble_rpc.py", line 527, in get_device_info
    KeyError: l
    Traceback (most recent call last):
      File "_ble_rpc.py", line 236, in feed
      File "_ble_rpc.py", line 236, in <listcomp>
      File "_ble_rpc.py", line 245, in resolve
    TypeError: 'int' object isn't iterable
    power up pygo2
    wait
    Traceback (most recent call last):
      File "_ble_rpc.py", line 260, in resolve
      File "_ble_rpc.py", line 527, in get_device_info
    KeyError: l
    

    P.S.: Needless to say: no response to tap, single or double.



  • @robert-hh And when trying to set the lora frequency, I see the error:

    Traceback (most recent call last):
      File "_ble_rpc.py", line 236, in feed
      File "_ble_rpc.py", line 236, in <listcomp>
      File "_ble_rpc.py", line 253, in resolve
    AttributeError: 'RPCHandler' object has no attribute 'set_lora_freq'
    


  • @Pete-Allen-0 I just noticed at the REPL prompt pf a PyGo1. When it connects and disconnects, I'll see an error message:

    Client disconnected
    Client connected
    {}
    Traceback (most recent call last):
      File "_ble_rpc.py", line 236, in feed
      File "_ble_rpc.py", line 236, in <listcomp>
      File "_ble_rpc.py", line 245, in resolve
    TypeError: 'int' object isn't iterable
    

    Does Pycom ever test the code they roll out?


Log in to reply
 

Pycom on Twitter