Debugger run time and board script execution differences

4 thoughts on “Debugger run time and board script execution differences

  1. Hello,

     

    I was wondering what the difference is between running the debugger and the python script directly from the board.  The reason I ask this is due to the fact that I am not getting any TCP data from the board to my server while running code directly off the board.  However I am able to get data when I run from the debugger. 

     

    Code example:

     

    import GPS

    import MDM

    import MOD 

     

    SERVER_PORT = ‘4040’

    SERVER_ADDR = ‘XXX.XXX.XXX.XXX’

     

    def main():

    i = 0

    while (i < 2):

    GPS.powerOnOff(0)

    MOD.sleep(30)

    GPS.powerOnOff(1)

    MOD.sleep(30)

    i = i + 1

    MDM.send(‘AT#SD=1,0,’+SERVER_PORT+’,"’+SERVER_ADDR+’",0,0,0r’,2)

    MOD.sleep(30)

    MDM.send(‘HELLO+++’,2)

    MOD.sleep(10)

    MDM.send(‘AT#SH=1r’,2)

    main()

     

    Is the message sending/termination different when executing on the board?  I ask this because I dont even see the packet (using wireshark) get transmitted from the board when executing from the board.  However I do see it when running the debugger.

     

    Thanks

     

    Andrew 

    1. You mean Wireshark intercepting on the server machine? At least you see the connection initialization?

       

      Try MDM.send(‘AT&K0r’, 2) before doing socket things.

       

      1. So I tried the MDM.send(‘AT&K0r’,2) before any socket code.  The debugger still works but the board execution of the script still will not send the data out.  I am able to see the connection initialize via Wireshark.

         

        Is there prehaps another control flow item in control that the debugger handles? 

        1. Some more tweaks:

          – wait for CONNECT message before sending anything through the socket. Do not rely on a predefined timeout

          – send your data

          – do a proper socket close with silence guard spaces of 2-3 seconds before and after the +++ sequence