#!/usr/bin/perl -wT # # This is the CGI that processes the form return from newuser.html # It's in Perl rather than Python because Berlios doesn't support # Python CGIs. # use CGI qw(:standard); use CGI::Carp qw(warningsToBrowser fatalsToBrowser); use MIME::Base64; $query = new CGI; print $query->header; print $query->start_html(-title=>"GPS Reporting Form", -background=>"../htdocs/paper.gif"); $output_sample_file = $query->param('output_sample'); $output_sample_body = $query->param('output_sample_body'); $output_sample_body = '' unless ($output_sample_body); do { local $/ = undef; local $x = <$output_sample_file>; $output_sample_body = encode_base64($x, "") if ($x); }; if (hasNeededElements($query) && $query->param("action") eq "Send Report"){ # handle successful upload... $ENV{'PATH'} = '/usr/bin:/bin'; open(M, '|mail -s "new gps report" ckuethe') || die "can't run mail: $!\n"; print M "Remote: ${ENV{'REMOTE_ADDR'}}:${ENV{'REMOTE_PORT'}}\n"; foreach $var ( qw(submitter vendor model techdoc chipset firmware nmea interface testversion rating notes location date interval leader sample_notes)){ $val = $query->param($var); printf M ("%s: %s\n", $var, $val) if (defined($val) && $val); } $output = encode_base64(decode_base64($output_sample_body)); printf M ("output_sample (base64 encoded):\n%s\n", $output); close(M); print "new gps report accepted...\n"; exit(0); } print $query->start_multipart_form; print <GPS Behavior Reporting Form

Please use this form to report gpsd successes or failures with GPS units, and also to upload a sample of the GPS's output so we can add it to our regression tests and ensure continued support of the device.

Fields marked Important! have to be filled in for the report to be useful. These are: submitter contact address, vendor, model, documentation URL, and output sample. Other fields represent things we might be able to find out ourselves, but which are easier for you to determine. Every bit of information you can give us about your GPS will help make the support for it more reliable.


Contact information

Important! We need a valid email address for you in case we need to ask you followup questions about the device. We won't give your address to anyone.
Example: Eric Raymond <esr@thyrsus.com>

EOF print "Name and email address:",$query->textfield(-name=>"submitter", -size=>72); print <(It is not actually very likely we will contact you, but we need to be able to do it if we can find no other way of getting information about the device. Expect to hear from us if your GPS is obsolescent or exotic and the information you provide in the rest of this form turns out to be insufficient. Or if your browser is broken enough to botch the output-sample upload.)


GPS type identification

Important! Identify the vendor and model of your device.
Example: Haicom and 303S.

EOF print "

Vendor:",$query->textfield(-name=>"vendor", -size=>72),"

"; print "

Model:",$query->textfield(-name=>"model", -size=>72),"

"; print <Important! We need a URL pointing to a technical manual for the device. You can usually find this on the vendor's website by giving a search engine the product name. If it's not linked directly from the vendor's page for the individual product, look under "Technical Support" or "Product support" on the vendor's main page.
Example: http://www.haicom.com.tw/gps303s.shtml

URL of a technical manual: EOF print $query->textfield(-name=>"techdoc", -size=>72); print <Please identify the GPS chipset and firmware version, if possible. You may be able to get this from the display of xgps; look for a GPS Type field or at the window title bar. Alternatively, you may find it in the technical manual.
Example: SiRF-II amd 2.31ES.

EOF print "

Chipset:", $query->textfield(-name=>"chipset", -size=>72),"

\n"; print "

Firmware:", $query->textfield(-name=>"firmware", -size=>72),"

\n"; print <Please identify, if possible, the NMEA version the GPS emits. You may be able to get this information from the technical manual. Likely values are 2.0, 2.2, and 3.0. If the GPS emits only a vendor binary protocol, leave this field blank.

EOF print "NMEA 0183 version emitted:",$query->textfield(-name=>"nmea", -size=>6); print <

Interfaces

