Command-Line Parameter -F

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Command-Line Parameter -F

Paul Rosenkranz

Dear Madam,

dear Sir,

 

I’m fighting hard with an error occurring while using the command line interface of GPSBabel 1.5.2  within python code using the subprocess-call-method.

 

Plan: The output file should be stored on a path beginning with “P:”, which is a mapped drive letter for a hard disk in a company network.

 

Problem: Why is it, that gpsbabel assumes automatically “P:” is a port and it tries to open it as stated below? To be more precise, there is no access level problem as another part of the same program creates bz2-files in the same directory, without a problem.

Also if I’m using a drive letter “more common”, for example E:, output file is created as desired.

 

[Path as input parameter]

e.g.: P:\ULTIMO\Berechnungen\GPS_Logger_Export\export\14800887_140415_120249.csv

 

[-D9 Output of Error]

Opening port ULTIMO\Berechnungen\GPS_Logger_Export\export\14800887_140415_120249.csv...

mtk_logger: Can't initialise port "ULTIMO\Berechnungen\GPS_Logger_Export\export\14800887_140415_120249.csv" (No error)

 

Thanks in advance,
Paul Rosenkranz

Snizek + Partner VP GmbH

 

Paul Rosenkranz, MSc • [hidden email] • +43 1 8766811-21

Snizek + Partner Verkehrsplanungs GmbH
Ingenieurbüro für Verkehrswesen und Verkehrswirtschaft
A 1130 Wien, Bergenstammgasse 7 • www.snizek.at
T +43 1 8766811 • F +43 1 8766814 • E [hidden email]
Sitz Wien • FN 311932z • HG Wien • GF DI Gunter Stocker

 

 


------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc
Reply | Threaded
Open this post in threaded view
|

Re: Command-Line Parameter -F

Robert Lipe-4
mtk is a protocol, not a file format.
mtk-bin is a file format, but not really CSV.

http://www.gpsbabel.org/htmldoc-development/fmt_mtk.html
http://www.gpsbabel.org/htmldoc-development/fmt_mtk-bin.html

You can't write to a Mediatek GPS like a drive.


On Tue, Apr 14, 2015 at 5:15 AM, Paul Rosenkranz <[hidden email]> wrote:

Dear Madam,

dear Sir,

 

I’m fighting hard with an error occurring while using the command line interface of GPSBabel 1.5.2  within python code using the subprocess-call-method.

 

Plan: The output file should be stored on a path beginning with “P:”, which is a mapped drive letter for a hard disk in a company network.

 

Problem: Why is it, that gpsbabel assumes automatically “P:” is a port and it tries to open it as stated below? To be more precise, there is no access level problem as another part of the same program creates bz2-files in the same directory, without a problem.

Also if I’m using a drive letter “more common”, for example E:, output file is created as desired.

 

[Path as input parameter]

e.g.: P:\ULTIMO\Berechnungen\GPS_Logger_Export\export\14800887_140415_120249.csv

 

[-D9 Output of Error]

Opening port ULTIMO\Berechnungen\GPS_Logger_Export\export\14800887_140415_120249.csv...

mtk_logger: Can't initialise port "ULTIMO\Berechnungen\GPS_Logger_Export\export\14800887_140415_120249.csv" (No error)

 

Thanks in advance,
Paul Rosenkranz

Snizek + Partner VP GmbH

 

Paul Rosenkranz, MSc • [hidden email] • +43 1 8766811-21

Snizek + Partner Verkehrsplanungs GmbH
Ingenieurbüro für Verkehrswesen und Verkehrswirtschaft
A 1130 Wien, Bergenstammgasse 7 • www.snizek.at
T <a href="tel:%2B43%C2%A01%C2%A08766811" value="+4318766811" target="_blank">+43 1 8766811 • F <a href="tel:%2B43%C2%A01%C2%A08766814" value="+4318766814" target="_blank">+43 1 8766814 • E [hidden email]
Sitz Wien • FN 311932z • HG Wien • GF DI Gunter Stocker

 

 


