New firmware release 1.3.0.b1



  • Hello everyone,

    On this release we have added support for the RTC and for the BLE GATT server. These are the notes:

    • esp32: BLE GATT Server API with callback method for characteristics.
    • esp32/mods/: support RTC, enable missing utime functions, store files with valid timestamps.
    • esp32/mods/pybadc.c: remove leftover bit shift from CC3200, 12 bit works now.
    • esp32: General reliability improvements to threading.
    • py: Create MICROPY_PY_THREAD_GIL_DIVISOR constant to optimize GIL lock/unlock process.
    • esp32.mods/machpin: Add pin hold() method.
    • esp32/mods/moucrypto.c: Add hardware RNG as getrandbits().
    • esp32/mods/machtimer.c: Implement sleep_us().

    Check this example that shows how to create a functional BLE peripheral with just a few lines of code:

    https://docs.pycom.io/pycom_esp32/library/network.Bluetooth.html#network.service.callback

    Please check the docs for the now pretty much complete time module:

    https://docs.pycom.io/pycom_esp32/library/utime.html

    The newly added RTC class:

    https://docs.pycom.io/pycom_esp32/library/machine.RTC.html

    I hope that you find the new features useful, specially the ones for BLE. We are mindful that Bluetooth is a huge thing, so we will be adding more functionality to it every week.

    Cheers,
    Daniel



  • If bluetooth was not working, than that could be blamed on tight loop without opportunity to release processor (sleep), but that is not the case. Following code takes few minutes to get to green light:

    import pycom

    from network import Bluetooth

    bluetooth = Bluetooth()
    pycom.heartbeat(False) # disable the heartbeat LED

    pycom.rgbled(0xff0000)
    pycom.rgbled(0x00ff00)
    pycom.rgbled(0x0000ff)

    It seems that same resource (line?) driving BLE is used for bit banging LED in 1.3...
    There is change about it in 1.4.0, so maybe this will be fixed.



  • Hi everyone,

    At the moment we are only using one of the 2 cores, but we plan to enable multi-core support soon. MicroPython will run on core #1 and the network stacks (BT, WiFi, LoRa, Sigfox) will run on core #0. We have chosen to stay on 1 core for a while to wait for the ESP IDF to become stable enough around dual core support.'

    Cheers,
    Daniel



  • @zmrzli
    It's not such a bad question because the ESP32 is dual core. I remember reading the original plan was one core would handle all networking while the other would be totally free for the user to use, not sure if that's still the case. Now I'm curious to find out :)

    That said for sure there's all sorts of locks involved even with two cores so could be the reason



  • @zmrzli you are clogging the main thread in that sample code and the CPU never gets to do anything else because of that while True, if you want to change the LED color this fast, try putting it in a thread. And please add some delay between those LED color sets.

    import pycom
    import time
    import _thread
    from network import Bluetooth
    
    bluetooth = Bluetooth()
    pycom.heartbeat(False) # disable the heartbeat LED
    
    def led_totary(id):
        while True:
            pycom.rgbled(0xff0000) # make the LED light up in RED color
            time.sleep_ms(50)
            pycom.rgbled(0x00ff00) # make the LED light up in GREEN color
            time.sleep_ms(50)
            pycom.rgbled(0x0000ff) # make the LED light up in BLUE color
            time.sleep_ms(50)
    
    
    _thread.start_new_thread(led_totary, (0)) 
    


  • @zmrzli - I think you need a short sleep in your loop otherwise it will consume 100% processor time and there won't be time to do anything else ?!



  • Program below switches led colors every minute or so if Bluetooth() is called.
    Without it runs as expected.
    Is that a bug?

    import pycom
    from network import Bluetooth

    bluetooth = Bluetooth()
    pycom.heartbeat(False) # disable the heartbeat LED

    while True:
    pycom.rgbled(0xff0000) # make the LED light up in RED color
    pycom.rgbled(0x00ff00) # make the LED light up in GREEN color
    pycom.rgbled(0x0000ff) # make the LED light up in BLUE color



  • @daniel Version 1.1.0 is still not available in the downloads section, when will it be available? Thanks.



  • Thanks for this update! I have a question about RTC. Our application requires very low power. The RTC doc says, "The RTC counter ticks at 5 MHz.", but the LoPy (OEM) spec sheet says RTC uses 32KHz, Will a future release give us the option of specifying the 32KHz clock?

    Thanks!



  • @crankshaft said in New firmware release 1.3.0.b1:

    @daniel - Thanks for the update, but I am struggling with the 100 - 120ma power consumption of the wipy2 and need to reduce power by using the machine.sleep modes and RTC.wakeup()

    Any idea when this will be added ?

    Loot at this topic.



  • @daniel - Thanks for the update, but I am struggling with the 100 - 120ma power consumption of the wipy2 and need to reduce power by using the machine.sleep modes and RTC.wakeup()

    Any idea when this will be added ?



  • @iotoz said in New firmware release 1.3.0.b1:

    @daniel Thanks for that, I had checked there. I can still only find pycom_update_1.0.0.b3.tar.gz for linux, or any other platform.
    Any chance that you can post a direct link to the linux firmware 1.3.0.b1 ?
    Would be ideal to see a Git rep with the firmware versions to choose.

    See this post :
    "The "file" attribute shows the direct link to the firmware binary files. You can then download the file with wget "https://software.pycom.io/downloads/1.0.0.b2-LoPy_868.tar.gz" and use bin/updater.py -t 1.0.0.b2-LoPy_868.tar.gz -p /dev/ttyUSB0"

    So for 1.3.0.b1 with 915MHz, download the file :
    https://software.pycom.io/downloads/1.3.0.b1-LoPy_915.tar.gz



  • Thanks I'm looking forward to the fix. Until then 1.1.0 will probably do the job.



  • @iotoz we have made previous releases available, but 1.1.0 is not there. We'll make that one available on Monday. I'll let you know once that's done.

    Cheers,
    Daniel



  • @iotoz yes we are aware that it was promised for this release but we haven't been able to fix it yet, sorry for the delay. Long story short, the TLS/SSL library runs out of memory while wrapping the socket. This problem was introduced when we enabled Bluetooth support. We have raised this issue with Espressif and they are working on optimizations to solve this once and for all. We were really hoping to sort it out for this release but unfortunately it wan't possible.

    Trust me, this is a major issue for us as well, and it's on the top of out list. We'll let you know once we have more news.

    Cheers,
    Daniel



  • Hi thanks for the update. I have a project connecting to websockets over ssl. Since last release my project broke, a ssl fix was promised this release however the project still doesn't run. Can I expect a fix in the next days? Is there a way to revert my firmware to a previous version? I like to revert to version 1.1.

    Keep up the good work.



  • @iotoz that's the version of the updater only. Please use it and it will tell you that it's going to apply firmware version 1.3.0.b1 to your modules.



  • @daniel Thanks for that, I had checked there. I can still only find pycom_update_1.0.0.b3.tar.gz for linux, or any other platform.
    Any chance that you can post a direct link to the linux firmware 1.3.0.b1 ?
    Would be ideal to see a Git rep with the firmware versions to choose.



  • @iotoz it's here: https://www.pycom.io/support/supportdownloads/

    (Under Firmware Updates)

    Cheers,
    Daniel



  • Where do we find this elusive firmware update? Can't wait to use it.
    If it is not available yet, when?


Log in to reply
 

Pycom on Twitter