Sunday 7 June 2015

TTL_GPS Support Tips

The TTL_GPS model of the BlueFlyVario and a Kobo eReader can be the basis of a great vario in the hands of a reasonably experienced electronics tinkerer. Some people find it a little difficult to install successfully. This post provides a few tips.

Easy Install Method

There are many ways to install the BlueFlyVario_TTL_GPS to a Kobo. My current favorite install method involves using the included connector so that the vario is removable from the Kobo for easily adjusting Hardware Settings or doing firmware upgrades. If you are just experimenting with using a Kobo as a vario, or you are a little unsure what you are doing, then I recommend using this simple install (see the release blog post for more information). Advanced users can always install in a more robust way by de-soldering and re-soldering later. A few tips:
  • Install the right angled pins flush with the board. This makes the BlueFly sit flush to the front of the Kobo. The image below shows the sequence of pushing the plastic on the pins, cutting the pins, soldering, then removing the plastic from the pins.
  • Use the neoprene (essential) and heatshrink (not shown in the image below) to enclose the BlueFly, then fix to the front of the Kobo with double sided tape. Leave the covering on the sticky side of the neoprene and use the black squishy side to cover the pressure sensor (the sticky glue would block the holes). 

Using a USB to TTL Serial converter

A USB to TTL Serial converter makes it much easier to adjust hardware settings and is essential if you want to do firmware upgrades for the TTL_GPS model. You can adjust hardware settings when the BlueFly is connected to the Kobo with Putty and Telnet (see this blog post), but is is much easier with a USB to TTL Serial converter and the BFV Desktop application. The converter I use is shown in the image below. These can be purchased from eBay for a few dollars. Search eBay for "usb ttl serial". I only use the FTDI based converters as I am super confident that the drivers are kept up to date for most platforms.

Once the converter is plugged in to a Windows computer it should install as a serial port automatically. Have a look at the website of the converter chip manufacturer for appropriate drivers if it did not install. Take a note of what the serial port is. Depending on your version of Windows you might need to look in your device settings.

The connection between the converter and the BlueFlyVario_TTL_GPS is shown below. This converter is set to provide 5V of power. Note that the TTL levels on Rx and Tx are therefore 5V which is out of spec for the BlueFlyVario's 3.3V micro-controller, but I have not found it to be an issue with the 2.2k resistors in series. If the converter is set to provide 3.3V the BlueFly draws enough current on start-up to reset the converter, which is annoying. The most important thing to remember when connecting the BlueFly to the Converter is to ensure connections as follows; 
  • GND (BlueFly) to GND (Converter)
  • Tx (BlueFly) to Rx (Converter) 
  • Rx (BlueFly) to Tx (Converter)
  • V+ (BlueFly) to V+ (Converter)

With the converter plugged in with a USB cable run the BFV Desktop app (get the latest version from the support page). Next, connect to the relevant converter serial port at 57600 baud. Turn on the BlueFly by pressing the button and you should see data from the BlueFly streaming in. Using the BFV Desktop application you can then easily adjust all hardware settings. See the hardware settings manual (also on the support page) for information on the range of hardware settings.

If you want to update the firmware then I suggest ensuring communication with the BlueFly via the BFV Desktop app first. That ensures you have an working serial port connection. See the support page for information about updating firmware and how to use the DS30loader application. Note that you can only connect the BlueFly to one application at a time.

Debugging GPS Performance

The performance of the PA6H GPS is different the GPS in your Smartphone. It has no connection to the internet and often takes longer to receive satellites. Also, the antenna is generally not as good. Nevertheless, when it is working well most uses find it more than good enough to support flying. The most common questions I get about GPS performance ranges from the message "GPS Not Connected" to poor altitude performance.

The first step is to check if GPS messages are being sent to xcsoar. Check this in xcsoar by looking at the data stream coming in the Monitor (Menu|Config|Config2/3|Devices|Monitor). Check if the GPS messages are being sent to the vario. If the GPS LED flashing (it is either blue or red), then messages beginning with $GP... should be sent to xcsoar (GPS Data). A few are sent every second. If you can't see any messages then the BlueFly might not be connected properly, the xcsoar device settings might not be correct, the BlueFly hardware settings might be wrong, or there could be a hardware problem.

If you have GPS messages and are still having problems then check the HDOP and VDOP values in the $GPGSA messages. See this page for a description of these sentences. To enable detailed analysis set up the NMEA logger (Menu|Config|Config2/3|System|Setup|Logger|NMEA logger = On), record a track, then download the log to the PC using the Kobo in Nickel mode. If the HDOP and VDOP look good then the GPS should be giving a good fix.

For some earlier versions of the BlueFlyVario_TTL_GPS firmware it is possible $GPGGA sentences were clipped when you get a DGPS fix. If the messages are clipped (one character in the checksum instead of two) then update to the latest BlueFly firmware.

Lastly, note that the GPS vs Vario altitude in xcsoar is sometimes messed up. This article by Neil Page describes the various altitude settings. Use barometric altitude in preference to GPS altitude.

If these tips did not help then the best way to ask for support is to email me using the contact section of the website