Debugging python on the GM862 EVK V3 USB from SF

Tips and questions relating to the GPS modules from SFE

Moderator: phalanx

Robert Mann
Posts: 13
Joined: Thu Feb 22, 2007 2:27 pm
Location: Bakersfield, CA
Contact:

Debugging python on the GM862 EVK V3 USB from SF

Post by Robert Mann » Sun Feb 25, 2007 1:22 am

After many days of reading and trial and error to get the GM862 configured semi. I find myself needing to start to use python scripts which are VERY troublesome to get working correctly. You almost MUST have the ability to debug your scripts using one of the debugging methods available to the GM862. The problem is I have not found a solution that works with the SF board yet.

Has anyone got a working example of using debugging with this setup? Can you provide which FIRMWARE you are using and a step by step of how you got the process to work? I have tried both methods in the Easy Python Scripting PDF with no luck and have tried many variations in between.

The next step for me would be to try to use the EMMI TX port but from what I read it is dedicated to the NMEA stream of the GPS so I do not think it will work. Plus it has to be ran through a MAX232 in order to convert from the low voltage CMOS of the GM862 to a standard COM port voltage for a PC.

I hope someone has a better solution then this?

cabbage
Posts: 12
Joined: Thu Jan 25, 2007 3:55 am

Post by cabbage » Tue Feb 27, 2007 11:30 am

I'm currently trying to build a Python debugger module for my GM862 - Round Solutions have just started selling one as well, but I quite fancied the idea of having a shot at my own - I'll let you know in a couple of days hwo I did it if it works :)

denmansoft
Posts: 4
Joined: Thu Apr 05, 2007 11:30 am
Location: Sidney BC Canada
Contact:

GM862 gps usb

Post by denmansoft » Thu Apr 05, 2007 11:52 am

