MDM and Jamming

2 thoughts on “MDM and Jamming

  1. Hello 
    I need answer for strange situation which occurs sometimes when I jamming the GSM. 
    I set JDR by AT#JDR=2,70,5 command
    I start jamming. 
    I run “test()” in while with “cmd” = “+CREG?”
    The “print s” result contain information about jammer and CREG but why the CREG “\r\nOK\r\n” was printed as “\r\nO” and “K\r\n”. 
    How to prevent for this?
    Below code for test:

     _STOP = “\r\nOK\r\n”

    _ERROR = “\r\nERROR\r\n”


    def test(cmd):

        if MDM.send(“AT%s\r” % (cmd, ), 20) == -1:

            raise IOError, “\r\nAT%s” % (cmd, )

        l = “”

        stop = None

        while not stop:

            s = MDM.receive(51)

            print s # Test point

            l = “%s%s” % (l, s)

            if l.find(_STOP) != -1:

                stop = 0xFF

                s = _STOP

            elif l.find(_ERROR) != -1:

                stop = l

                s = _ERROR

                ans = 0

    1. The return value will be the first string received no matter the timeout value.


      If you want to ensure all data is received is better to implement a read routine based on 2 exit conditions, a group of expected characters and a max timeout, like below:


      def Chat(command, expected, timeout):
          timer = MOD.secCounter() + timeout
          MDM.send(command, 5)
          b = command +
          while (MOD.secCounter() < timer) and (b.find(expected) == -1):
              b = b +
          return b