Synchronous tasks in Telit Python

5 thoughts on “Synchronous tasks in Telit Python

  1. Hi,
           I  am working with GPIO , Calls & SMS in my project, i can able to receive SMS commands(Messages) using a while loop, stick to only looking the receive command
     
    while 1:
         res=MDM.receive(5)
         a= res.find(‘+CMTI: "SM"’)
    but when i am using the same while to read GPIO as well to do some calls,(the while loop time increased here).
     
    I got missing SMS which i sent to module. Now i am running the CPU in Mode 1 CPUMODE=1
    Let me know, Is there any ‘Receive interrupt’ features available in GL865-QUAD.? or How can i receive the SMS and GPIO state changes without missing anything. 
    Looking for your reply.
    Thank you
      1. There aren’t any interrupts, but the incoming SMS alerts are reliable, and cannot be lost because the MDM/SER ports have buffers of quite enough depth. Do a print of your incoming data to investigate. Check your incoming SMS signaling rules as well.

  2. Make sure you append to res in the while loop to avoid receving only parts of the CMTI string in one iteration:

     

    while 1:

       res = res + MDM.receive(5)

       a = res.find(‘+CMTI: "SM"’)

     

    This is especially useful/required if you also consume the MDM buffer when you make calls in your while loop.

    Edit: If you do take this approach then make sure you also consume data or clear your ‘res’ buffer at one point or another. 
    1. Make sure you append to res in the while loop to avoid receving only parts of the CMTI string in one iteration:

       

      while 1:

         res = res + MDM.receive(5)

         a = res.find(‘+CMTI: "SM"’)

       

      This is especially useful/required if you also consume the MDM buffer when you make calls in your while loop.

      Edit: If you do take this approach then make sure you also consume data or clear your ‘res’ buffer at one point or another. 

      Thank you 

      I did read it in text mode using CMGR. CPU MODE 3 . now seems ok