Ul865 GPS

  • Hi,


    I am programming UL865-EUR sw version 12.00.xx5 using Python 2.72
    I am using SER.send() to send debug message to RSTerm and SER2.read() to read GPS informaton, SER.send() is working fine; however, I encounter following issues:
    1)SER2.read() returns nothing as:
    SER.set_speed('115200','8N1')
    SER2.set_speed('9600','8N1')
    res=SER2.read()
    SER.send(res)
    while (1):

    ..time.sleep(0.1)
    ..res = res + SER2.read()
    ..SER.send(res)

    2)Any subsitute for MOD.secCounter() as it is no longer support?


    Thanks


    Steve

  • Code to read from GPS
    ----------------------------
    import time
    import SER
    import SER2
    import MDM
    import MDM2



    SER.set_speed('115200','8N1')
    SER2.set_speed('9600','8N1')
    MDM.send('AT#PORTCFG=3\r', 50)
    SER.send('Start testing\r\n')



    res=''
    tout=30 # 30 sec
    tall=0
    tsleep=0.1
    res=SER2.read()
    while ( tall <=tout):
    .. msg = '[%s]%s sec.\r\n' % (res, str(tall))
    .. SER.send(msg)
    .. time.sleep(tsleep)
    .. tall=tall + tsleep
    .. res=SER2.read()

  • Do you mean the timeout value tout is not set big enough (i.e. it needs to be set bigger than 30 sec.)?
    Also, both time.time() and 'AT+CCLK?' does not return proper time value when UL865 starts up, how long should the script wait?

  • I am sure there is somthing wrong in your environmental.
    Here the log from my test:
    [17:06:31] Send: AT#WSCRIPT="wong.pyc",682,0<cr>
    [17:06:31] AT#WSCRIPT="wong.pyc",682,0
    [17:06:32] Send: AT#EXECSCR<cr>
    [17:06:32] AT#EXECSCR
    [17:06:33] OK
    [17:06:33] Start testing
    [17:06:33] []0 sec.
    [17:06:33] []0.1 sec.
    [17:06:33] [SV,3,2,10,17,32,110,14,18,26,298,22,24,40,274,29,26,39,147,29*7A
    [17:06:33] $GPGSV,3,3,10,33,24,211,37,39,27,162,*72
    [17:06:33] $GLGSV,1,1,00*65
    [17:06:33] $GNGLL,5352.59319,N,01042.03695,E,160639.00,A,A*74
    [17:06:33] ]0.2 sec.
    [17:06:33] []0.3 sec.
    [17:06:33] []0.4 sec.
    [17:06:33] []0.5 sec.
    [17:06:33] []0.6 sec.
    [17:06:33] []0.7 sec.
    [17:06:33] []0.8 sec.
    [17:06:33] []0.9 sec.
    [17:06:34] []1.0 sec.
    [17:06:34] []1.1 sec.
    [17:06:34] [$GNRMC,160640.00,A,5352.59271,N,01042.03590,E,0.783,,240215,,,A*66
    [17:06:34] $GNVTG,,T,,M,0.783,N,1.450,K,A*31
    [17:06:34] $GNGGA,160640.00,5352.59271,N,01042.03590,E,1,04,6.12,-6.3,M,44.0,M,,*6F
    [17:06:34] $GNGSA,A,3,24,18,15,12,,,,,,,,,7.13,6.12,3.67*16
    [17:06:34] $GNGSA,A,3,,,,,,,,,,,,,7.13,6.12,3.67*1E
    [17:06:34] $GPGSV,3,1,10,05,,,16,12,07,218,32,13,,,24,15,69,236,33*7E
    [17:06:34] $GPGSV,3,2,10,17,32,110,16,18,26,298,22,24,40,274,29,26,39,147,29*78
    [17:06:34] $GPGSV,3,3,10,33,24,211,37,39,27,162,*72
    [17:06:34] $GLGSV,1,1,00*65
    [17:06:34] $GNGLL,5352.59271,N,01042.03590,E,160640.00,A,A*73
    [17:06:34] ]1.2 sec.
    [17:06:34] []1.3 sec.
    [17:06:34] []1.4 sec.
    [17:06:34] []1.5 sec.
    [17:06:34] []1.6 sec.
    [17:06:34] []1.7 sec.
    [17:06:34] []1.8 sec.
    [17:06:34] []1.9 sec.
    [17:06:35] []2.0 sec.
    [17:06:35] []2.1 sec.
    [17:06:35] [$GNRMC,160641.00,A,5352.59207,N,01042.03440,E,0.521,,240215,,,A*60
    [17:06:35] $GNVTG,,T,,M,0.521,N,0.965,K,A*31
    [17:06:35] $GNGGA,160641.00,5352.59207,N,01042.03440,E,1,04,6.12,-4.7,M,44.0,M,,*65
    [17:06:35] $GNGSA,A,3,24,18,15,12,,,,,,,,,7.14,6.12,3.67*11
    [17:06:35] $GNGSA,A,3,,,,,,,,,,,,,7.14,6.12,3.67*19
    [17:06:35] $GPGSV,3,1,10,05,,,17,12,07,218,32,13,,,24,15,69,236,33*7F
    [17:06:35] $GPGSV,3,2,10,17,32,110,14,18,26,298,23,24,40,274,29,26,39,147,29*7B
    [17:06:35] $GPGSV,3,3,10,33,24,211,37,39,27,162,*72
    [17:06:35] $GLGSV,1,1,00*65
    [17:06:35] $GNGLL,5352.59207,N,01042.03440,E,160641.00,A,A*7F
    [17:06:35] ]2.2 sec.
    [17:06:35] []2.3 sec.
    [17:06:35] []2.4 sec.
    [17:06:35] []2.5 sec.
    [17:06:35] []2.6 sec.
    [17:06:35] []2.7 sec.
    [17:06:35] []2.8 sec.
    [17:06:36] []2.9 sec.
    [17:06:36] []3.0 sec.
    [17:06:36] []3.1 sec.
    [17:06:36] [$GNRMC,160642.00,A,5352.59148,N,01042.03310,E,0.452,,240215,,,A*6C
    [17:06:36] $GNVTG,,T,,M,0.452,N,0.837,K,A*32
    [17:06:36] $GNGGA,160642.00,5352.59148,N,01042.03310,E,1,04,6.12,-3.4,M,44.0,M,,*68
    [17:06:36] $GNGSA,A,3,24,18,15,12,,,,,,,,,7.14,6.12,3.67*11
    [17:06:36] $GNGSA,A,3,,,,,,,,,,,,,7.14,6.12,3.67*19
    [17:06:36] $GPGSV,3,1,10,05,,,18,12,07,218,32,13,,,24,15,69,236,33*70
    [17:06:36] $GPGSV,3,2,10,17,32,110,15,18,26,298,23,24,40,274,29,26,39,147,28*7B
    [17:06:36] $GPGSV,3,3,10,33,24,211,37,39,27,162,*72
    [17:06:36] $GLGSV,1,1,00*65
    [17:06:36] $GNGLL,5352.59148,N,01042.03310,E,160642.00,A,A*76
    [17:06:36] ]3.2 sec.
    [17:06:36] []3.3 sec.
    [17:06:36] []3.4 sec.
    [17:06:36] []3.5 sec.
    [17:06:36] []3.6 sec.
    [17:06:36] []3.7 sec.
    [17:06:36] []3.8 sec.
    [17:06:37] []3.9 sec.
    [17:06:37] []4.0 sec.
    [17:06:37] []4.1 sec.
    [17:06:37] [$GNRMC,160643.00,A,5352.59111,N,01042.03233,E,0.297,,240215,,,A*6E
    [17:06:37] $GNVTG,,T,,M,0.297,N,0.550,K,A*31
    [17:06:37] $GNGGA,160643.00,5352.59111,N,01042.03233,E,1,04,6.12,-2.6,M,44.0,M,,*66
    [17:06:37] $GNGSA,A,3,24,18,15,12,,,,,,,,,7.14,6.12,3.68*1E
    [17:06:37] $GNGSA,A,3,,,,,,,,,,,,,7.14,6.12,3.68*16
    [17:06:37] $GPGSV,3,1,10,05,,,17,12,07,218,32,13,,,24,15,69,236,33*7F
    [17:06:37] $GPGSV,3,2,10,17,32,110,17,18,26,298,24,24,40,274,29,26,39,147,28*7E
    [17:06:37] $GPGSV,3,3,10,33,24,211,37,39,27,162,*72
    [17:06:37] $GLGSV,1,1,00*65
    [17:06:37] $GNGLL,5352.59111,N,01042.03233,E,160643.00,A,A*7B
    [17:06:37] ]4.2 sec.
    [17:06:37] []4.3 sec.
    [17:06:37] []4.4 sec.
    [17:06:37] []4.5 sec.
    [17:06:37] []4.6 sec.
    [17:06:37] []4.7 sec.
    [17:06:37] []4.8 sec.
    [17:06:38] []4.9 sec.
    [17:06:38] []5.0 sec.
    [17:06:38] []5.1 sec.
    [17:06:38] [$GNRMC,160644.00,A,5352.59058,N,01042.03117,E,0.186,,240215,,,A*63
    [17:06:38] $GNVTG,,T,,M,0.186,N,0.344,K,A*31
    [17:06:38] $GNGGA,160644.00,5352.59058,N,01042.03117,E,1,04,6.13,-1.3,M,44.0,M,,*6F
    [17:06:38] $GNGSA,A,3,24,18,15,12,,,,,,,,,7.15,6.13,3.68*1E
    [17:06:38] $GNGSA,A,3,,,,,,,,,,,,,7.15,6.13,3.68*16
    [17:06:38] $GPGSV,3,1,10,05,,,17,12,07,218,32,13,,,23,15,69,236,34*7F
    [17:06:38] $GPGSV,3,2,10,17,32,110,16,18,26,298,24,24,40,274,29,26,39,147,28*7F
    [17:06:38] $GPGSV,3,3,10,33,24,211,37,39,27,162,*72
    [17:06:38] $GLGSV,1,1,00*65
    [17:06:38] $GNGLL,5352.59058,N,01042.03117,E,160644.00,A,A*75
    [17:06:38] ]5.2 sec.
    [17:06:38] []5.3 sec.
    [17:06:38] []5.4 sec.
    [17:06:38] []5.5 sec.
    [17:06:38] []5.6 sec.
    [17:06:38] []5.7 sec.
    [17:06:38] []5.8 sec.
    [17:06:39] []5.9 sec.
    [17:06:39] []6.0 sec.
    [17:06:39] []6.1 sec.
    [17:06:39] [$GNRMC,160645.00,A,5352.59036,N,01042.03061,E,0.168,,240215,,,A*6A
    [17:06:39] $GNVTG,,T,,M,0.168,N,0.311,K,A*31
    [17:06:39] $GNGGA,160645.00,5352.59036,N,01042.03061,E,1,04,6.13,-0.7,M,44.0,M,,*63
    [17:06:39] $GNGSA,A,3,24,18,15,12,,,,,,,,,7.15,6.13,3.68*1E
    [17:06:39] $GNGSA,A,3,,,,,,,,,,,,,7.15,6.13,3.68*16
    [17:06:39] $GPGSV,3,1,10,05,,,18,12,07,218,32,13,,,23,15,69,236,34*70
    [17:06:39] $GPGSV,3,2,10,17,32,110,16,18,26,298,25,24,40,274,28,26,39,147,28*7F
    [17:06:39] $GPGSV,3,3,10,33,24,211,37,39,27,162,*72
    [17:06:39] $GLGSV,1,1,00*65
    [17:06:39] $GNGLL,5352.59036,N,01042.03061,E,160645.00,A,A*7C
    [17:06:39] ]6.2 sec.
    [17:06:39] []6.3 sec.
    [17:06:39] []6.4 sec.
    [17:06:39] []6.5 sec.
    [17:06:39] []6.6 sec.
    [17:06:39] []6.7 sec.
    [17:06:39] []6.8 sec.
    [17:06:40] []6.9 sec.
    [17:06:40] []7.0 sec.
    [17:06:40] []7.1 sec.
    [17:06:40] [$GNRMC,160646.00,A,5352.59026,N,01042.03015,E,0.249,,240215,,,D*6E
    [17:06:40] $GNVTG,,T,,M,0.249,N,0.462,K,D*37
    [17:06:40] $GNGGA,160646.00,5352.59026,N,01042.03015,E,2,04,6.13,-0.3,M,44.0,M,,0000*65
    [17:06:40] $GNGSA,A,3,24,18,15,12,,,,,,,,,7.15,6.13,3.68*1E
    [17:06:40] $GNGSA,A,3,,,,,,,,,,,,,7.15,6.13,3.68*16
    [17:06:40] $GPGSV,3,1,10,05,,,18,12,07,218,32,13,,,22,15,69,236,34*71
    [17:06:40] $GPGSV,3,2,10,17,32,110,16,18,26,298,24,24,40,274,28,26,39,147,28*7E
    [17:06:40] $GPGSV,3,3,10,33,24,211,38,39,27,162,*7D
    [17:06:40] $GLGSV,1,1,00*65
    [17:06:40] $GNGLL,5352.59026,N,01042.03015,E,160646.00,A,D*78
    ........................
    [17:07:03] ]29.8 sec.
    [17:07:03] []29.9 sec.
    [17:07:03] End testin
    g

  • Thanks for testing effort and I will try it at other location to see if it is an environment issue.
    I found SER2.read() returns empty string at some time period during your testing, can it be avoided?
    [17:06:36] []3.3 sec.
    [17:06:36] []3.4 sec.
    [17:06:36] []3.5 sec.
    [17:06:36] []3.6 sec.
    [17:06:36] []3.7 sec.
    [17:06:36] []3.8 sec.
    [17:06:37] []3.9 sec.
    [17:06:37] []4.0 sec.
    [17:06:37] []4.1 sec.

  • I realized some GPS sentences are in comma delimitated and some are in dot delimitated(which is not correct), is there anything I can do to make it all comma delimitated?


    dot delimitated:
    $GPGSA.A.3.193.28.30. .....


    comma delimitated:
    $GPGSA,A,3,193.28,30. .....