Please identify the GPS's interface type (USB, RS-232, Compact Flash, etc.). If the GPS has adapters that support other interfaces, tell us the one you have and mention the adapters in the "Technical Notes" box. If it has an exotic interface not listed here, select "Other" and tell us about it in "Technical Notes".

EOF print $query->radio_group(-name=>'interface', -values=>['USB', 'Serial', 'Bluetooth', 'TTL', 'Compact Flash', 'RS-232', 'Other'], -default=>"-", -linebreak=>'false'); print <If your device is USB, it probably uses a USB-to-serial adapter chip. Try to find out what this is by looking at the output of lsusb(1). Likely values are PL2303, UC-232A, FTDI 8U232AM, Cypress M8 or Silicon Labs CP2102.

EOF print"USB-to-serial chip:",$query->textfield(-name=>"usbchip", -size=>72); print <

GPSD compatibility

Please tell us what version you tested with. If you used us a release, give us the full release number, like 2.35. If you built your code from our development repository please give the revision number, like r4595.

EOF print "Tested with:",$query->textfield(-name=>"testversion", -size=>6); print <Please rate how well this GPS functions with GPSD:

EOF %labels=( "excellent", "Excellent -- gpsd recognizes the GPS rapidly and reliably, reports are complete and correct.", "good", "Good -- gpsd has minor problems or lag recognizing the device, but reports are complete and correct.", "fair", "Fair -- Reports have minor dropouts or problems, including occasional transient nonsense values.", "poor", "Poor -- Reports frequently have values that are wrong or nonsense.", "broken", "Broken -- gpsd frequently, or always, fails to recognize the device at all.", "other", "Other -- See Technical Notes.", ); print $query->radio_group(-name=>'rating', -values=>['excellent', 'good', 'fair', 'poor', 'broken', 'other'], -default=>"-", -labels=>\%labels, -linebreak=>'true'); print <

Technical notes

Now tell us the things that didn't fit in the rest of the form. Appropriate things to put here include how to read any LEDs or other unlabeled indicators on the device, a warning that the product has been discontinued, a list of alternate interfaces, descriptions of errors in the documentation, applicable PPS offsets, descriptions of special abilities such as the ability to vary the sampling interval, and a note if it's an OEM module rather than a retail product. Anything else you think we need to know should go here too.

EOF print $query->textarea(-name=>"notes", -rows=>10, -cols=>72); print <

Output sample

Important! We need a sample of the output from your GPS. We'll use this for mechanical regression testing, which is your best guarantee that support for your device won't get broken in a future release.

All SiRF-based and almost all NMEA GPSes will simply start throwing data to your port immediately when they're plugged in. You should normally be able to capture this output to a file with the gpscat utility.

There will be some unusual cases in which this isn't possible, because the device needs some kind of activation sequence written to it before it will start reporting. Some Garmin GPSes (the ones that speak Garmin binary protocol rather than NMEA) are like this. If you think you have one of these, ask the GPSD developers for help.

A log file is most useful when it contains (a) some sentences generated when the GPS has no fix, (b) some sentences representing a fix with the GPS stationary, and (c) some sentences representing a fix with the GPS moving.

EOF print $query->filefield(-name=>'output_sample', -size=>72); printf("\n\n", $output_sample_body); print <There is some auxiliary data we like to have in our regression-test files.

Location of the log capture. A good format would include your nearest city or other landmark, state/province, country code, and a rough latitude/longitude. The GPS will give an exact location; we want this as a sanity check.
Example: Groningen, NL, 53.2N 6.6E

EOF print"Location:",$query->textfield(-name=>"location", -size=>72); print <Day/month/year of the log capture (the GPS will give us hour/minute/second).
Example: 20 May 2006.

EOF print"Date:",$query->textfield(-name=>"date", -size=>72); print <The GPS's default sampling interval in seconds. This will usually be 1. For SiRF chips it's always 1 and you can leave it blank; it's mainly interesting for NMEA devices with unknown chipsets.