------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc



------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc
Reply | Threaded
Open this post in threaded view
|

Re: Command-Line Parameter -F

Robert Lipe-4
The error you're describing doesn't match what it looks like you're trying to do.   Advice: get Python out of the picture and hand-build the correct command and then get the Python to mock that.

-F (capital) is output.
-f (lowercase) is input.

In your error, you're showing a file being passed to the mtk module.  If you're trying to read from the device and write to a file, it should be -i mtk -f com3: (or whatever) -o unicsv -F youroutputfile.

If you're seeing a difference in the pathname, that should be coming from the unicsv side and not the mtk side.


As described just a few days ago at http://sourceforge.net/p/gpsbabel/mailman/message/33769754/ mtk does do a strange thing in creating temporary files during reads and writes.  There's even a comment in the code that says "  // If your temp directory isn't representable in Latin1, you're going to have a bad day." which may set off alarms for you, but that path should be something like "c:/tmp" and not a drive-relative path.

But you're going to have to simplify your work flow first.  Build a simple command line 

gpsbabel -r -t -i mtk -f com3: -o unicsv -F q:\experiment\here

and build up from there.

RJL



On Tue, Apr 14, 2015 at 4:52 PM, Paul Rosenkranz <[hidden email]> wrote:

Hi Robert,

 

thank you very much for your response. I’m very aware of this difference, or maybe not?

 

I’m currently using a slightly changed command line in my call-method which was stripped from the gpsbabel gui:

 

