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 23.0k 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.
    • I Offline
      iwahdan
      last edited by iwahdan

      Hello Everyone ,

      we've uploaded new Firmware Release v1.20.0.rc0 as a candidate release for coming new stable release v1.20.0 this release include the following changes:

      Improvements:

      • Organized ports under one directory
      • Micropython v1.9.4
      • Disable/enable GIL when transmitting/receiving pulses in RMT module
      • Unlock the GIL while accessing queues
      • Add script to build release package via makefile or script in tools
      • Improving Non-Blocking sockets
      • Adaption for uasyncio MicroPython library
      • Exposing new Socket Options
      • Major LTE module Updates
      • Re-structring of Frozen folder
      • Fixed Issue with memory leak in thread lock creation
      • Fixed problem in antenna switch in newer esp32 chip models
      • General fixes and improvements to the LoRaWAN stack
      • Applied workaround for socket.connect timeout
      • Added timeout option for ussl.wrap_socket to timeout SSL Handshake
      • Enabled reading the value of any descriptor with standard defined 2byte UUID in BLE
      • Added Bluetooth timeout parameter to bluetooth.connect()
      • Added support for new LTE bands (5,8)

      New Features:

      • Introduced new Filesystem LittleFS
      • Enabled uzlib in Micropython
      • Added LightSleep functionality
      • Added Dynamic filesystem functionality and new Bootmgr function in Pycom module
      • Added support for RTC memory operations Read/Write
      • Added Lora Mesh - openthread protocol
      • Build Process now support building Pybytes firmwares via Build option VARIANT
      • New Frozen Libs for LTE Sequans modem upgrades

      WiFi Updates:

      • Added new API to get list of STAs connected to Soft-AP
      • Updated wlan_scan to include other parameters
      • Added timout handling in wlan_connect + refactoring
      • Added new API for setting max tx power for Wifi
      • Added Set/Get API for Country configuration
      • Refactored "wlan_setup" function
      • Fixed Issue of ftp/telnet servers enabling when wifi_on_boot is not enabled
      • Added new API wlan.joined_ap_info()
      • Added API to get/set wifi protocol + updated wlan_channel to support sniffing
      • Added support for setting mac addr for STA and AP
      • Added API for sending Raw 80211 messages
      • Added promiscuous mode

      You can download the sources from https://github.com/pycom/pycom-micropython-sigfox/tree/v1.20.0.rc0

      You also can flash Pycom boards with this release by choosing development type in Firmware updater tool

      A link to Documentation page will be added soon.

      Note: The function os.mkfs() has been replaced with os.fsformat() To format the internal file system, use os.fsformat('/flash') and os.fsformat('/sd') to format SD cards (card needs to be mounted as '/sd')

      To mount the SD card, use this code:

      sd = SD()
      fs = os.mkfat(sd)
      os.mount(fs, '/sd')
      

      Wahdan

      D robert-hhR C C T 7 Replies Last reply Reply Quote 1
      • D Offline
        danielm @iwahdan
        last edited by

        @iwahdan
        Thanks a lot for new release candidate.

        I am testing with code provided earlier this week:
        https://drive.google.com/open?id=1JwP1Pc3V78X2dhKK3qF_Hh-XGWKdzZqP

        LTE object fails to init (application hangs) after soft-reset. It does not happen every time but very often.

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

          @iwahdan Thanks. It works with LTE on band 8. One observation, which others made before too, IIRC. The first attach after power on takes almost forever, like 15 minutes. the subsequent attaches are fast, as long as power is maintained. Another LTE modem I have behaves different. Their first attach also takes long, but on subsequent power cycles attaching stays fast, within a second.

          Unrelated note: The py/modmicropython.c change for ctrl-f handling is not yet included.

          D 1 Reply Last reply Reply Quote 0
          • D Offline
            danielm @robert-hh
            last edited by danielm

            @robert-hh
            It seems that you don't have issues with LTE object initialization (network.LTE())?
            Could you please try to run the code from my previous post and perform several soft-resets? There are some LTE stats included as well.

            Btw longest attach I experienced ever was about 5mins long. Usually it takes only several seconds and I am testing in an area with not optimal conditions. It seems the duration really depends on conditions in specific network.

            What is the proposed change of CTRL-F behavior?

            robert-hhR 1 Reply Last reply Reply Quote 0
            • robert-hhR Offline
              robert-hh @danielm
              last edited by

              @danielm SOft reset does not reset the LTE modem. A subsequent LTE() fails for me.
              The changed cttrl-f behaviour allows to disable safe boot via ctrl-f in case you need it.

              D 1 Reply Last reply Reply Quote 0
              • D Offline
                danielm @robert-hh
                last edited by danielm

                @robert-hh
                In our application we are resetting the modem with 'AT+CFUN=1,1' command after each boot. Anyway for that the LTE object must be already initialized.

                A workaround might be to initialize UART object on LTE_RX and LTE_TX pins but I did not try that yet and I am not sure if it will be allowed by Pycom MicroPython.

                EDIT: It seems that it is possible to init UART object using P20 and P18, but I am not sure what UART parameters to set. Probably can be found in modlte.c and included files.

                In normal situation I would prefer to avoid resetting the modem as it can be already attached operating in eDRX or PSM mode. However the LTE.init() must work reliably first.

                robert-hhR 1 Reply Last reply Reply Quote 0
                • D Offline
                  danielm
                  last edited by

                  @iwahdan
                  This code in main.py will hang eventually:

                  import machine
                  import network
                  lte = network.LTE()
                  print("LTE initialized")
                  machine.reset()
                  

                  This code in main.py will hang in few rounds:

                  import machine
                  import network
                  lte = network.LTE()
                  print("LTE initialized")
                  lte.deinit()
                  print("LTE deinitialized")
                  machine.reset()
                  

                  I believe we are facing some timing issues. Firmware is always able to trigger safe-boot reset using Ctrl-F. Tested with NB1-40343.

                  I 1 Reply Last reply Reply Quote 0
                  • I Offline
                    iwahdan @danielm
                    last edited by

                    @danielm can you try with putting a sleep time of 1-2 sec before LTE init

                    Wahdan

                    D C 3 Replies Last reply Reply Quote 0
                    • D Offline
                      danielm @iwahdan
                      last edited by danielm

                      @iwahdan
                      This code in main.py runs for 10 minutes without any hang:

                      import machine
                      import network
                      import time
                      time.sleep(2)
                      lte = network.LTE()
                      print("LTE initialized")
                      lte.deinit()
                      print("LTE deinitialized")
                      machine.reset()
                      
                      1 Reply Last reply Reply Quote 0
                      • robert-hhR Offline
                        robert-hh @danielm
                        last edited by

                        @danielm The UART runs at 921600 Baud, 8N1 for the other parameters..

                        D 1 Reply Last reply Reply Quote 0
                        • D Offline
                          danielm @robert-hh
                          last edited by

                          @robert-hh
                          Yes, I already found out but I did not get any response from the modem when initialized on bus 1. MP does not allow to initialize on bus 2.

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

                            @iwahdan
                            Here is updated test code v4:
                            https://drive.google.com/open?id=1RPJlMgWEqe_eMwWZEvPhof2E_Qpo1s1v

                            Changes:

                            • added 2s sleep time before LTE init
                            • disabled WDT
                            • ussl.wrap_socket() in urequests with defined timeout parameter
                            • auto restart after 8 HTTPS requests

                            Issues:

                            • rare LTE init hang (In my opinion a timeout should be implemented for lte.init() as well)
                            • when modem synchro state goes to OFF (why???), lte.isattached() and lte.isconnected() remain True and this state continues until next HARD reset (including modem reset):
                            rst:0x7 (TG0WDT_SYS_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:0x3fff8028,len:8
                            load:0x3fff8030,len:1984
                            load:0x4009fa00,len:0
                            load:0x4009fa00,len:19088
                            entry 0x400a05e4
                            Initializing filesystem as FatFS!
                            INFO Starting initialization of LTE
                            INFO LTE initialized
                            LTE is attached after init: True
                            LTE is connected after init: False
                            INFO Attached to LTE network
                            INFO LTE connect command sent
                            INFO Connected to LTE network
                            LTE Attached:True Connected:True Synchro state:CELL_ACQUIRED RSRP:-96.24dBm RSRQ:-14.63dB
                            INFO 1. HTTP POST successful: {"args":{},"data":{"time":"15"},"files":{},"form":{},"headers":{"x-forwarded-proto":"https","host":"54.234.238.118","content-length":"14","accept":"application/json","content-type":"application/json","x-forwarded-port":"443"},"json":{"time":"15"},"url":"https://54.234.238.118/post"} (duration: 23s)
                            LTE Attached:True Connected:True Synchro state:CELL_ACQUIRED RSRP:-96.90001dBm RSRQ:-15.2dB
                            WARNING 2. HTTP POST failed: -26624 (duration: 17s)
                            LTE Attached:True Connected:True Synchro state:CELL_ACQUIRED RSRP:-98.25dBm RSRQ:-15.95dB
                            INFO 3. HTTP POST successful: {"args":{},"data":{"time":"75"},"files":{},"form":{},"headers":{"x-forwarded-proto":"https","host":"54.234.238.118","content-length":"14","accept":"application/json","content-type":"application/json","x-forwarded-port":"443"},"json":{"time":"75"},"url":"https://54.234.238.118/post"} (duration: 15s)
                            LTE Attached:True Connected:True Synchro state:CELL_ACQUIRED RSRP:-97.04dBm RSRQ:-15.45dB
                            INFO 4. HTTP POST successful: {"args":{},"data":{"time":"100"},"files":{},"form":{},"headers":{"x-forwarded-proto":"https","host":"54.234.238.118","content-length":"15","accept":"application/json","content-type":"application/json","x-forwarded-port":"443"},"json":{"time":"100"},"url":"https://54.234.238.118/post"} (duration: 16s)
                            LTE Attached:True Connected:True Synchro state:CELL_ACQUIRED RSRP:-97.40001dBm RSRQ:-15.8dB
                            WARNING 5. HTTP POST failed: -26624 (duration: 14s)
                            LTE Attached:True Connected:True Synchro state:CELL_ACQUIRED RSRP:-96.84dBm RSRQ:-15.1dB
                            INFO 6. HTTP POST successful: {"args":{},"data":{"time":"144"},"files":{},"form":{},"headers":{"x-forwarded-proto":"https","host":"54.234.238.118","content-length":"15","accept":"application/json","content-type":"application/json","x-forwarded-port":"443"},"json":{"time":"144"},"url":"https://54.234.238.118/post"} (duration: 14s)
                            LTE Attached:True Connected:True Synchro state:CELL_ACQUIRED RSRP:-97.61001dBm RSRQ:-15.41dB
                            WARNING 7. HTTP POST failed: -26624 (duration: 14s)
                            LTE Attached:True Connected:True Synchro state:CELL_ACQUIRED RSRP:-95.44dBm RSRQ:-14.55dB
                            INFO 8. HTTP POST successful: {"args":{},"data":{"time":"186"},"files":{},"form":{},"headers":{"x-forwarded-proto":"https","host":"54.234.238.118","content-length":"15","accept":"application/json","content-type":"application/json","x-forwarded-port":"443"},"json":{"time":"186"},"url":"https://54.234.238.118/post"} (duration: 18s)
                            Restarting...
                            ets Jun  8 2016 00:22:57
                            
                            rst:0x7 (TG0WDT_SYS_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:0x3fff8028,len:8
                            load:0x3fff8030,len:1984
                            load:0x4009fa00,len:0
                            load:0x4009fa00,len:19088
                            entry 0x400a05e4
                            Initializing filesystem as FatFS!
                            INFO Starting initialization of LTE
                            INFO LTE initialized
                            LTE is attached after init: True
                            LTE is connected after init: False
                            INFO Attached to LTE network
                            INFO LTE connect command sent
                            INFO Connected to LTE network
                            LTE Attached:True Connected:True Synchro state:CELL_ACQUIRED RSRP:-96.48dBm RSRQ:-15.11dB
                            INFO 1. HTTP POST successful: {"args":{},"data":{"time":"15"},"files":{},"form":{},"headers":{"x-forwarded-proto":"https","host":"54.234.238.118","content-length":"14","accept":"application/json","content-type":"application/json","x-forwarded-port":"443"},"json":{"time":"15"},"url":"https://54.234.238.118/post"} (duration: 16s)
                            LTE Attached:True Connected:True Synchro state:CELL_ACQUIRED RSRP:-96.67dBm RSRQ:-14.58dB
                            WARNING 2. HTTP POST failed: -26624 (duration: 15s)
                            LTE Attached:True Connected:True Synchro state:OFF RSRP:-2.147484e+07dBm RSRQ:-17.19dB
                            WARNING 3. HTTP POST failed: timed out (duration: 10s)
                            LTE Attached:True Connected:True Synchro state:OFF RSRP:-2.147484e+07dBm RSRQ:-17.19dB
                            WARNING 4. HTTP POST failed: timed out (duration: 10s)
                            LTE Attached:True Connected:True Synchro state:OFF RSRP:-2.147484e+07dBm RSRQ:-17.19dB
                            WARNING 5. HTTP POST failed: timed out (duration: 10s)
                            LTE Attached:True Connected:True Synchro state:OFF RSRP:-2.147484e+07dBm RSRQ:-17.19dB
                            WARNING 6. HTTP POST failed: timed out (duration: 10s)
                            LTE Attached:True Connected:True Synchro state:OFF RSRP:-2.147484e+07dBm RSRQ:-17.19dB
                            WARNING 7. HTTP POST failed: timed out (duration: 10s)
                            LTE Attached:True Connected:True Synchro state:OFF RSRP:-2.147484e+07dBm RSRQ:-17.19dB
                            WARNING 8. HTTP POST failed: timed out (duration: 10s)
                            Restarting...
                            ets Jun  8 2016 00:22:57
                            
                            rst:0x7 (TG0WDT_SYS_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:0x3fff8028,len:8
                            load:0x3fff8030,len:1984
                            load:0x4009fa00,len:0
                            load:0x4009fa00,len:19088
                            entry 0x400a05e4
                            Initializing filesystem as FatFS!
                            INFO Starting initialization of LTE
                            INFO LTE initialized
                            LTE is attached after init: True
                            LTE is connected after init: False
                            INFO Attached to LTE network
                            INFO LTE connect command sent
                            INFO Connected to LTE network
                            LTE Attached:True Connected:True Synchro state:OFF RSRP:-2.147484e+07dBm RSRQ:-17.19dB
                            WARNING 1. HTTP POST failed: timed out (duration: 10s)
                            LTE Attached:True Connected:True Synchro state:OFF RSRP:-2.147484e+07dBm RSRQ:-17.19dB
                            WARNING 2. HTTP POST failed: timed out (duration: 10s)
                            LTE Attached:True Connected:True Synchro state:OFF RSRP:-2.147484e+07dBm RSRQ:-17.19dB
                            

                            Another type of connection failure - Synchro state is CELL_ACQUIRED, RSRP and RSRQ at acceptable levels, but HTTPS request always fails. It always timeouts after 10s (timeout defined for socket and ssl operations) therefore I believe that failing operation is socket.connect(). After hard reset the connection starts working again.

                            rst:0x7 (TG0WDT_SYS_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:0x3fff8028,len:8
                            load:0x3fff8030,len:1984
                            load:0x4009fa00,len:0
                            load:0x4009fa00,len:19088
                            entry 0x400a05e4
                            Initializing filesystem as FatFS!
                            INFO Starting initialization of LTE
                            INFO LTE initialized
                            LTE is attached after init: True
                            LTE is connected after init: False
                            INFO Attached to LTE network
                            INFO LTE connect command sent
                            INFO Connected to LTE network
                            LTE Attached:True Connected:True Synchro state:CELL_ACQUIRED RSRP:-96.16dBm RSRQ:-14.57dB
                            WARNING 1. HTTP POST failed: timed out (duration: 10s)
                            LTE Attached:True Connected:True Synchro state:CELL_ACQUIRED RSRP:-95.78dBm RSRQ:-14.1dB
                            WARNING 2. HTTP POST failed: timed out (duration: 10s)
                            LTE Attached:True Connected:True Synchro state:CELL_ACQUIRED RSRP:-95.22dBm RSRQ:-13.86dB
                            WARNING 3. HTTP POST failed: timed out (duration: 10s)
                            LTE Attached:True Connected:True Synchro state:CELL_ACQUIRED RSRP:-95.22dBm RSRQ:-13.99dB
                            WARNING 4. HTTP POST failed: timed out (duration: 10s)
                            LTE Attached:True Connected:True Synchro state:CELL_ACQUIRED RSRP:-94.98dBm RSRQ:-14.12dB
                            WARNING 5. HTTP POST failed: timed out (duration: 10s)
                            LTE Attached:True Connected:True Synchro state:CELL_ACQUIRED RSRP:-95.23dBm RSRQ:-14.06dB
                            WARNING 6. HTTP POST failed: timed out (duration: 10s)
                            LTE Attached:True Connected:True Synchro state:CELL_ACQUIRED RSRP:-95.25001dBm RSRQ:-14.09dB
                            WARNING 7. HTTP POST failed: timed out (duration: 10s)
                            LTE Attached:True Connected:True Synchro state:CELL_ACQUIRED RSRP:-93.96dBm RSRQ:-13.97dB
                            WARNING 8. HTTP POST failed: timed out (duration: 10s)
                            Restarting...
                            ets Jun  8 2016 00:22:57
                            
                            rst:0x7 (TG0WDT_SYS_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:0x3fff8028,len:8
                            load:0x3fff8030,len:1984
                            load:0x4009fa00,len:0
                            load:0x4009fa00,len:19088
                            entry 0x400a05e4
                            Initializing filesystem as FatFS!
                            INFO Starting initialization of LTE
                            INFO LTE initialized
                            LTE is attached after init: True
                            LTE is connected after init: False
                            INFO Attached to LTE network
                            INFO LTE connect command sent
                            INFO Connected to LTE network
                            LTE Attached:True Connected:True Synchro state:CELL_ACQUIRED RSRP:-93.3dBm RSRQ:-13.63dB
                            WARNING 1. HTTP POST failed: timed out (duration: 10s)
                            LTE Attached:True Connected:True Synchro state:CELL_ACQUIRED RSRP:-94.2dBm RSRQ:-13.46dB
                            WARNING 2. HTTP POST failed: timed out (duration: 10s)
                            LTE Attached:True Connected:True Synchro state:CELL_ACQUIRED RSRP:-93.72001dBm RSRQ:-13.85dB
                            WARNING 3. HTTP POST failed: timed out (duration: 10s)
                            LTE Attached:True Connected:True Synchro state:CELL_ACQUIRED RSRP:-95.63dBm RSRQ:-14.87dB
                            WARNING 4. HTTP POST failed: timed out (duration: 10s)
                            LTE Attached:True Connected:True Synchro state:CELL_ACQUIRED RSRP:-95.43dBm RSRQ:-14.86dB
                            WARNING 5. HTTP POST failed: timed out (duration: 10s)
                            LTE Attached:True Connected:True Synchro state:CELL_ACQUIRED RSRP:-94.25dBm RSRQ:-13.74dB
                            WARNING 6. HTTP POST failed: timed out (duration: 10s)
                            LTE Attached:True Connected:True Synchro state:CELL_ACQUIRED RSRP:-94.55dBm RSRQ:-14.13dB
                            WARNING 7. HTTP POST failed: timed out (duration: 10s)
                            LTE Attached:True Connected:True Synchro state:CELL_ACQUIRED RSRP:-93.21dBm RSRQ:-13.11dB
                            WARNING 8. HTTP POST failed: timed out (duration: 10s)
                            Restarting...
                            ets Jun  8 2016 00:22:57
                            
                            rst:0x7 (TG0WDT_SYS_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:0x3fff8028,len:8
                            load:0x3fff8030,len:1984
                            load:0x4009fa00,len:0
                            load:0x4009fa00,len:19088
                            entry 0x400a05e4
                            Initializing filesystem as FatFS!
                            INFO Starting initialization of LTE
                            INFO LTE initialized
                            LTE is attached after init: True
                            LTE is connected after init: False
                            INFO Attached to LTE network
                            INFO LTE connect command sent
                            INFO Connected to LTE network
                            LTE Attached:True Connected:True Synchro state:CELL_ACQUIRED RSRP:-92.36dBm RSRQ:-13.48dB
                            WARNING 1. HTTP POST failed: timed out (duration: 10s)
                            
                            ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
                            
                            Session stopped
                                - Press <return> to exit tab
                                - Press R to restart session
                                - Press S to save terminal output to file
                            
                            Error reading from serial device
                            INFO LTE initialized
                            LTE is attached after init: False
                            LTE is connected after init: False
                            INFO LTE attach command sent (band:20 APN:nbiot.telekom.sk)
                            LTE Attached:False Connected:False Synchro state:OFF RSRP:0.0dBm RSRQ:0.0dB
                            LTE Attached:False Connected:False Synchro state:CELL_SEARCH RSRP:0.0dBm RSRQ:0.0dB
                            LTE Attached:False Connected:False Synchro state:MIB_DETECT RSRP:-93.55dBm RSRQ:-13.73dB
                            LTE Attached:False Connected:False Synchro state:RSRP RSRP:-97.54001dBm RSRQ:-16.78dB
                            LTE Attached:False Connected:False Synchro state:CELL_SEARCH RSRP:-2.147484e+07dBm RSRQ:-16.39dB
                            LTE Attached:False Connected:False Synchro state:SIB1_ACQ RSRP:-93.1dBm RSRQ:-14.82dB
                            LTE Attached:False Connected:False Synchro state:CELL_ACQUIRED RSRP:-93.0dBm RSRQ:-14.31dB
                            LTE Attached:False Connected:False Synchro state:CELL_ACQUIRED RSRP:-92.54001dBm RSRQ:-13.61dB
                            LTE Attached:False Connected:False Synchro state:CELL_ACQUIRED RSRP:-92.72dBm RSRQ:-13.49dB
                            LTE Attached:False Connected:False Synchro state:CELL_ACQUIRED RSRP:-92.7dBm RSRQ:-13.33dB
                            LTE Attached:False Connected:False Synchro state:CELL_ACQUIRED RSRP:-92.74dBm RSRQ:-13.24dB
                            LTE Attached:False Connected:False Synchro state:CELL_ACQUIRED RSRP:-92.76999dBm RSRQ:-13.26dB
                            LTE Attached:False Connected:False Synchro state:CELL_ACQUIRED RSRP:-92.69dBm RSRQ:-13.26dB
                            LTE Attached:False Connected:False Synchro state:CELL_ACQUIRED RSRP:-92.79dBm RSRQ:-13.3dB
                            LTE Attached:False Connected:False Synchro state:CELL_ACQUIRED RSRP:-92.75001dBm RSRQ:-13.2dB
                            LTE Attached:False Connected:False Synchro state:CELL_ACQUIRED RSRP:-93.5dBm RSRQ:-14.4dB
                            LTE Attached:False Connected:False Synchro state:CELL_ACQUIRED RSRP:-93.08dBm RSRQ:-14.03dB
                            LTE Attached:False Connected:False Synchro state:CELL_ACQUIRED RSRP:-92.65dBm RSRQ:-13.66dB
                            LTE Attached:False Connected:False Synchro state:CELL_ACQUIRED RSRP:-92.40001dBm RSRQ:-13.32dB
                            LTE Attached:False Connected:False Synchro state:CELL_ACQUIRED RSRP:-92.31dBm RSRQ:-13.24dB
                            LTE Attached:False Connected:False Synchro state:CELL_ACQUIRED RSRP:-92.41dBm RSRQ:-13.28dB
                            LTE Attached:False Connected:False Synchro state:CELL_ACQUIRED RSRP:-92.45dBm RSRQ:-13.28dB
                            LTE Attached:False Connected:False Synchro state:CELL_ACQUIRED RSRP:-92.76999dBm RSRQ:-13.36dB
                            LTE Attached:False Connected:False Synchro state:CELL_ACQUIRED RSRP:-93.13dBm RSRQ:-13.63dB
                            LTE Attached:False Connected:False Synchro state:CELL_ACQUIRED RSRP:-93.25dBm RSRQ:-13.68dB
                            LTE Attached:False Connected:False Synchro state:CELL_ACQUIRED RSRP:-93.3dBm RSRQ:-13.71dB
                            LTE Attached:False Connected:False Synchro state:CELL_ACQUIRED RSRP:-93.21dBm RSRQ:-13.51dB
                            LTE Attached:False Connected:False Synchro state:CELL_ACQUIRED RSRP:-93.21dBm RSRQ:-13.47dB
                            LTE Attached:False Connected:False Synchro state:CELL_ACQUIRED RSRP:-93.13dBm RSRQ:-13.49dB
                            LTE Attached:False Connected:False Synchro state:CELL_ACQUIRED RSRP:-93.11999dBm RSRQ:-13.57dB
                            LTE Attached:False Connected:False Synchro state:CELL_ACQUIRED RSRP:-93.11dBm RSRQ:-13.64dB
                            LTE Attached:False Connected:False Synchro state:CELL_ACQUIRED RSRP:-93.18999dBm RSRQ:-13.76dB
                            LTE Attached:False Connected:False Synchro state:CELL_ACQUIRED RSRP:-93.18999dBm RSRQ:-13.75dB
                            LTE Attached:False Connected:False Synchro state:CELL_ACQUIRED RSRP:-93.34dBm RSRQ:-13.79dB
                            LTE Attached:False Connected:False Synchro state:CELL_ACQUIRED RSRP:-93.27dBm RSRQ:-13.72dB
                            LTE Attached:True Connected:False Synchro state:CELL_ACQUIRED RSRP:-93.18dBm RSRQ:-13.64dB
                            INFO Attached to LTE network
                            INFO LTE connect command sent
                            INFO Connected to LTE network
                            LTE Attached:True Connected:True Synchro state:CELL_ACQUIRED RSRP:-93.09dBm RSRQ:-13.31dB
                            INFO 1. HTTP POST successful: {"args":{},"data":{"time":"34"},"files":{},"form":{},"headers":{"x-forwarded-proto":"https","host":"54.234.238.118","content-length":"14","accept":"application/json","content-type":"application/json","x-forwarded-port":"443"},"json":{"time":"34"},"url":"https://54.234.238.118/post"} (duration: 13s)
                            LTE Attached:True Connected:True Synchro state:CELL_ACQUIRED RSRP:-93.38dBm RSRQ:-13.57dB
                            INFO 2. HTTP POST successful: {"args":{},"data":{"time":"56"},"files":{},"form":{},"headers":{"x-forwarded-proto":"https","host":"54.234.238.118","content-length":"14","accept":"application/json","content-type":"application/json","x-forwarded-port":"443"},"json":{"time":"56"},"url":"https://54.234.238.118/post"} (duration: 12s)
                            LTE Attached:True Connected:True Synchro state:CELL_ACQUIRED RSRP:-92.95dBm RSRQ:-13.43dB
                            INFO 3. HTTP POST successful: {"args":{},"data":{"time":"78"},"files":{},"form":{},"headers":{"x-forwarded-proto":"https","host":"54.234.238.118","content-length":"14","accept":"application/json","content-type":"application/json","x-forwarded-port":"443"},"json":{"time":"78"},"url":"https://54.234.238.118/post"} (duration: 11s)
                            LTE Attached:True Connected:True Synchro state:CELL_ACQUIRED RSRP:-94.05dBm RSRQ:-14.2dB
                            INFO 4. HTTP POST successful: {"args":{},"data":{"time":"98"},"files":{},"form":{},"headers":{"x-forwarded-proto":"https","host":"54.234.238.118","content-length":"14","accept":"application/json","content-type":"application/json","x-forwarded-port":"443"},"json":{"time":"98"},"url":"https://54.234.238.118/post"} (duration: 12s)
                            LTE Attached:True Connected:True Synchro state:CELL_ACQUIRED RSRP:-93.47dBm RSRQ:-13.76dB
                            INFO 5. HTTP POST successful: {"args":{},"data":{"time":"120"},"files":{},"form":{},"headers":{"x-forwarded-proto":"https","host":"54.234.238.118","content-length":"15","accept":"application/json","content-type":"application/json","x-forwarded-port":"443"},"json":{"time":"120"},"url":"https://54.234.238.118/post"} (duration: 10s)
                            LTE Attached:True Connected:True Synchro state:CELL_ACQUIRED RSRP:-92.95dBm RSRQ:-13.53dB
                            INFO 6. HTTP POST successful: {"args":{},"data":{"time":"140"},"files":{},"form":{},"headers":{"x-forwarded-proto":"https","host":"54.234.238.118","content-length":"15","accept":"application/json","content-type":"application/json","x-forwarded-port":"443"},"json":{"time":"140"},"url":"https://54.234.238.118/post"} (duration: 11s)
                            LTE Attached:True Connected:True Synchro state:CELL_ACQUIRED RSRP:-93.71dBm RSRQ:-13.73dB
                            INFO 7. HTTP POST successful: {"args":{},"data":{"time":"160"},"files":{},"form":{},"headers":{"x-forwarded-proto":"https","host":"54.234.238.118","content-length":"15","accept":"application/json","content-type":"application/json","x-forwarded-port":"443"},"json":{"time":"160"},"url":"https://54.234.238.118/post"} (duration: 13s)
                            LTE Attached:True Connected:True Synchro state:CELL_ACQUIRED RSRP:-93.46dBm RSRQ:-13.82dB
                            INFO 8. HTTP POST successful: {"args":{},"data":{"time":"182"},"files":{},"form":{},"headers":{"x-forwarded-proto":"https","host":"54.234.238.118","content-length":"15","accept":"application/json","content-type":"application/json","x-forwarded-port":"443"},"json":{"time":"182"},"url":"https://54.234.238.118/post"} (duration: 11s)
                            Restarting...
                            
                            I 1 Reply Last reply Reply Quote 0
                            • I Offline
                              iwahdan @danielm
                              last edited by

                              @danielm ok, i’ll Run your code tomorrow on our NB-IoT emulator in the office to try to see where is the problem

                              Wahdan

                              D 1 Reply Last reply Reply Quote 0
                              • R Offline
                                reidfo
                                last edited by

                                This code seems to be running okay on a FIPY, with the exception of rtc.ntp_sync(). As was noticed a while back in [this thread]](https://forum.pycom.io/topic/1414/i-swore-i-had-rtc-ntp_sync-working-on-my-lopy-and-now-i-can-t-get-it-working-at-all/2), after a soft reset (i.e. after uploading code from Pymakr) the RTC won't sync. I added a check for this and machine.reset() to my code, but it still won't sync after that. I have to physically hit the reset button on the FIPY before the clock will sync again.

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

                                  @iwahdan
                                  OK, are you able to simulate deteriorating radio conditions/packet loss? In my opinion it is necessary to perform tests in conditions which are close to limits of modulation/modem capabilities.

                                  Some LTE-related questions:

                                  1. Does current NB-IoT firmware for Sequans modem support all Coverage Extension modes?
                                  2. If so, how exactly is the switch between EC0, EC1 and EC2 performed?
                                  3. What are the EC mode switch thresholds for the Sequans modem? The algorithm should be based on RSRP value, or am I wrong?
                                  4. Is it necessary to trigger re-attach from application code in case of EC mode change?
                                  1 Reply Last reply Reply Quote 0
                                  • D Offline
                                    danielm @reidfo
                                    last edited by

                                    @reidfo
                                    As an alternative to built-in NTP sync implementation you may use this simple code:

                                    NTP_QUERY = bytearray(48)
                                    NTP_QUERY[0] = 0x1b				
                                    addr = socket.getaddrinfo(<NTP_SERVER>, 123)[0][-1]
                                    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
                                    s.settimeout(3) #optional
                                    res = s.sendto(NTP_QUERY, addr)
                                    msg = s.recv(48)
                                    s.close()
                                    val = struct.unpack("!I", msg[40:44])[0] - 2208988800 # 70 years difference between NTP and Pycom epoch
                                    tm = time.localtime(val)
                                    self.rtc.init(tm)
                                    

                                    Don't forget to implement handling of socket exceptions.

                                    1 Reply Last reply Reply Quote 1
                                    • C Offline
                                      crumble @iwahdan
                                      last edited by

                                      @iwahdan

                                      Why shall we wait for all the inits? Waiting seems not to be a reliable method for the pytrack. We need methods to check if a module is ready or wait for a init signal.

                                      #main.py
                                      [... a lot of includes of internal and *mpy modules ...]
                                      
                                      _startup_ticks = utime.ticks_ms()
                                      
                                      [... do some init stuff like WiFi and NTP ...]
                                      
                                      _wait_init = 3000 - utime.ticks_diff(utime.ticks_ms(),  _startup_ticks)
                                      if _wait_init > 0:
                                          print('waiting')
                                          utime.sleep_ms(_wait_init)
                                      print(_wait_init)
                                      
                                      #time.sleep(1)
                                      py = Pytrack()
                                      print('done init pytrack')
                                      

                                      will fail somtimes if wait time is 2000ms. Even 3000ms is to short. Sometimes t fails like usualy with i2c errors, once it never returned from Pytrack()

                                      I give now 4500ms a try. It will be hard to trust the settings.

                                      1 Reply Last reply Reply Quote 0
                                      • C Offline
                                        crumble @iwahdan
                                        last edited by

                                        How can I check the type of the file system.
                                        I flashed the firmware under Win10 with update tool 1.15.2.b1

                                        The last update of 1.19.0.b_ on a Lopy with LIttleFS setting showed me on boot up that LittleFS is used. Now it shows me FatFS.

                                        I tried a second upgrade with reformat checkbox set and it is still showing:

                                        Autoconnect: Found a PyCom board on USB
                                        Autoconnect: Connecting on COM3...
                                        Initializing filesystem as FatFS!
                                        
                                        R 1 Reply Last reply Reply Quote 0
                                        • R Offline
                                          reidfo @crumble
                                          last edited by

                                          @crumble While I don't know about the first issue, I have seen the second. For me, on MacOS, it seems like I saw the option for LittleFS in the updater (or maybe I'm imagining it) but now I don't. To get LittleFS I have compiled the firmware myself.

                                          P 1 Reply Last reply Reply Quote 0
                                          • P Offline
                                            panda @reidfo
                                            last edited by

                                            @reidfo Same here for the Windows updater. LittleFS option is there, but it does not work.

                                            That issue aside, Writing to files I now get an unexpected error at random times:

                                            ASSERT_PARAM(2051 0), in llc_util.c at line 289

                                            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