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 Release Candidate v1.20.0.rc13

    Scheduled Pinned Locked Moved Beta Announcements & Development News
    firmware
    16 Posts 11 Posters 1.3k Views 12 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.
    • T Offline
      tlanier
      last edited by

      Using Release Candidate v1.20.0.rc9 and rc13 the following observations have been made.

      We have found that GPy units in low cell signal situations sometimes have connectivity issues which can be improved by not using the Pycom lte.isattached() function call. The isattached() result sometimes disagrees with the result that is obtained by doing the AT+CEREG? modem command. We have had better results using the modem command directly (see check_registration() below). A return value of 1 or 5 means the modem is registered with the tower and a connection can be attempted. We've also added logic that resets the modem and does an attach if the modem reports 2,0 (not registered, not searching) for more than 60 secs.

      We have also seen situations where the modem would return a signal strength of 99 for long periods until the modem was reset. Then the signal strength reading would return to normal.

      With over 50 units in the field working, we had noticed that units were not connecting sometimes in low signal situations (~2 to 9 signal strength) as reliably as our previous 4G model design. This led us to do more testing which included turning off our building's cell booster, putting the GPy based design in a metal box, and wrapping the antenna with aluminum foil, all to reduce signal and simulate low signal situations.

      The mentioned changes has made significant improvement to the connectivity of the unit in low signal situations.

      # modem.py
      import globals as g
      import machine
      from network import LTE
      import sys
      import util
      from util import log
      from utime import sleep_ms
      
      lte = LTE()
      
      #####################################################################
      #                     Send AT Command To Modem
      #####################################################################
      def at(cmd):
          global lte
      
          log("modem command: {}".format(cmd))
          util.wait()   # synchronize long running modem commands with time interrupt to help latency issues
          r = lte.send_at_cmd(cmd).split('\r\n')
          sleep_ms(0)
          r = list(filter(None, r))
          log("response: {}".format(r))
          sleep_ms(0)
          
          return r
      
      #####################################################################
      #                       Check Registration
      #####################################################################
      def check_registration():
          # return 0-5, 99-unknown
          # response: ['+CEREG: 2,4', 'OK']
          # response: ['+CEREG: 2,1,"2C29","0B54400F",7', 'OK']
          # 2,0 - not registered, not searching
          # 2,1 - registered, home network
          # 2,2 - not registered, searching
          # 2,3 - registration denied
          # 2,4 - unknown (out of coverage)
          # 2,5 - registered, roaming
      
          try:
              while True:
                  r = at('AT+CEREG?')
                  if len(r) == 0:
                      break
      
                  s = r[0]
                  a = s.split(",")
      
                  if (a[0] != "+CEREG: 2"):
                      break
                  
                  reg = int(a[1])
                  return reg
      
          except Exception as ex:
              sys.print_exception(ex)
      
          # unknown registration
          return 99
      
      #####################################################################
      #                       Get Signal Strength
      #####################################################################
      def signal_strength():
          # 0-31, 99-unknown
          # response: ['+CSQ: 18,99', 'OK'] where 18 is signal strength
          try:
              while True:
                  r = at('AT+CSQ')
                  if len(r) == 0:
                      break
      
                  s = r[0]
                  if (s[0:5] != "+CSQ:"):
                      break
                  
                  a = s.split(":")
                  b = a[1].split(",")
                  cell_signal = int(b[0])
      
                  g.oStatus.cell_signal = cell_signal
                  return cell_signal
      
          except Exception as ex:
              sys.print_exception(ex)
      
          # unknown signal strength
          g.oStatus.cell_signal = 99
          return 99
      
      1 Reply Last reply Reply Quote 0
      • T Offline
        Thosch42
        last edited by

        To get a quick solution for my problem with urequsts.py, allways ending in a OSError: Network card not available, I switched to a MQTT solution. BUT, mqtt.connect() ends also in this OSError.

        I switched firmware back to rc12 and everything works as expected.

        It seems, something went wrong with the usocket lib.

        Cheers,
        Thomas

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

          @Thosch42 said in New Release Candidate v1.20.0.rc13:

          Network card not available

          Hello @Thosch42 , are you using Wifi or LTE?

          Wahdan

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

            We left 25 GPy's running v1.20.0.rc13 over the labor day holiday. 6 of the 25 units locked up at random times during the weekend. The watchdog did not work and reset the locked up units. The units did recover after a hard reset.

            We are going to reprogram the units to v1.20.0.rc9 and do the same test. We had not seen this problem before with units using rc9.

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

              We think we've found the problem which was in our code and had nothing to do with the version of the OS. It turns out that we have logic in our timer interrupt routine which does sanity checks on the running code and if anything does not seem right, the code will reboot the system. In one particular test the code reboots if an application dependent event does not occur in 14 hours. When the timer interrupt routine called the reset routine it did not cancel the timer interrupts. This was causing a problem since the reset routine had some long running code in it which should not have been run in an interrupt routine. We will run more long running tests to insure the problem is resolved.

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

                @iwahdan said in New Release Candidate v1.20.0.rc13:

                @Thosch42 said in New Release Candidate v1.20.0.rc13:

                Network card not available

                Hello @Thosch42 , are you using Wifi or LTE?

                Hi!
                I'm working with a Lopy1 (L01), so there's no LTE. I use Wifi.

                1 Reply Last reply Reply Quote 0
                • S Offline
                  sana98 Banned
                  last edited by

                  This post is deleted!
                  1 Reply Last reply Reply Quote 0
                  • A Offline
                    arso
                    last edited by arso

                    The topic you are replying to is quite old. Would you like to create a new topic instead, and reference this one in your reply?
                    jiofi.local.html tplinklogin is it down

                    1 Reply Last reply Reply Quote 0
                    • A Offline
                      arseoy
                      last edited by

                      We left 25 GPy's running v1.20.0.rc13 over the labor day holiday. 6 of the 25 units locked up at random times during the weekend. The watchdog did not work and reset the locked up units. The units did recover after a hard reset.

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

                        @arseoy I found the internal watchdog not being reliable. Better use an external watchdog, which does a hard reset. That will need an additional GPIO pin for feeding, but that should be available.

                        C 1 Reply Last reply Reply Quote 0
                        • C Offline
                          crumble @robert-hh
                          last edited by

                          The software watchdog needs a running OS. The dog takes a nap if freeRTOS shows a Guru.
                          I miss a feature to reboot the OS after the guru message.

                          1 Reply Last reply Reply Quote 0
                          • C Offline
                            CashApp Banned
                            last edited by

                            This post is deleted!
                            1 Reply Last reply Reply Quote 0
                            • A Offline
                              alfred0809
                              last edited by

                              Reminder: Giving or asking for exam content is not allowed. Asking what should I study is ok.

                              https://vidmateapp.win https://shareitapp.me https://teatvapk.win

                              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 / 1
                              • First post
                                Last post

                              Pycom on Twitter

                              Pycom