“””gpsbabel -r -t -D9 -i mtk,erase=0,log_enable=0 -f {1} -x track,course,speed -o unicsv -F {0}""".format(os.path.abspath(path), str(comport))

 

This command line works, if {0} is a system path not using any network storage, as stated in my first email.

Assuming the command line above is constant these two cases are happening:

1.       {0} is P:\.... -> error message as stated in my first email

2.       {0} is E:\.... unicsv-export works like a charm

 

Am I missing something?

 

Thanks in advance,
Paul Rosenkranz

Snizek + Partner VP GmbH

 

Paul Rosenkranz, MSc • [hidden email] • +43 1 8766811-21

Snizek + Partner Verkehrsplanungs GmbH
Ingenieurbüro für Verkehrswesen und Verkehrswirtschaft
A 1130 Wien, Bergenstammgasse 7 •
www.snizek.at
T <a href="tel:%2B43%C2%A01%C2%A08766811" value="+4318766811" target="_blank">+43 1 8766811 • F <a href="tel:%2B43%C2%A01%C2%A08766814" value="+4318766814" target="_blank">+43 1 8766814 • E
[hidden email]
Sitz Wien • FN 311932z • HG Wien • GF DI Gunter Stocker

 

 

Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Robert Lipe
Gesendet: Dienstag, 14. April 2015 19:29
An: Paul Rosenkranz
Cc: GPSBabel-misc
Betreff: Re: [Gpsbabel-misc] Command-Line Parameter -F

 

mtk is a protocol, not a file format.
mtk-bin is a file format, but not really CSV.

http://www.gpsbabel.org/htmldoc-development/fmt_mtk.html
http://www.gpsbabel.org/htmldoc-development/fmt_mtk-bin.html

You can't write to a Mediatek GPS like a drive.

On Tue, Apr 14, 2015 at 5:15 AM, Paul Rosenkranz <[hidden email]> wrote:

Dear Madam,

dear Sir,

 

I’m fighting hard with an error occurring while using the command line interface of GPSBabel 1.5.2  within python code using the subprocess-call-method.

 

Plan: The output file should be stored on a path beginning with “P:”, which is a mapped drive letter for a hard disk in a company network.

 

Problem: Why is it, that gpsbabel assumes automatically “P:” is a port and it tries to open it as stated below? To be more precise, there is no access level problem as another part of the same program creates bz2-files in the same directory, without a problem.

Also if I’m using a drive letter “more common”, for example E:, output file is created as desired.

 

[Path as input parameter]

e.g.: P:\ULTIMO\Berechnungen\GPS_Logger_Export\export\14800887_140415_120249.csv

 

[-D9 Output of Error]

Opening port ULTIMO\Berechnungen\GPS_Logger_Export\export\14800887_140415_120249.csv...

mtk_logger: Can't initialise port "ULTIMO\Berechnungen\GPS_Logger_Export\export\14800887_140415_120249.csv" (No error)

 

Thanks in advance,
Paul Rosenkranz

Snizek + Partner VP GmbH

 

Paul Rosenkranz, MSc • [hidden email] • +43 1 8766811-21

Snizek + Partner Verkehrsplanungs GmbH
Ingenieurbüro für Verkehrswesen und Verkehrswirtschaft
A 1130 Wien, Bergenstammgasse 7 • www.snizek.at
T <a href="tel:%2B43%C2%A01%C2%A08766811" target="_blank">+43 1 8766811 • F <a href="tel:%2B43%C2%A01%C2%A08766814" target="_blank">+43 1 8766814 • E [hidden email]
Sitz Wien • FN 311932z • HG Wien • GF DI Gunter Stocker

 

 


------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc

 



------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc
Reply | Threaded
Open this post in threaded view
|

Re: Command-Line Parameter -F

Robert Lipe-4

Quote the pathnames or escape the spaces.

If your initial request or examples had included spaces, that would have saved us all much time...

On Apr 15, 2015 1:00 AM, "Paul Rosenkranz" <[hidden email]> wrote:

Thank you very much for your hints.

 

I got some sort of solution:

 

Our paths in P:\ are always some sort of P:\number projectname\..., with a space between number and projectname. If this space is removed the command line works.

 

Otherwise P:\number got removed from the –F parameter and the mtk_logger port-error message is shown.

 

Is there a workaround? What additional information will be necessary?

 

Mit freundlichen Grüßen,
Paul Rosenkranz

Snizek + Partner VP GmbH

 

Paul Rosenkranz, MSc • [hidden email] • +43 1 8766811-21

Snizek + Partner Verkehrsplanungs GmbH
Ingenieurbüro für Verkehrswesen und Verkehrswirtschaft
A 1130 Wien, Bergenstammgasse 7 •
www.snizek.at
T <a href="tel:%2B43%C2%A01%C2%A08766811" value="+4318766811" target="_blank">+43 1 8766811 • F <a href="tel:%2B43%C2%A01%C2%A08766814" value="+4318766814" target="_blank">+43 1 8766814 • E
[hidden email]
Sitz Wien • FN 311932z • HG Wien • GF DI Gunter Stocker

 

 

Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Robert Lipe
Gesendet: Mittwoch, 15. April 2015 04:16
An: Paul Rosenkranz; GPSBabel-misc
Betreff: Re: [Gpsbabel-misc] Command-Line Parameter -F

 

The error you're describing doesn't match what it looks like you're trying to do.   Advice: get Python out of the picture and hand-build the correct command and then get the Python to mock that.

-F (capital) is output.

-f (lowercase) is input.

In your error, you're showing a file being passed to the mtk module.  If you're trying to read from the device and write to a file, it should be -i mtk -f com3: (or whatever) -o unicsv -F youroutputfile.

If you're seeing a difference in the pathname, that should be coming from the unicsv side and not the mtk side.


As described just a few days ago at http://sourceforge.net/p/gpsbabel/mailman/message/33769754/ mtk does do a strange thing in creating temporary files during reads and writes.  There's even a comment in the code that says "  // If your temp directory isn't representable in Latin1, you're going to have a bad day." which may set off alarms for you, but that path should be something like "c:/tmp" and not a drive-relative path.

But you're going to have to simplify your work flow first.  Build a simple command line 

gpsbabel -r -t -i mtk -f com3: -o unicsv -F q:\experiment\here

and build up from there.

RJL

 

On Tue, Apr 14, 2015 at 4:52 PM, Paul Rosenkranz <[hidden email]> wrote:

Hi Robert,

 

thank you very much for your response. I’m very aware of this difference, or maybe not?

 

I’m currently using a slightly changed command line in my call-method which was stripped from the gpsbabel gui:

 

“””gpsbabel -r -t -D9 -i mtk,erase=0,log_enable=0 -f {1} -x track,course,speed -o unicsv -F {0}""".format(os.path.abspath(path), str(comport))

 