I've been having difficulty with the GM862 USB EVK V3.
I couldn't use any of the pythonwin download stuff as it kept oming up with module not responding. The problem is that for the python serial code on the pc to work (using MS fileio as if it was on linux) you must supply a DSR active signal to the PC over the USB port. To fix this I jumpered pin 9 of the ftdi232r to ground to assert the DSR signal to the PC. This would be nice on a new rev of these boards...... The fix was simple once I wrote my own downloader and compared differences with TELIT's Eval board and kit. (I'm lucky to have both available.) Now for the Debug port. Telit's kit has a second serial port that works, but to use it on a GPS version (which is our whole point) you need to use their CMUX stuff and I haven't got that to work yet. During development I sprinkle in lots of debug prints to be able to follow what my code is doing. instead of using python print i use 'SER.send(debugstring)' and get it out of the main serial (USB) port.

AlexF
Posts: 12
Joined: Thu May 10, 2007 11:17 am
Location: Sherbrooke, Qc, Ca

Post by AlexF » Thu May 10, 2007 1:05 pm

Same problem as Robert Mann.
I am using module GM862-GPS, with PS:05.03.012/AL:07.01.406-B005-GM862-GPS software version and EVK V2 USB evaluation board.
I am trying to find a way to debug a simple Python script ("HelloWorld"). 2 options are mentionned on the Easy Script in Python (rev 2) document : using SSC bus or using CMUX, but neither work. Maybe because of the Evaluation Board?
I guess another solution would be to use the EMMI TX pins, but as Robert Mann mentionned, what about the GPS?
Anyone have a better solution? How did you solve that problem?
Thanks in advance.

denmansoft
Posts: 4
Joined: Thu Apr 05, 2007 11:30 am
Location: Sidney BC Canada
Contact:

debugging python with GPS

Post by denmansoft » Thu May 10, 2007 1:45 pm

I just gave up on the python print command and use SER.send('Hello World\r\n')

Of course at the top of my program i first do a
SER.set_speed('115200','8N1')
SER.send('Hello There\r\n')

I find the 'Hello there' important because I then know my script is started.
There can be long delays to get to this point.

Biggest problem with not having the debug port available is I don't get any error messages from Python. Things just stop....
I use SER.send('...') to monitor progress of my application while I am
still debugging. When does that ever end ???

AlexF
Posts: 12
Joined: Thu May 10, 2007 11:17 am
Location: Sherbrooke, Qc, Ca

Post by AlexF » Thu May 10, 2007 2:02 pm

Wow, that was quick!
Thank you so much, I was getting crazy! It works now!

jasonharper
Support Volunteer
Posts: 845
Joined: Wed Mar 02, 2005 12:14 pm
Location: Oklahoma
Contact:

Re: debugging python with GPS

Post by jasonharper » Thu May 10, 2007 2:25 pm

denmansoft wrote:Biggest problem with not having the debug port available is I don't get any error messages from Python. Things just stop....
I have no experience with these modules, but speaking from a purely Python standpoint, it should be possible to redirect debugging and print statement output wherever you want. Try something like this:

Code: Select all

class SerWriter:
    def write(s):
        SER.send(s)

import sys
sys.stdout = sys.stderr = SerWriter()
It may be necessary to implement additional standard file methods, such as flush() and writelines().

mtbbiker
Posts: 5
Joined: Mon Aug 13, 2007 4:36 am

Debugging on SFE Eval board V3

Post by mtbbiker » Mon Aug 13, 2007 7:38 am

Hi I am new to developing on Telit Modules and I have the same problem that none of the Debug software/application from Roundsolutions (Or from Telit's documentation) works on the Eval Board (V3).

denmansoft can you please send me a picture or schematic on how you jumpered PIN9 to assert the DSR signal to the PC

Any help in Debugging on the SFE Eval V3 board will be appreciated

karl
Posts: 5
Joined: Sun Aug 05, 2007 7:07 pm

Re: Debugging on SFE Eval board V3

Post by karl » Mon Aug 13, 2007 6:23 pm

mtbbiker wrote:
Any help in Debugging on the SFE Eval V3 board will be appreciated
I found that the SER.send method described above was perfectly adequate, but debugging doesn't occur 'in real time' - all the lines are reported at the end of the execution.

BTW, has anyone else had any thoughts on the speed of the python interpreter? My program is taking up to 4 minutes to complete.

K.

leoperria
Posts: 1
Joined: Sat Sep 01, 2007 2:24 pm

Post by leoperria » Sat Sep 01, 2007 2:40 pm

jasonharper wrote:I have no experience with these modules, but speaking from a purely Python standpoint, it should be possible to redirect debugging and print statement output wherever you want. Try something like this:

Code: Select all

class SerWriter:
    def write(s):
        SER.send(s)

import sys
sys.stdout = sys.stderr = SerWriter()
I tried this and it works perfectly!

Code: Select all

import MDM
import MOD
import SER
import sys

SER.set_speed('115200','8N1')
class SerWriter:
    def write(self,s):
        SER.send(s+'\r')
sys.stdout = sys.stderr = SerWriter()

print 'Hello world!'

while 1:
	print('Running')
	MOD.sleep(10)
You can try for example to throw an exception:

Code: Select all

import MDM
import MOD
import SER
import sys

SER.set_speed('115200','8N1')
class SerWriter:
    def write(self,s):
        SER.send(s+'\r')
sys.stdout = sys.stderr = SerWriter()

print 'Hello world!'

print thisVariableNotExist

while 1:
	print('Running')
	MOD.sleep(10)

dpat12
Posts: 6
Joined: Sat Oct 13, 2007 4:02 am
Location: vadodra

Can not debug gm862-gps evk v3 RS323

Post by dpat12 » Sat Oct 13, 2007 4:07 am

I tried the SER.send method and tried listning on COM1 but i could not seen anything .

Please any body tell me how i can debug using SER.send method . ie. where to listen on COM1 with that what settings will be require .

even i tried the other Telit cmux procedure buy it does not work at all ???
at least i could see something with the help of SER.send??

Please help

denmansoft
Posts: 4
Joined: Thu Apr 05, 2007 11:30 am
Location: Sidney BC Canada
Contact:

Post by denmansoft » Sun Oct 14, 2007 10:07 am

Get RSTerminal from Round Solutions to use as your host terminal program.

http://www.roundsolutions.com/techdocs/

Configure it for your Com port on your host as 115200, 8N1.
If you are using a usb/serial adapter make sure you close RSTERM before unplugging it. RSTERM gets nasty if you don't. Other that that it is a great terminal program and development tool for these modules!

The method for re-directing prints and errors to SER that JasonHarper Posted works great! leoparria's samples show how to use it.

Ian

dpat12
Posts: 6
Joined: Sat Oct 13, 2007 4:02 am
Location: vadodra

rs term

Post by dpat12 » Sun Oct 14, 2007 7:51 pm

Yes am using RSTerm only and that the post setting on COM1 is 115200, 8N1.

when i download script as posted by JasonHarper and change the DTR switch to High and then close the rsTerm switch off the module then connect rs term and the npower on the module i could not see SER output on COM1.

I am also keen on working on with CMUX the techdocs says that AT+IPR=0 will not work for CMUX . which is the default setting for GM862-GPS 7.02.403 version !!

by doing this changes i think it should work .

denmansoft
Posts: 4
Joined: Thu Apr 05, 2007 11:30 am
Location: Sidney BC Canada
Contact:

Post by denmansoft » Sun Oct 14, 2007 8:14 pm

I just download with RSTerm, set EScript to the new file then Execscr.
I'm not sure what the other steps you are doing are about. See my post about the dsr jumper dated 05 apr 2007

dpat12
Posts: 6
Joined: Sat Oct 13, 2007 4:02 am
Location: vadodra

SER response on COM1 port

Post by dpat12 » Sun Oct 14, 2007 9:20 pm

SER works now . i did this AT#CMUXSCR=0,115200 disable the CMUX and
magically i got the SER output on the RSterm . now i can debug the module .

But i am also interested in statring the CMUX thing on SFE boad as number of people facing problem if CMUX works on SFE board that would be great . i will keep woking on this topic .

if your ar interested please help me .

Thanks ,

Post Reply