EVK2 + GE910-GPSS, how to debug python?

9 thoughts on “EVK2 + GE910-GPSS, how to debug python?

  1. Hello,

     

    It is possible to debug python with the EVK2 and the GE910-GPSS interface board?

     

    Thanks a lot, Gabriel.

  2. Of course, you have several methods:

     

    – the most obvious, set AT#PORTCFG=0 and debug info and print output are redirected to USIF1 which is on LOWER=TRACE EVK2 RS232 DB9 female connector

     

    – redirect debug info and print output to USIF0 via SER module, UPPER=PROG/DATA  EVK2 RS232 DB9 female connector:

     

    import sys
    import SER

    class SERstdout:
        def __init__(self):
            SER.set_speed("115200","8N1")
        def write(self,s):
            SER.send(s)

    if(sys.platform != "win32"):       #
        sys.stdout = SERstdout()    # Redirect print statements to SERIAL ASC0
        sys.stderr = SERstdout()     # Redirect errors to SERIAL ASC0

     

     – redirect debug info and print output to USB via USB0 module:

     

    import sys
    import USB0

     

    class USB0stdout:
        def __init__(self):
            print ""  #just to run _init_
        def write(self,s):
            USB0.send(s)

    if(sys.platform != "win32"):
        sys.stdout = USB0stdout()
        sys.stderr = USB0stdout()

    1. Thanks Cosmin.

       

      I try the first method, with no results.

      My setup are 2 computers. Desktop computer is connected to RS232 AT/PROGRAM, and a laptop connected to RS232 TRACE.

      I use hyperterminal in laptop, and Telit AT Controller in the desktop computer.

      The setup is showed in the attached photo. 

      And the configuration of Telit AT Controller in the screenshot captures.

      Also the LOG is:

       

      AT

      OK

      AT#ESCRIPT?

      #ESCRIPT: “Script1.pyc”

       
      OK

      AT#PORTCFG?

      #PORTCFG: 0,0

       
      OK

      AT#LSCRIPT

      #LSCRIPT: “Script1.pyc”,250

      #LSCRIPT: free bytes: 1948000

       
      OK

      AT#ESCRIPT?

      #ESCRIPT: “Script1.pyc”

       
      OK

      AT+CMUX?

      +CMUX: 0,0,5,127

       
      OK

      AT#REBOOT

      OK

       

      But the laptop is not showing the python debug messages.

      Where are my error? 

      There is a incorrect setup?

       

      Thaks a lot Cosmin.

      1. What baudrate is set in Hyperterminal connection; is that a real serial port or an USB-RS232 convertor?

         

        Please also report firmware version AT+CGMR, and AT# #STARTMODESCR.

        1. Hi Cosmin,

           

          Both connections are real serial port, no usb-rs232 serial converter is used.

          PROG/DATA is connected to the desktop computer at 115200 8N1, Hardware control.

          TRACE is connected to the laptop computer with same settings.

           

          This is log for requested commands: 

           

          Send: AT+CGMR<cr>

          AT+CGMR

           

          13.00.105

           

          OK

           

          Send: AT#STARTMODESCR?<cr><lf>

          AT#STARTMODESCR?

           

          #STARTMODESCR: 1,10

           

          OK

           

          Send: AT#LSCRIPT<cr>

          AT#LSCRIPT

           

          #LSCRIPT: "Script1.py",101

          #LSCRIPT: free bytes: 1948128

           

          OK

           

          Send: AT#ESCRIPT?<cr>

          AT#ESCRIPT?

           

          #ESCRIPT: "Script1.py"

           

          OK

           

          Send: AT#REBOOT<cr>

          AT#REBOOT

           

          OK

           

           

          Thansk a lot,  

          1. Definitelly the debug works, try to swap something, laptop ports with PC, another PC etc.

             

            Is the script running at least? Start it with AT#EXECSCR, and print something in SER.

             

            import MDM

            import SER

             

            print ‘Hello World!’

            SER.send(‘Hello World!rn’)

            result = MDM.send(‘ATr’, 0)
            print result
            c = MDM.read()
            print c

          2. Cosmin thansk for your support.

             

            This script is working, i can see the Hello World! message in the hyperterminal.

            But the only string showed is SER.send(‘Hello World!rn’).

            What about the print statements? Why is not working?

             

  3. Check the other things I advised with ports/PC swapping.

    Try another thing, you should see the hello message in the LOWER serial port too, instead of print, if connections are OK:

     

     

    import MDM

    import SER

    import SER2

     

    # print ‘Hello World!’

    SER.send(‘Hello World!rn’)

    SER2.send(‘Hello World!rn’)

    result = MDM.send(‘ATr’, 0)
    print result
    c = MDM.read()
    print c

    1.  
      Cosmin I check the script and I can see the hello message in the LOWER serial port.
       
      The problem is solved.
      I apply your method to redirect serial output:
       
       
      import sys
      import MDM
      import SER
      import SER2
      class SER2stdout:
          def __init__(self):
              SER2.set_speed("115200","8N1")
          def write(self,s):
              SER2.send(s)
      if(sys.platform != "win32"):       #
          sys.stdout = SER2stdout()    # Redirect print statements to SERIAL ASC0
          sys.stderr = SER2stdout()     # Redirect errors to SERIAL ASC0
      print ‘Hello World 4!’
      SER.send(‘Hello World 5!rn’)
      SER2.send(‘Hello World 6! rn’)
      result = MDM.send(‘ATr’,0)
      print result
      c = MDM.read()
      print c 
       
      And now i could see the print commands in the LOWER serial port.
       
      Thanks a lot.