Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    New Firmware Release Candidate v1.20.0

    Scheduled Pinned Locked Moved Announcements & News
    firmware
    81 Posts 17 Posters 22.9k Views 18 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • robert-hhR Offline
      robert-hh @iwahdan
      last edited by robert-hh

      @iwahdan The Exposed Keyboard Interrupts Control to Micropython does not work. Reason:
      The API changes the persistent flags, but the code in machuart.c and telnet.c looks at the non-persistent flags. IMHO, these non-persistent flags are not required, because it is a user script which modifies the flags and can set it back. At the REPL loop in pyexec.c, these flags are anyhow reset to the default state, once REPL gets control again. So better use the mechanism of the initial PR.

      I 1 Reply Last reply Reply Quote 0
      • I Offline
        iwahdan @robert-hh
        last edited by iwahdan

        Hello @robert-hh, sorry I misunderstood your initial PR, somehow I thought there was a need to control keyboard interrupts in normal REPL, which why I had to do these modifications for it to work.
        I agree with you, your PR is then sufficient and no further modifications needed, will correct this shortly

        Wahdan

        1 Reply Last reply Reply Quote 0
        • E Offline
          EinarJ @iwahdan
          last edited by

          @iwahdan Why is PSM and eDRX not used when running deinit(dettach=False)?

          D 1 Reply Last reply Reply Quote 0
          • D Offline
            danielm @EinarJ
            last edited by

            @einarj
            I did not perform any tests with those features yet but I think you must set requested mode and related timers by AT commands, e.g.:

            Power Saving Mode Setting:
            +CPSMS=[<mode>[,<Requested_Periodic-RAU>[,<Requested_GPRSREADYtimer>[,<Requested_PeriodicTAU>[,<Requested_Active-Time>]]]]]

            E 1 Reply Last reply Reply Quote 0
            • E Offline
              EinarJ @danielm
              last edited by

              @danielm I've tried, but it doesn't seem to have any effect. I can see it's being disabled by default in the LTE init, so I've set the command manually after that. The PSM should,in theory, cause the LTE modem go into PSM mode right after the data is sent, but that doesn't seem to happen. Maybe it's becsuse the the flag for going into PSM is not being passes to the modem. But, PSM is useless if you don't cannot setup eDRX. The modem gives me an error if I try the setting specified in the AT-command specs. Do you know if the vendor has implemented these features into the FW?

              D 1 Reply Last reply Reply Quote 0
              • D Offline
                danielm @EinarJ
                last edited by

                @einarj
                There are some eDRX-related commands as well:

                • eDRX Read Dynamic Parameters: +CEDRXRDP
                • eDRX Setting: +CEDRXS
                • Specific eDRX Settings: +SQNEDRX

                I have no idea if PSM/eDRX commands are implemented and working as expected because I did not test them yet.

                @iwahdan @Paul-Thornton
                In my opinion Pycom should provide statement regarding readiness of PSM/eDRX features implemented in the modem's firmware because without these features it is not possible to develop battery-powered solutions with reasonable long battery life-time which is the main purpose of NB-IoT.
                There should also be tutorial available in the documentation because of importance of these features.

                X 1 Reply Last reply Reply Quote 2
                • X Offline
                  Xykon administrators @danielm
                  last edited by Xykon

                  @danielm said in New Firmware Release Candidate v1.20.0.rc0:

                  @iwahdan @Paul-Thornton
                  In my opinion Pycom should provide statement regarding readiness of PSM/eDRX features implemented in the modem's firmware because without these features it is not possible to develop battery-powered solutions with reasonable long battery life-time which is the main purpose of NB-IoT.
                  There should also be tutorial available in the documentation because of importance of these features.

                  I will try to post more details about PSM/eDRX as soon as possible. Generally the standard 3GPP AT commands should be used using lte.send_at_command(). However in order to tell the modem to go into PSM/eDRX mode, lte.deinit(dettach=False) should be called. The wrong spelling of dettach aside, the modem checks the state of the flow control pins to see if it is OK to go into low power mode. The deinit command releases the flow control pins thus allowing the modem to go into the configured sleep mode.

                  In regards to the release candidate, after uploading v1.20.0.rc2 earlier today, which includes the latest Sequans firmware updater and Pybytes scripts, I have realised an error was made in pycom_config.h that causes the fs_type flag to be stored at an incorrect position. This is also the reason why the setting from the firmware updater is ignored. I have already uploaded a correction to the release-candidate branch as I had issues updating the perviously used v1.20.0.rc0 branch. I will upload a new version shortly but wanted to give people a heads-up to check the file system type in the firmware updater when updating. This should only affect people who used the commands I posted above to manually switch the fs_type with the pycom_bootmgr command.

                  Christian Ehlers

                  D S 4 Replies Last reply Reply Quote 1
                  • D Offline
                    danielm @Xykon
                    last edited by

                    @xykon
                    Yesterday I did some tests with PSM-related AT commands.
                    Is seems that following commands should sent before attaching (after first boot). Of course timer values of '+CPSMS' may be adapted.

                    self.lte.send_at_cmd('AT+CPSMS=1,,,"01000001","00000001"')
                    self.lte.send_at_cmd('AT+CEREG=4')
                    

                    After successful attach '+CEREG?' returns Active time and Periodic TAU values allocated by the network which may be identical to requested values (this is the case in NB-IoT network of Slovak Telekom) but in other networks they may be limited by the network.

                    It seems that '+CPSMS' command has to be called after consequent boots from deep-sleep (with LTE already attached) as well.

                    E 1 Reply Last reply Reply Quote 2
                    • D Offline
                      danielm @Xykon
                      last edited by danielm

                      @xykon
                      Two comments:

                      1. please rename branch "release-candiate" -> "release-candidate"
                      2. I had to install pyserial package manually, before I was getting this error:
                      # make BOARD=GPY TARGET=boot
                      Use make SECURE=on [optionally SECURE_KEY ?= secure_boot_signing_key.pem] to enable Secure Boot and Flash Encryption mechanisms.
                      Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
                      BASE Variant
                      mkdir -p build/GPY/release/bootloader/
                      CC bootloader/bootloader.c
                      CC bootloader/bootmgr.c
                      CC bootloader/mperror.c
                      CC bootloader/gpio.c
                      CC bootloader/flash_qio_mode.c
                      AR build/GPY/release/bootloader/bootloader.a
                      LINK xtensa-esp32-elf-gcc *** -nostdlib -Wl,-Map=build/GPY/release/bootloader/bootloader.map -Wl,--no-check-sections -u call_user_start_cpu0 -Wl,-static -Wl,--undefined=uxTopUsedPriority -Wl,--gc-sections -T esp32.bootloader.ld -T esp32.rom.ld -T esp32.peripherals.ld -T esp32.bootloader.rom.ld -T esp32.rom.spiram_incompatible_fns.ld *** -Wl,--start-group -Lbootloader/lib -Lbootloader -Lbuild/GPY/release/bootloader -L/root/micropython_esp32/pycom-esp-idf/components/esp32/ld -L/root/micropython_esp32/pycom-esp-idf/components/esp32/lib -llog -lcore -lbootloader_support -lspi_flash -lsoc -lmicro-ecc -lgcc -lstdc++ -lgcov build/GPY/release/bootloader/bootloader.a -Wl,--end-group -Wl,-EL -o build/GPY/release/bootloader/bootloader.elf
                         text    data     bss     dec     hex filename
                        19086    1992      40   21118    527e build/GPY/release/bootloader/bootloader.elf
                      IMAGE build/GPY/release/bootloader/bootloader.bin
                      Traceback (most recent call last):
                        File ".../micropython_esp32/pycom-esp-idf/components/esptool_py/esptool/esptool.py", line 35, in <module>
                          import serial.tools.list_ports as list_ports
                      ImportError: No module named tools.list_ports
                      application.mk:552: recipe for target 'build/GPY/release/bootloader/bootloader.bin' failed
                      make: *** [build/GPY/release/bootloader/bootloader.bin] Error 1
                      

                      Environment: Ubuntu 16.04.3 LTS 64-bit

                      1 Reply Last reply Reply Quote 0
                      • D Offline
                        danielm @Xykon
                        last edited by danielm

                        @xykon
                        Deep-sleep current on G01 with v1.20.0.rc3 built today from source:

                        import machine
                        machine.deepsleep()
                        

                        Result: 7uA OK

                        import machine
                        import network
                        lte=network.LTE()
                        lte.deinit()
                        machine.deepsleep()
                        

                        Result: 29mA Not OK!

                        Both tests are included in this graph:
                        0_1545130498361_G01_power_consumption_2.png

                        Edit: Tested with FiPy on custom board (no FTDI or other peripherals) powered with 3.75V from Otii Arc.
                        Results are almost the same as for G01!

                        • 22uA for the first test code (includes quiescent current of voltage regulator)
                        • 27mA for the second test code.

                        Same results if LTE is attached between init and deinit.
                        The modem starts attach after first lte.isattached() is called!
                        It can be clearly verified when monitoring consumption with Otii Arc or similar tool.

                        1 Reply Last reply Reply Quote 0
                        • S Offline
                          serafimsaudade @Xykon
                          last edited by

                          @xykon

                          rtc.synced() continue to return false when rtc.ntp_sync("pool.ntp.org") sync the date&time. I'm using v1.20.0.rc3 built today from source:

                          P 1 Reply Last reply Reply Quote -1
                          • E Offline
                            EinarJ @danielm
                            last edited by

                            @danielm said in New Firmware Release Candidate v1.20.0.rc0:

                            self.lte.send_at_cmd('AT+CPSMS=1,,,"01000001","00000001"')

                            Tried again with AT+CPSMS, but it seems to give me an error with the 1.20.0.rc2. On the first run, it works fine, but after waking up from a deep sleep it gives me an exception when calling the deinit() method:

                            lte.deinit(dettach=False)

                            Traceback (most recent call last):
                            File "main.py", line 90, in <module>
                            OSError: the requested operation failed
                            Pycom MicroPython 1.20.0.rc2 [v1.9.4-ecfa670] on 2018-12-17; GPy with ESP32

                            D 1 Reply Last reply Reply Quote 0
                            • D Offline
                              danielm @EinarJ
                              last edited by

                              @einarj
                              Which module are you using for testing? Can you successfully achieve desired deep-sleep current levels?

                              E 2 Replies Last reply Reply Quote 0
                              • E Offline
                                EinarJ @danielm
                                last edited by

                                @danielm I'm using the GPy. The only way of achieving desired deep-sleep current levels is when i do a "lte.deinit(dettach=True)" and have the GPy alone without any expansion board or PySense/PyTrack

                                1 Reply Last reply Reply Quote 0
                                • T Offline
                                  tlanier @iwahdan
                                  last edited by

                                  @iwahdan

                                  I'm getting invalid results (blank) from the LTE.iccid() after a modem reset.

                                  0_1545334816582_3678177a-cc0e-41a2-8308-1440f8e752d4-image.png

                                  T 1 Reply Last reply Reply Quote 0
                                  • T Offline
                                    tlanier @tlanier
                                    last edited by

                                    @tlanier

                                    The reset command does not put the modem in the same state that pressing the reset button does.

                                    0_1545335350293_2b608ae7-13de-4773-aa77-bbf965cb7cc1-image.png

                                    1 Reply Last reply Reply Quote 0
                                    • P Offline
                                      Paul Thornton @serafimsaudade
                                      last edited by Paul Thornton

                                      @serafimsaudade A fix for this should be in the next RC.

                                      1 Reply Last reply Reply Quote 0
                                      • E Offline
                                        EinarJ @danielm
                                        last edited by

                                        @danielm I've conducted some more testing now. If I enable PSM and eDRX, the commands are accepted the first time after power up. After the deep sleep period, the attach is already there, so the connection and sending of data is as fast as expected. But, when the lte.deinit(dettach=False) runs, I get an OSError. This prevents trying out the deep sleep functionality. (1.20.0.rc3)
                                        The power usage of the LTE-modem is quite high and the GPy is averaging around 200mA for the first run after a power up.
                                        Also, the deinit-method is quite slow. When using PSM, it should be possible to send the socket data with a flag indicating that the modem can release after a successful send, and the deinit-method shouldn't be necessary.

                                        I wrote my own library for a uBlox SARA-N210 breakout module and hooked it up to a LoPy. To handle the deep sleep, I used a PySense and powered the uBlox-modem on the sensor power output.
                                        Using basically the same setup, I'm issuing the same PSM and eDRX commands, but I'm also using a flag when sending the message, telling the modem to release after a successful send.

                                        This gives me some interesting results, and I hope it maybe can work as a benchmark for what results I'm also expecting for the Sequans LTE-modem

                                        The ON-cycle (after the first run when waiting for an initial attach):
                                        0_1545393098848_PycomSaraOnCycle.PNG
                                        Wakeup of the lopy, wakeup of the LTE-modem, sending the data, make the PySense go back to sleep and waiting for the uBlox-modem going back to sleep, takes only 4 seconds and uses around 165uWh. Average power draw is around 36.9mA

                                        The deep sleep cycle:
                                        0_1545393319403_PycomSaraSleepCycle.PNG
                                        Getting the expected result of 15.9uA with 11uA draw from the PySense + 4-5uA from the uBlox LTE modem when in PSM mode

                                        D 1 Reply Last reply Reply Quote 0
                                        • D Offline
                                          danielm @EinarJ
                                          last edited by danielm

                                          @einarj
                                          By release flag you mean RAI - Release Assistance Indicator? 165uWh per active cycle is pretty impressive. I would say on par with LoRa/LoRaWAN based solutions if not better.

                                          Because of the state of cellular support in Pycom products (after they are available on the market for more than a year) yesterday I started to implement similar solution - WiPy 3.0 with Quectel BC66 based on Mediatek MT2625. I do not have any power figures yet as I am currently working on basic library implementation.

                                          If this solution will be working well it will also be pretty cost-efficient and future-proof as the modem also supports Rel.14/NB2.

                                          I would also like to test BC66 with ESP32-WROOM running micropyhton.org ESP32 port which currently implements only basic features but could be suficient for simple sensors. This would lead to even more cost-efficient solution (for simple battery powered devices).

                                          Edit: BC66 contains OpenCPU functionality which allows to run application code directly on the module but development in this environment seems like return to dark ages. Would be worth in case of manufacturing really big series of super-simple devices. The module does not even require voltage regulator when powered directly from battery.

                                          0_1545399268188_IMG_20181221_142757902_small.jpg

                                          E 1 Reply Last reply Reply Quote 2
                                          • E Offline
                                            EinarJ @danielm
                                            last edited by

                                            @danielm I don't think it is RAI, but a release indicator flag that ublox has implemented in the socket send command, which tells the modem it can gi to PSM based on the PSM settings.

                                            Nice work! Guess there will be plenty of alternatives when it comes to modems. But, as you say, they must also be a little user friendly.

                                            1 Reply Last reply Reply Quote 0

                                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                            With your input, this post could be even better 💗

                                            Register Login
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 1 / 5
                                            • First post
                                              Last post

                                            Pycom on Twitter

                                            Pycom