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

    sending AT comands while modem is in a data state

    Scheduled Pinned Locked Moved Issues & Bugs
    3 Posts 2 Posters 671 Views 2 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.
    • M Offline
      mattliddle
      last edited by

      Hi, could you help me on this problem?

      I am working on a project with the GPy and my client needs to have the LTE signal strength sent back to them.

      I keep getting this error when I send the AT command for that. My LTE modem is of course on and connected, and I need to check the signal strength.

      >>>LTE modem is in data state, cannot send AT commands
      

      Here on the Pycom documentation it states that

      lte.send_at_cmd(cmd, delay=10000)
      

      "Sends an AT command directly to the modem. Returns the raw response from the modem as a string object. IMPORTANT: If a data session is active (i.e. the modem is connected), sending the AT commands requires to pause and then resume the data session. This is all done automatically, but makes the whole request take around 2.5 seconds."

      I have two issues. It doesn't say on that page as far as I can see, how to manually pause the data-state, and secondly, I keep getting the above mentioned error while doing the following code.

      In my code I created an lte object, connect with the cellular network, do some web requests, and then I try this line.

      lte.lteStrength()  
      
      # this is the function I'm calling. 
      def lteStrength(self):
              if self.lte.isconnected():
                  if self.lte.isattached():
                      return self.lte.send_at_cmd("AT+CSQ", delay=10000) # tried without delay too.
              else:
                  print("Error. LTE Strength is unknown. LTE is not attached or connected.")
      

      I get this error every time.

      >>>LTE modem is in data state, cannot send AT commands
      
      R 1 Reply Last reply Reply Quote 0
      • R Offline
        rskoniec @mattliddle
        last edited by rskoniec

        @mattliddle Check lte.pppsuspend() before lte.send_at_cmd and lte.pppresume() after lte.send_at_cmd. Also check this thread. Btw, which GPy f/w and modem f/w are you running on?

        The machine is working as good as it's code.

        M 1 Reply Last reply Reply Quote 4
        • M Offline
          mattliddle @rskoniec
          last edited by

          @rskoniec thank you so much! I will try that out. That's a good thread.

          As far as the firmware, I need to double check, but I believe for both I'm using the most updated stable release version.

          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