EOF print"Sampling interval:",$query->textfield(-name=>"interval", -size=>6); print <First sentence in the GPS's reporting cycle. Leave this blank for SiRF devices; it is mainly interesting for NMEA devices with unknown chipsets. You may be able to read it from the manual; if not, slowing the GPS to 4800 will probably make the intercycle pause visible.

EOF print"First sentence:",$query->textfield(-name=>"leader", -size=>20); print <Finally, add any notes you want to about how the sample was taken. One good thing to put here would a description of how the GPS was moving while the log was being captured. If the sentence mix changes between "fix" and "no fix" states, that too is a good thing to note.

EOF print $query->textarea(-name=>"sample_notes", -rows=>10, -cols=>72); print <

Thanks for your help. Here is a summary of the information you have entered so far:

EOF print "
"; if ($query->param("submitter")) { print "Contact address is ". escapeHTML($query->param("submitter")) ."
\n"; } else { print "No contact address.
\n"; } if ($query->param("vendor")) { print "Vendor is ". escapeHTML($query->param("vendor")) ."
\n"; } else { print "No vendor.
\n"; } if ($query->param("model")) { print "Model is ". escapeHTML($query->param("model")) ."
\n"; } else { print "No model specified.
\n"; } if ($query->param("techdoc")) { print "Document URL specified.
\n"; } else { print "No document URL.
\n"; } if ($output_sample_body) { print "Output sample uploaded"; } else { print "No output sample.
\n"; } print "
"; if ($query->param("chipset")) { print "Chipset is ". escapeHTML($query->param("chipset")) ."
\n"; } else { print "Chipset not specified.
\n"; } if ($query->param("firmware")) { print "Firmware is ". escapeHTML($query->param("firmware")) ."
\n"; } else { print "Firmware not specified.
\n"; } if ($query->param("nmea")) { print "NMEA version is ". escapeHTML($query->param("nmea")) ."
\n"; } else { print "NMEA version not specified.
\n"; } if ($query->param("interface")) { print "Interface type is ". escapeHTML($query->param("interface")) ."
\n"; if ($query->param("interface") eq "USB") { if ($query->param("usbchip")) { print "USB chip is ". escapeHTML($query->param("usbchip")) ."
\n"; } else { print "No USB chip specified.
\n"; } } } else { print "No interface type specified.
\n"; } if ($query->param("testversion")) { print "Tested with GPSD version ". escapeHTML($query->param("testversion")) ."
\n"; } else { print "No GPSD version specified.
\n"; } if ($query->param("notes")) { print "Technical notes have been entered."; } else { print "No technical notes.
\n"; } print "
"; if ($query->param("location")) { print "Sample location ". escapeHTML($query->param("location")) ."
\n"; } else { print "No sample location specified.
\n"; } if ($query->param("date")) { print "Sample date ". escapeHTML($query->param("date")) ."
\n"; } else { print "No sample date specified.
\n"; } if ($query->param("interval")) { print "Sampling interval ". escapeHTML($query->param("interval")) ."
\n"; } else { print "No sampling interval specified.
\n"; } if ($query->param("leader")) { print "Leading sentence ". escapeHTML($query->param("leader")) ."
\n"; } else { print "No leading sentence specified.
\n"; } if ($query->param("sample_notes")) { print "Notes on the sample have been entered."; } else { print "No notes on the sample.
\n"; } print "
"; print "

To refresh this summary, click Review\n"; # Must have all critical fields to ship if (hasNeededElements($query)){ print <Click the Send Report button to send your report to the GPSD developers. Eventually, your report is likely to appear on our Hardware page.

Reset Form
EOF } else { print <Required fields are missing; please fill them in and click Review.

Reset Form
EOF } print "\n
\n"; print '$Id$'; print $query->end_html; sub hasNeededElements{ my $query = $_[0]; return 1 if ($query->param("submitter") && $query->param("vendor") && $query->param("model") && $query->param("techdoc") && $output_sample_body); return 0; } # The following sets edit modes for GNU EMACS # Local Variables: # fill-column:79 # End: