Difference between python and command line!?

  • Hi, I found a funny thing on our GL-865-DUAL:


    I do this in RS-Term (quoted output)


    Send: AT#V24CFG=3,1<cr><lf>
    AT#V24CFG=3,1


    OK


    It sets the DSR to I/O. Apparently it works.


    Then I do it in python



    def Debugsend (txt):
    if DEBUG:
    SER.send(txt)


    .....


    try:
    MDM2.send("AT#V24CFG=3,1\r\n") #dsr
    d=getmodemanswer("",3)
    except:
    Debugsend(sys.exc_info()[0])
    Debugsend("\r\n")
    Debugsend(sys.exc_info()[1])
    Debugsend("\r\n")


    and get this:



    SystemError
    new style getargs format but argument is not a tuple


    My interpretation: It seems like python wants "3,1" to be a 2 element array? Firmware is 10.00.158



    W.

  • Hi W.,


    You need to pass the timeout value in the function:
    MDM2.send(string, timeout)


    So this line
    MDM2.send("AT#V24CFG=3,1\r\n")
    has to be replaced by something like this:
    MDM2.send("AT#V24CFG=3,1\r\n",5)


    Regards,
    Mazen