Friday 7 December 2018

BlueFlyVario_TTL_GPS_v12 firmware update

Today I have released a firmware update for the BlueFlyVario_TTL_GPS_v12 (firmware version 12.219). This update changes the way data from the on board XA1110 GPS is cached by Bluefly processor and multiplexed with the normal Bluefly output. Updating the firmware on a Bluefly attached to a Kobo requires that it be removed, so this post also describes how you can use an xci file to adjust the GPS without having to update the firmware.

When the TTL_GPS_v12 model of the Bluefly was released the GPS module was upgraded. The new XA1110 GPS module communicates with the Bluefly processor over UART at 115200 baud. A few months ago some issues were found when using the Bluefly with LK8000 that we thought that were being caused by occasional errors in the communication. This knowledgeable article describes how to change the baud rate as a workaround.

However, additional testing discovered that in some circumstances (such as when tracking a lot of satellites), too much UART data was being sent from the XA1110 in a short time and the Bluefly could not keep up. This was causing errors in some re-transmitted GPS sentences, and some sentences were even being dropped. Location sentences are being transmitted successfully, which is why initial testing did not pick up the bug.

The firmware update described in this blog post allows the Bluefly processor to cache the GPS data in a more robust way. Many hours of testing suggests that all GPS sentences will now be transmitted without error.

Thanks to those Bluefly users who helped us workout the bug.

What models are affected?

The bug affects BlueFlyVario_TTL_GPS_v12 (with the XA1110 GPS/GLONASS module) shipped between initial release on 7 Jul 2018 to and 27 Nov 2018. Varios shipped from 28 Nov 2018 date have the updated firmware.

This firmware update does not apply to the Bluetooth_USB or USB models of the Bluefly.

If your vario is installed on a Kobo and you are running xcsoar you can see what version of the firmware you are running by starting (or restarting) the vario while you are looking at the Device monitor (Menu|Config|Devices|Monitor). See the image below which shows the firmware loaded on this device is version 12.218.

What should I do?

If you have firmware 12.2.18 there are a few options:

Option 1 - Do nothing. If you are happy with the performance of you vario, and it is installed on a Kobo on which you are running xcsoar, then you may wish to do nothing. This will be ok for some pilots, but if you are using your GPS tracks for competitions or want increased confidence in the performance of the GPS then I recommend option 2 or 3.

Option 2 - Change the baud rate. Changing the baud rate between the Bluefly processor and the onboad XA1110 is a workaround which provides a reliable fix. If your Bluefly is soldered to your Kobo, and you are running xcsoar, then this is probably the easiest thing to do. You can change the baud rate in two ways:
  • Use the baud rate update procedure described in the knowledgebase article.
  • Use the BlueFlyDebug_28Nov18.xci file to send the same commands to the Bluefly to change the baud rate, but without  having to disconnect it from the kobo. See Nev's extensive information on xci files here for more information on how they work. To to this:
    1. First download the xci file to your pc, then get it onto the Kobo in the xcsoardata directory. 
    2. Load this xci file to create the BlueFly menu using Menu|Config|System|Language,Input|Events
    3. Restart to apply changes. 
    4. Look at the monitor (Menu|Config|Devices|Monitor) to make sure the BlueFly is running by seeing the data is streaming in. The GPS sentences are the ones starting with $G
    5. Check that your new BlueFly menu is working and that you have two way communications with the Bluefly. (Menu|BlueFly|SimulateButton). You should hear a beep as if you were pressing the button on the Bluefly. If you don't hear anything from the Bluefly then there is probably a problem with physical connection and you will need to fix that before continuing. 
    6. Go into the GPS Adjustments menu (Menu|BlueFly|GPS Adjustments). 
    7. Press Menu|BlueFly|GPS Adjustments|GPS Command Mode. That sends the command PGCMD,380,7 which puts the XA1110 GPS into command mode. Note that xcsoar adds the appropriate checksum and end of line information to the command. 
    8. Press Menu|BlueFly|GPS Adjustments|XA1110 9600 Baud. That sends the command PGCMD,231,1 which adjusts the XA1110. 
    9. Fully shutdown and restart the Kobo. This ensures that the Bluefly, and its attached XA1110 GPS, are fully powered down and restarted. The baud rate changes to the GPS do not take effect until you have done this restart. 
    10. Have a look at the device monitor again. Now you should not see any GPS sentences. We have adjusted the data rate from the XA1110, but now we need to adjust the rate of UART 1 on the Bluefly process so it picks up those sentences. If you do actually see GPS sentences before you have adjusted U1 then you might not have successfully done step 6, 7 and 8. 
    11. Change the Bluefly U1 baud rate by pressing Menu|BlueFly|GPS Adjustments|U1 Baud 9600. 
    12. Look at the monitor for the last time and you should now see GPS sentences again. The GPS Tx baud rate is 9600, the Bluefly U1 Rx baud rate is 9600, and if you have the defaults the Bluefly U2 Tx baud rate is 115200, which allows it to keep up with the GPS information. 
    13. Note that I have also included buttons for adjusting U1 back to 115200, and also for adjusting the XA1110 baud back to 115200.
Once you have done that, you are still running the older firmware, but the U1 baud rate means that the Bluefly processor with that older firmware can keep up with the GPS data sending rate without errors. 

Option 3 - Actually update the firmware. To update the firmware you will need a USB serial adapter, the Bluefly must be removed from the Kobo, and you will need the ds30 loader from the firmware page. Removing a Bluefly from a Kobo can be tricky, and if you are not very practiced with good soldering techniques then it is likely you will damage the Bluefly, the Kobo, or both.

The firmware update procedure is the same as for the v11 as described here:
Alternately, you can ship the TTL_GPS back to me and I will update the firmware for you. If you want to do that please contact me and I will send you the address and instructions.