Lopy crashes when trying to start with battery connected to expansion board and deepshield board attached!



  • Has anyone else had an issue when trying to operate a LoPy from a battery connected to the expansion board?

    All works fine when only connected to USB but plugging in a battery causes a crash on startup: (even with the USB connector still in place!)

    rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
    ets Jun 8 2016 00:22:57

    rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (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:0x3fff9028,len:8
    load:0x3fff9030,len:1076
    load:0x4009fa00,len:0
    ho 12 tail 0 room 4
    load:0x4009fa00,len:15380
    entry 0x400a0720
    Traceback (most recent call last):
    File "main.py", line 7, in <module>
    File "/flash/lib/deepsleep.py", line 157, in get_wake_status
    File "/flash/lib/deepsleep.py", line 81, in peek
    IndexError: bytes index out of range
    MicroPython v1.8.6-849-g0af003a4 on 2017-11-24; LoPy with ESP32
    Type "help()" for more information.

    (sysname='LoPy', nodename='LoPy', release='1.10.2.b1', version='v1.8.6-849-g0af003a4 on
    2017-11-24', machine='LoPy with ESP32', lorawan='1.0.0')

    deepsleep library version: version = '1.0.5'

    This may be new to the latest Firmware as there are numerous posts on this forum of users using a battery to power the LoPy c/w expansion board and deepsleep module.

    I have absolutely no other connections to the board I'm testing since another populated board is doing the same thing and I wanted to exclude wiring / peripherals as the cause.

    Simple code to test operation:

    from network import WLAN
    import machine, pycom, time, sys, uos
    import deepsleep
    from deepsleep import DeepSleep
    ds = DeepSleep()
    wake_s = ds.get_wake_status()
    if wake_s['wake'] == deepsleep.PIN_WAKE:
    print("Pin wake up")
    pycom.heartbeat(False)
    for i in range(5):
    time.sleep_ms(250)
    pycom.rgbled(0x004b6a)
    time.sleep_ms(250)
    pycom.rgbled(0x000000)
    elif wake_s['wake'] == deepsleep.TIMER_WAKE:
    print("Timer wake up")
    pycom.heartbeat(False)
    for i in range(5):
    time.sleep_ms(250)
    pycom.rgbled(0x007f00)
    time.sleep_ms(250)
    pycom.rgbled(0x000000)
    else: # deepsleep.POWER_ON_WAKE:
    print("Power ON reset")
    pycom.heartbeat(False)
    pycom.rgbled(0x007f00)#green
    time.sleep(0.15)
    pycom.rgbled(0x7f7f00)#yellow
    time.sleep(0.15)
    pycom.rgbled(0x7f0000)#red
    time.sleep(0.15)
    pycom.rgbled(0x00007f)#blue
    time.sleep(0.15)
    pycom.heartbeat(True)
    print("Shutting down the Wifi!")
    wlan = WLAN()
    wlan.deinit()
    print("")
    print("Running Python %s on %s" %(sys.version, uos.uname() [4]))
    print("CPU clock = %d MHz" %(int(machine.freq()/1000/1000)))
    pycom.heartbeat(False)
    pycom.rgbled(0x007f00)#green
    time.sleep(0.15)
    pycom.rgbled(0x7f7f00)#yellow
    time.sleep(0.15)
    pycom.rgbled(0x7f0000)#red
    time.sleep(0.15)
    pycom.rgbled(0x00007f)#blue
    time.sleep(0.15)
    pycom.heartbeat(True)
    ds.go_to_sleep(10)

    Any help or advice, gratefully accepted!

    UPDATE! I can confirm this also happens using 3.7 volts into the 5v in pin instead of the battery connector!


 

Pycom on Twitter