RTFQ MultiWii Pro 2.0 - adding Ublox GPS - Arduino question

skindoc

Junior Member
I orginally bought a MW Pro 2.0 board from Readytoflyquads.com - I want to put a Ublox GPS unit on it now - I've reflashed the board with MW 2.3 - do I need to define the Ublox option like this to get this to work? I'm totally new at this Arduino stuff - I can't locate the .txt file mentioned below... help !


/* GPS protocol
NMEA - Standard NMEA protocol GGA, GSA and RMC sentences are needed
UBLOX - U-Blox binary protocol, use the ublox config file (u-blox-config.ublox.txt) from the source tree
MTK_BINARY16 and MTK_BINARY19 - MTK3329 chipset based GPS with DIYDrones binary firmware (v1.6 or v1.9)
With UBLOX and MTK_BINARY you don't have to use GPS_FILTERING in multiwii code !!! */


//#define NMEA
#define UBLOX
//#define MTK_BINARY16
//#define MTK_BINARY19
//#define INIT_MTK_GPS // initialize MTK GPS for using selected speed, 5Hz update rate and GGA & RMC sentence or binary settings
 

jhitesma

Some guy in the desert
Mentor
The MW docs on GPS are...in the word of our favorite sweede - HORRIBLE!

Even reading the threads about it on the MW forums the info is a mess.

I got mine working and to be 100% honest I'm still not 100% how I got it working.

It's also been a few months since I got mine working so my memory about just how I got it working is a bit sketchy. I was able to track down that u-blox-config.ublox.txt file but I was never able to get the ublox config program to successfully write it to my GPS. And the u-blox config program is one of the single most user hostile pieces of software I've ever used. It's not poorly documented...but the documentation was not originally written in English and while not Chinglish it was still very confusing to figure out.

What did help a lot was a PDF from EOSBandi about how to setup GPS which I tracked down on the MW forums/site somewhere. Unfortunately I can't find my copy or where I originally found it right now. I'll keep my eyes peeled and check my work computer tomorrow to see if I can dig it up for you.

But - after going through all that and I believe getting my GPS module programmed manually I found newer posts on the MW forum indicating that by uncommenting the #define UBLOX option the MW will actually do the config of the GPS itself. So it could be I totally failed at getting mine configured and it's just that MW is doing it for me each boot.

I do know that mine is now working great and locks on to at least 6 sats almost instantly indoors and 9-11 outdoors.


What I'm currently using is:
#define GPS_BAUD 57600
#define UBLOX

I'd say start with that and see if it works. There's a chance the MW may just handle it all for you if you're running 2.3 looking at the GPS.cpp file it does appear that when UBLOX is defined the MW should try to connect to it at various bauds then whatever rate it's able to communicate at it sends an initization string that's hardcoded into the MW source:

#if defined(INIT_MTK_GPS) || defined(UBLOX)
#if defined(UBLOX)
prog_char UBLOX_INIT[] PROGMEM = { // PROGMEM array must be outside any function !!!
0xB5,0x62,0x06,0x01,0x03,0x00,0xF0,0x05,0x00,0xFF,0x19, //disable all default NMEA messages
0xB5,0x62,0x06,0x01,0x03,0x00,0xF0,0x03,0x00,0xFD,0x15,
0xB5,0x62,0x06,0x01,0x03,0x00,0xF0,0x01,0x00,0xFB,0x11,
0xB5,0x62,0x06,0x01,0x03,0x00,0xF0,0x00,0x00,0xFA,0x0F,
0xB5,0x62,0x06,0x01,0x03,0x00,0xF0,0x02,0x00,0xFC,0x13,
0xB5,0x62,0x06,0x01,0x03,0x00,0xF0,0x04,0x00,0xFE,0x17,
0xB5,0x62,0x06,0x01,0x03,0x00,0x01,0x02,0x01,0x0E,0x47, //set POSLLH MSG rate
0xB5,0x62,0x06,0x01,0x03,0x00,0x01,0x03,0x01,0x0F,0x49, //set STATUS MSG rate
0xB5,0x62,0x06,0x01,0x03,0x00,0x01,0x06,0x01,0x12,0x4F, //set SOL MSG rate
0xB5,0x62,0x06,0x01,0x03,0x00,0x01,0x12,0x01,0x1E,0x67, //set VELNED MSG rate
0xB5,0x62,0x06,0x16,0x08,0x00,0x03,0x07,0x03,0x00,0x51,0x08,0x00,0x00,0x8A,0x41, //set WAAS to EGNOS
0xB5, 0x62, 0x06, 0x08, 0x06, 0x00, 0xC8, 0x00, 0x01, 0x00, 0x01, 0x00, 0xDE, 0x6A //set rate to 5Hz
};
#endif

So I think all the work I did trying to setup my module wasn't actually needed. But since I didn't learn this until after doing it I'm not sure if what I did was what made it work or if the MW is just doing it for me.

On the upside trying to do it manually I did get my TTLserial->USB adapter working and learned just how crazy over the top these u-blox modules are by playing with their config app!