This command line works, if {0} is a system path not using any network storage, as stated in my first email.

Assuming the command line above is constant these two cases are happening:

1.       {0} is P:\.... -> error message as stated in my first email

2.       {0} is E:\.... unicsv-export works like a charm

 

Am I missing something?

 

Thanks in advance,
Paul Rosenkranz

Snizek + Partner VP GmbH

 

Paul Rosenkranz, MSc • [hidden email] • +43 1 8766811-21

Snizek + Partner Verkehrsplanungs GmbH
Ingenieurbüro für Verkehrswesen und Verkehrswirtschaft
A 1130 Wien, Bergenstammgasse 7 •
www.snizek.at
T <a href="tel:%2B43%C2%A01%C2%A08766811" target="_blank">+43 1 8766811 • F <a href="tel:%2B43%C2%A01%C2%A08766814" target="_blank">+43 1 8766814 • E
[hidden email]
Sitz Wien • FN 311932z • HG Wien • GF DI Gunter Stocker

 

 

Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Robert Lipe
Gesendet: Dienstag, 14. April 2015 19:29
An: Paul Rosenkranz
Cc: GPSBabel-misc
Betreff: Re: [Gpsbabel-misc] Command-Line Parameter -F

 

mtk is a protocol, not a file format.
mtk-bin is a file format, but not really CSV.

http://www.gpsbabel.org/htmldoc-development/fmt_mtk.html
http://www.gpsbabel.org/htmldoc-development/fmt_mtk-bin.html

You can't write to a Mediatek GPS like a drive.

On Tue, Apr 14, 2015 at 5:15 AM, Paul Rosenkranz <[hidden email]> wrote:

Dear Madam,

dear Sir,

 

I’m fighting hard with an error occurring while using the command line interface of GPSBabel 1.5.2  within python code using the subprocess-call-method.

 

Plan: The output file should be stored on a path beginning with “P:”, which is a mapped drive letter for a hard disk in a company network.

 

Problem: Why is it, that gpsbabel assumes automatically “P:” is a port and it tries to open it as stated below? To be more precise, there is no access level problem as another part of the same program creates bz2-files in the same directory, without a problem.

Also if I’m using a drive letter “more common”, for example E:, output file is created as desired.

 

[Path as input parameter]

e.g.: P:\ULTIMO\Berechnungen\GPS_Logger_Export\export\14800887_140415_120249.csv

 

[-D9 Output of Error]

Opening port ULTIMO\Berechnungen\GPS_Logger_Export\export\14800887_140415_120249.csv...

mtk_logger: Can't initialise port "ULTIMO\Berechnungen\GPS_Logger_Export\export\14800887_140415_120249.csv" (No error)

 

Thanks in advance,
Paul Rosenkranz

Snizek + Partner VP GmbH

 

Paul Rosenkranz, MSc • [hidden email] • +43 1 8766811-21

Snizek + Partner Verkehrsplanungs GmbH
Ingenieurbüro für Verkehrswesen und Verkehrswirtschaft
A 1130 Wien, Bergenstammgasse 7 • www.snizek.at
T <a href="tel:%2B43%C2%A01%C2%A08766811" target="_blank">+43 1 8766811 • F <a href="tel:%2B43%C2%A01%C2%A08766814" target="_blank">+43 1 8766814 • E [hidden email]
Sitz Wien • FN 311932z • HG Wien • GF DI Gunter Stocker

 

 


------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc

 

 


------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Gpsbabel-misc mailing list http://www.gpsbabel.org
[hidden email]
To unsubscribe, change list options, or see archives, visit:
https://lists.sourceforge.net/lists/listinfo/gpsbabel-misc