Crius GPS and I2C_GPS_NAV

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
JirkaA
Posts: 11
Joined: Mon Jul 16, 2012 5:41 pm
Location: near Brno, Czech Republic
Contact:

Crius GPS and I2C_GPS_NAV

Post by JirkaA »

I begin this thread because subject is discussed often in GPS integration thread here: viewtopic.php?f=8&t=649 and it seems that many people doesn't read so long threads and ask again and again about the same things.

Situation overview: Crius GPS board utilises u/blox NEO-6M module without non-volatile storage for configuration. Therefore, configuration are lost very often. Another issue with default hardware configuration is, that module after power-on does not send navigation data, has to be switched off and on again. My observation is, that hardware configuration with grounded pin 14 is free of described issue. Secondary plus is, that default COM speed in this configuration is 38400 Bd, what is good enough for that binary data volume.

So, my solution consist of these steps:

1. Hardware modification of Crius GPS board - easy task, just short pins 13 and 14 on GPS module by small drop of solder. Thanks for image to Krystal:
Image

2. Software modification of EOSBandi's I2C_GPS_NAV.ino (ver. 2.1), put this code just after "void setup() {"

Code: Select all

 delay(3000);      //lets some time to GPS module to init
  Serial.begin(38400);
  delay(1000);

  PROGMEM prog_uchar conf2[]={0xB5, 0x62, 0x06, 0x08, 0x06, 0x00, 0xC8, 0x00, 0x01, 0x00, 0x01, 0x00, 0xDE, 0x6A};    //set rate to 5Hz
  Serial.write (conf2,sizeof(conf2));
  delay(300);
  PROGMEM prog_uchar conf3[]={0xB5, 0x62, 0x06, 0x03, 0x1C, 0x00, 0x02, 0x03, 0x10, 0x18, 0x14, 0x05, 0x00, 0x3C, 0x3C, 0x14, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x17, 0xFA, 0x00, 0xFA, 0x00, 0x64, 0x00, 0x2C, 0x01, 0x0F, 0x00, 0x00, 0x00, 0x8D, 0xE4};
  Serial.write (conf3,sizeof(conf3));
  delay(300);
  PROGMEM prog_uchar conf4[]={0xB5, 0x62, 0x06, 0x1A, 0x28, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x04, 0x10, 0x02, 0x50, 0xC3, 0x00, 0x00, 0x18, 0x14, 0x05, 0x3C, 0x00, 0x03, 0x00, 0x00, 0xFA, 0x00, 0xFA, 0x00, 0x64, 0x00, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6B, 0x6D};
  Serial.write (conf4,sizeof(conf4));
  delay(300);
  PROGMEM prog_uchar conf5[]={0xB5, 0x62, 0x06, 0x24, 0x24, 0x00, 0xFF, 0xFF, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x10, 0x27, 0x00, 0x00, 0x05, 0x00, 0xFA, 0x00, 0xFA, 0x00, 0x64, 0x00, 0x2C, 0x01, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4F, 0x82};
  Serial.write (conf5,sizeof(conf5));                                                                                  //set GPS dynamic platform to "pedestrian" seems to be best for copter
  delay(300);
  PROGMEM prog_uchar conf6[]={0xB5, 0x62, 0x06, 0x01, 0x03, 0x00, 0xF0, 0x05, 0x00, 0xFF, 0x19};
  Serial.write (conf6,sizeof(conf6));
  delay(300);
  PROGMEM prog_uchar conf8[]={0xB5, 0x62, 0x06, 0x01, 0x03, 0x00, 0xF0, 0x03, 0x00, 0xFD, 0x15};
  Serial.write (conf8,sizeof(conf8));
  delay(300);
  PROGMEM prog_uchar conf9[]={0xB5, 0x62, 0x06, 0x01, 0x03, 0x00, 0xF0, 0x01, 0x00, 0xFB, 0x11};
  Serial.write (conf9,sizeof(conf9));
  delay(300);
  PROGMEM prog_uchar conf10[]={0xB5, 0x62, 0x06, 0x01, 0x03, 0x00, 0xF0, 0x00, 0x00, 0xFA, 0x0F};
  Serial.write (conf10,sizeof(conf10));
  delay(100);
  PROGMEM prog_uchar conf13[]={0xB5, 0x62, 0x06, 0x01, 0x03, 0x00, 0xF0, 0x02, 0x00, 0xFC, 0x13};
  Serial.write (conf13,sizeof(conf13));
  delay(100);
  PROGMEM prog_uchar conf14[]={0xB5, 0x62, 0x06, 0x01, 0x03, 0x00, 0xF0, 0x04, 0x00, 0xFE, 0x17};      //disable all default NMEA messages, shorter code that disable all
  Serial.write (conf14,sizeof(conf14));
  delay(100);
  PROGMEM prog_uchar conf15[]={0xB5, 0x62, 0x06, 0x01, 0x03, 0x00, 0x01, 0x02, 0x01, 0x0E, 0x47};
  Serial.write (conf15,sizeof(conf15));
  delay(100);
    PROGMEM prog_uchar conf17[]={0xB5, 0x62, 0x06, 0x01, 0x03, 0x00, 0x01, 0x03, 0x01, 0x0F, 0x49};
  Serial.write (conf17,sizeof(conf17));
  delay(100);
  PROGMEM prog_uchar conf18[]={0xB5, 0x62, 0x06, 0x01, 0x03, 0x00, 0x01, 0x06, 0x01, 0x12, 0x4F};
  Serial.write (conf18,sizeof(conf18));
  delay(100);
  PROGMEM prog_uchar conf19[]={0xB5, 0x62, 0x06, 0x01, 0x03, 0x00, 0x01, 0x12, 0x01, 0x1E, 0x67};    //enable UBX messages POSLLH, SOL, STATUS and VELNED as is in EOSBandi's config file
  Serial.write (conf19,sizeof(conf19));
  delay(100);
  PROGMEM prog_uchar conf7[23]={0xB5, 0x62, 0x06, 0x09, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x31, 0xBF};        //write config to module
  Serial.write (conf7,sizeof(conf7));
 

This code send all initialization commands to GPS, there is no more necessary to configure GPS board manualy in case of config data lost.

3. don't forget edit config.h of I2C_GPS_NAV and set #define UBLOX and #define GPS_SERIAL_SPEED 38400, upload it to I2C_GPS_NAV board.


That's all, I hope that my poor english is clear enough ;) Any feedback will be appreciated.

flyrobot
Posts: 73
Joined: Thu Apr 05, 2012 3:59 pm

Re: Crius GPS and I2C_GPS_NAV

Post by flyrobot »

According this post http://www.rcgroups.com/forums/showpost ... count=3516
38400 is should be enough.

krystal
Posts: 12
Joined: Fri Mar 30, 2012 2:06 am

Re: Crius GPS and I2C_GPS_NAV

Post by krystal »

Connected 13 and 14 pin. After that havent any fix from GPS. Baudrate is still 115000. Why?

///My mistake. Working now perfectly :)
Last edited by krystal on Thu Jul 26, 2012 12:55 pm, edited 1 time in total.

crashlander
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: Crius GPS and I2C_GPS_NAV

Post by crashlander »

Sorry for cross posting (only link) but is the same topic so please bear with me and comment!
viewtopic.php?f=8&t=649&p=19682#p19682

krystal
Posts: 12
Joined: Fri Mar 30, 2012 2:06 am

Re: Crius GPS and I2C_GPS_NAV

Post by krystal »

Can someone paste code for ENABLE UBX protocol?

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: Crius GPS and I2C_GPS_NAV

Post by Alexinparis »

crashlander wrote:Sorry for cross posting (only link) but is the same topic so please bear with me and comment!
viewtopic.php?f=8&t=649&p=19682#p19682


Hi,
As we have now a ublox binary protocol decoder, this solution is probably the best one.
And the following facts:
- ublox protocol offers some interresting variables we don't have via NMEA, like vel_x and vel_y. I'm sure the perf can be improved using them.
- according to EOS, data are more accurate in this mode

I did the mod yesterday and it is fine.
however, the binary sequence suggested by JirkaA doesn't seem to work once in this mod.
for instance, I can't switch for 5Hz.
(And hopfully, I know it's possible because it's possible via ublox_conf)

User avatar
dramida
Posts: 473
Joined: Mon Feb 28, 2011 12:58 pm
Location: Bucharest
Contact:

Re: Crius GPS and I2C_GPS_NAV

Post by dramida »

Hi all, i need some advice in configuring Ublox neo 6M in NMEA 38400 5Hz update. I want to connect the GPS directly on serial2 of Crius PRO AIO V1 board. Thank you :)

User avatar
dramida
Posts: 473
Joined: Mon Feb 28, 2011 12:58 pm
Location: Bucharest
Contact:

Re: Crius GPS and I2C_GPS_NAV

Post by dramida »

After hours of reading i found EOS Bandi's post with NMEA 115200baud 5Hz settings for Crius Ublox neo 6M GPS:
viewtopic.php?f=8&t=649&start=1060#p18108

Now i realize that i need to initialize GPS at startup in setup(){} because it looses its config quite fast (an hour or so)...so, let's find the procedure around....

User avatar
brettwal
Posts: 93
Joined: Mon Jun 18, 2012 4:51 pm
Location: Louisiana

Re: Crius GPS and I2C_GPS_NAV

Post by brettwal »

dramida wrote:After hours of reading i found EOS Bandi's post with NMEA 115200baud 5Hz settings for Crius Ublox neo 6M GPS:
viewtopic.php?f=8&t=649&start=1060#p18108

Now i realize that i need to initialize GPS at startup in setup(){} because it looses its config quite fast (an hour or so)...so, let's find the procedure around....



Forget NMEA output, put it in Binary mode. The POS HOLD is SO much better with Ublox binary.

User avatar
dramida
Posts: 473
Joined: Mon Feb 28, 2011 12:58 pm
Location: Bucharest
Contact:

Re: Crius GPS and I2C_GPS_NAV

Post by dramida »

It shouldn't be any difference in precision since the gps offers the same data in different formats (NMEA or binary) I also noticed that NMEA protocol has a resolution of about 5 cm witch is enough for a gps with 2 m acuracy according to documentation.
Anyway, i am using an Mega 2560 based controller with serial ports, is binary protocol implemented in Multiwii trunk? Moreover, how can i configure the Ublox GPS neo 6M at startup in multiwii for 38400 baud, 5Hz, NEMEA?
Need some help in configuring Ublox gps at startup in multiwii, as i am not a programmer. Meantime i'll solder a backup battery on RCtimer GPS to keep its config long enough to make some flight tests.

User avatar
EOSBandi
Posts: 802
Joined: Sun Jun 19, 2011 11:32 am
Location: Budapest, Hungary
Contact:

Re: Crius GPS and I2C_GPS_NAV

Post by EOSBandi »

dramida wrote:It shouldn't be any difference in precision since the gps offers the same data in different formats (NMEA or binary) I also noticed that NMEA protocol has a resolution of about 5 cm witch is enough for a gps with 2 m acuracy according to documentation.
Anyway, i am using an Mega 2560 based controller with serial ports, is binary protocol implemented in Multiwii trunk? Moreover, how can i configure the Ublox GPS neo 6M at startup in multiwii for 38400 baud, 5Hz, NEMEA?
Need some help in configuring Ublox gps at startup in multiwii, as i am not a programmer. Meantime i'll solder a backup battery on RCtimer GPS to keep its config long enough to make some flight tests.


The rationale behind using binary gps output is the elevated precision. The NMEA protocol outputs position data which has a limit of precision of 0.0001 minutes which is between 18cm and 36cm (depending on the location) a this cause twitching since the nav algorithm will try to compensate for these small jumps. Binary protocols has sub cm resolution which can be used for smooth poshold and rth. (It is not precision but resolution. A commonly used GPS receiver has about 2meters precision, and usually wanders around the current position.)

User avatar
dramida
Posts: 473
Joined: Mon Feb 28, 2011 12:58 pm
Location: Bucharest
Contact:

Re: Crius GPS and I2C_GPS_NAV

Post by dramida »

Thank you for better explaining the beneffits of using GPS binary protocol. I think this is a theoretical improvement as i saw no twitches in pos hold. Another thing witch comes in mind about binary protocol: If binary protocol is used, you can't use the same gps for OSD (remzibi)

Meanwhile i am still trying to use Ublox neo 6M gps on Multiwii Mega without any success. The GPS is loosing settings and there is no startup configuration procedure in Multiwii. Is anyone using Ublox on Mega boards? How? I need a pice of software to configure the GPS at startup.

mysku82
Posts: 17
Joined: Wed Oct 12, 2011 7:32 am
Location: Bucharest, Romania
Contact:

Re: Crius GPS and I2C_GPS_NAV

Post by mysku82 »

Hello
Who can update the file "I2C_GPS_NAV.ino", with the changes?
I'm not good at programming, I did strap on pin 13/14 and I do not show GPS data in GUI

Thanks

pm1
Posts: 136
Joined: Sun Jan 22, 2012 7:26 pm

Re: Crius GPS and I2C_GPS_NAV

Post by pm1 »

I have the Neo-6m running at 115200 baud and 10 Hz. The steps I had to do (rctimer gps+i2c board):

1. Solder pin 13+14 of neo6-m together -> (baudrate to 38400)
2. use arduino 1.0 + eosbandi's path for twi.c and twi.h (1.01 didn't work for me for some reason, if twi patch applied or not)
3. activate #define UBLOX on i2c board
4. Flash i2c board with the initialization sequence below
5. activate #define I2C_GPS in multiwii 2.1

Code: Select all

setup() {

  delay(3000);      //lets some time to GPS module to init
  Serial.begin(38400);
 
  //set GPS dynamic platform to "pedestrian"
  PROGMEM prog_uchar conf2[]={0xB5, 0x62, 0x06, 0x24, 0x24, 0x00, 0xFF, 0xFF, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x10, 0x27, 0x00, 0x00, 0x05, 0x00, 0xFA, 0x00, 0xFA, 0x00, 0x64, 0x00, 0x2C, 0x01, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4F, 0x82};
  Serial.write (conf2,sizeof(conf2));                                                                                 
  delay(300);

  //disable all default NMEA messages
  PROGMEM prog_uchar conf3[]={0xB5, 0x62, 0x06, 0x01, 0x03, 0x00, 0xF0, 0x05, 0x00, 0xFF, 0x19};
  Serial.write (conf3,sizeof(conf3));
  delay(100);
  PROGMEM prog_uchar conf5[]={0xB5, 0x62, 0x06, 0x01, 0x03, 0x00, 0xF0, 0x03, 0x00, 0xFD, 0x15};
  Serial.write (conf5,sizeof(conf5));
  delay(100);
  PROGMEM prog_uchar conf6[]={0xB5, 0x62, 0x06, 0x01, 0x03, 0x00, 0xF0, 0x01, 0x00, 0xFB, 0x11};
  Serial.write (conf6,sizeof(conf6));
  delay(100);
  PROGMEM prog_uchar conf7[]={0xB5, 0x62, 0x06, 0x01, 0x03, 0x00, 0xF0, 0x00, 0x00, 0xFA, 0x0F};
  Serial.write (conf7,sizeof(conf7));
  delay(100);
  PROGMEM prog_uchar conf8[]={0xB5, 0x62, 0x06, 0x01, 0x03, 0x00, 0xF0, 0x02, 0x00, 0xFC, 0x13};
  Serial.write (conf8,sizeof(conf8));
  delay(100);
  PROGMEM prog_uchar conf9[]={0xB5, 0x62, 0x06, 0x01, 0x03, 0x00, 0xF0, 0x04, 0x00, 0xFE, 0x17};     
  Serial.write (conf9,sizeof(conf9));
  delay(100);


  //enable UBX messages POSLLH, SOL, STATUS and VELNED as is in EOSBandi's config file
  PROGMEM prog_uchar conf10[]={0xB5, 0x62, 0x06, 0x01, 0x03, 0x00, 0x01, 0x02, 0x01, 0x0E, 0x47};
  Serial.write (conf10,sizeof(conf10));
  delay(100);
    PROGMEM prog_uchar conf11[]={0xB5, 0x62, 0x06, 0x01, 0x03, 0x00, 0x01, 0x03, 0x01, 0x0F, 0x49};
  Serial.write (conf11,sizeof(conf11));
  delay(100);
  PROGMEM prog_uchar conf12[]={0xB5, 0x62, 0x06, 0x01, 0x03, 0x00, 0x01, 0x06, 0x01, 0x12, 0x4F};
  Serial.write (conf12,sizeof(conf12));
  delay(100);
  PROGMEM prog_uchar conf13[]={0xB5, 0x62, 0x06, 0x01, 0x03, 0x00, 0x01, 0x12, 0x01, 0x1E, 0x67};
  Serial.write (conf13,sizeof(conf13));
  delay(100);

  // set rate to 10 Hz
  PROGMEM prog_uchar conf16[]={0xB5,0x62,0x06,0x08,0x06,0x00,0x64,0x00,0x01,0x00,0x01,0x00,0x7A,0x12};
  Serial.write (conf16,sizeof(conf16));
  delay(100);

  // port speed to 115200
  PROGMEM prog_uchar conf1[]={0xB5, 0x62, 0x06, 0x00, 0x14, 0x00, 0x01, 0x00, 0x00, 0x00, 0xD0, 0x08, 0x00, 0x00, 0x00, 0xC2, 0x01, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC4, 0x96};

  Serial.write (conf1, sizeof(conf1));     
  delay(500);
  Serial.end();
  Serial.begin(115200);
  delay(100);

  while (Serial.available()) Serial.read();

User avatar
brettwal
Posts: 93
Joined: Mon Jun 18, 2012 4:51 pm
Location: Louisiana

Re: Crius GPS and I2C_GPS_NAV

Post by brettwal »

Why solder pins just to set the baudrate to 38400 if we know the default baudrate is 9600? Does soldering the pins set some other parameter? If not, why not just use the commands to change from 9600 to whatever baudrate we need?

pm1
Posts: 136
Joined: Sun Jan 22, 2012 7:26 pm

Re: Crius GPS and I2C_GPS_NAV

Post by pm1 »

It's not neccessary, you are right. But that was my first try: running at 38400 and ublox binary at 5 Hz. The only reason, why it might be neccesary is, that some people claimed, that the neo6-m often doesn't initialize correctly without the short of pin13+14. Nevertheless, too much effort to remove the solder ;)

WildFire
Posts: 1
Joined: Tue Aug 14, 2012 9:17 pm

Re: Crius GPS and I2C_GPS_NAV

Post by WildFire »

this guide works perfectly, thanks alot

Ausi1972
Posts: 17
Joined: Sat Apr 14, 2012 9:03 pm

Re: Crius GPS and I2C_GPS_NAV

Post by Ausi1972 »

pm1 wrote:I have the Neo-6m running at 115200 baud and 10 Hz. The steps I had to do (rctimer gps+i2c board):

1. Solder pin 13+14 of neo6-m together -> (baudrate to 38400)
2. use arduino 1.0 + eosbandi's path for twi.c and twi.h (1.01 didn't work for me for some reason, if twi patch applied or not)
3. activate #define UBLOX on i2c board
4. Flash i2c board with the initialization sequence below
5. activate #define I2C_GPS in multiwii 2.1

Code: Select all

setup() {

  delay(3000);      //lets some time to GPS module to init
  Serial.begin(38400);
 
  //set GPS dynamic platform to "pedestrian"
  PROGMEM prog_uchar conf2[]={0xB5, 0x62, 0x06, 0x24, 0x24, 0x00, 0xFF, 0xFF, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x10, 0x27, 0x00, 0x00, 0x05, 0x00, 0xFA, 0x00, 0xFA, 0x00, 0x64, 0x00, 0x2C, 0x01, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4F, 0x82};
  Serial.write (conf2,sizeof(conf2));                                                                                 
  delay(300);

  //disable all default NMEA messages
  PROGMEM prog_uchar conf3[]={0xB5, 0x62, 0x06, 0x01, 0x03, 0x00, 0xF0, 0x05, 0x00, 0xFF, 0x19};
  Serial.write (conf3,sizeof(conf3));
  delay(100);
  PROGMEM prog_uchar conf5[]={0xB5, 0x62, 0x06, 0x01, 0x03, 0x00, 0xF0, 0x03, 0x00, 0xFD, 0x15};
  Serial.write (conf5,sizeof(conf5));
  delay(100);
  PROGMEM prog_uchar conf6[]={0xB5, 0x62, 0x06, 0x01, 0x03, 0x00, 0xF0, 0x01, 0x00, 0xFB, 0x11};
  Serial.write (conf6,sizeof(conf6));
  delay(100);
  PROGMEM prog_uchar conf7[]={0xB5, 0x62, 0x06, 0x01, 0x03, 0x00, 0xF0, 0x00, 0x00, 0xFA, 0x0F};
  Serial.write (conf7,sizeof(conf7));
  delay(100);
  PROGMEM prog_uchar conf8[]={0xB5, 0x62, 0x06, 0x01, 0x03, 0x00, 0xF0, 0x02, 0x00, 0xFC, 0x13};
  Serial.write (conf8,sizeof(conf8));
  delay(100);
  PROGMEM prog_uchar conf9[]={0xB5, 0x62, 0x06, 0x01, 0x03, 0x00, 0xF0, 0x04, 0x00, 0xFE, 0x17};     
  Serial.write (conf9,sizeof(conf9));
  delay(100);


  //enable UBX messages POSLLH, SOL, STATUS and VELNED as is in EOSBandi's config file
  PROGMEM prog_uchar conf10[]={0xB5, 0x62, 0x06, 0x01, 0x03, 0x00, 0x01, 0x02, 0x01, 0x0E, 0x47};
  Serial.write (conf10,sizeof(conf10));
  delay(100);
    PROGMEM prog_uchar conf11[]={0xB5, 0x62, 0x06, 0x01, 0x03, 0x00, 0x01, 0x03, 0x01, 0x0F, 0x49};
  Serial.write (conf11,sizeof(conf11));
  delay(100);
  PROGMEM prog_uchar conf12[]={0xB5, 0x62, 0x06, 0x01, 0x03, 0x00, 0x01, 0x06, 0x01, 0x12, 0x4F};
  Serial.write (conf12,sizeof(conf12));
  delay(100);
  PROGMEM prog_uchar conf13[]={0xB5, 0x62, 0x06, 0x01, 0x03, 0x00, 0x01, 0x12, 0x01, 0x1E, 0x67};
  Serial.write (conf13,sizeof(conf13));
  delay(100);

  // set rate to 10 Hz
  PROGMEM prog_uchar conf16[]={0xB5,0x62,0x06,0x08,0x06,0x00,0x64,0x00,0x01,0x00,0x01,0x00,0x7A,0x12};
  Serial.write (conf16,sizeof(conf16));
  delay(100);

  // port speed to 115200
  PROGMEM prog_uchar conf1[]={0xB5, 0x62, 0x06, 0x00, 0x14, 0x00, 0x01, 0x00, 0x00, 0x00, 0xD0, 0x08, 0x00, 0x00, 0x00, 0xC2, 0x01, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC4, 0x96};

  Serial.write (conf1, sizeof(conf1));     
  delay(500);
  Serial.end();
  Serial.begin(115200);
  delay(100);

  while (Serial.available()) Serial.read();


Is the file to download?
I2c gps nav v2.1 rc2 (Wire lib issue fixed) from here: http://code.google.com/p/i2c-gps-nav/downloads/list

Then does the patch go in? I2C_GPS_NAV.ino

Candu1
Posts: 5
Joined: Mon May 07, 2012 4:05 am

Re: Crius GPS and I2C_GPS_NAV

Post by Candu1 »

A couple of quick question:

If I complete the HW and SW mod in post 1, I don't need to manually config the GPS itself, right?

When the system is working properly, what are the correct LED flashing sequence for the GPS and I2C board during and after power initiation?

pm1
Posts: 136
Joined: Sun Jan 22, 2012 7:26 pm

Re: Crius GPS and I2C_GPS_NAV

Post by pm1 »

Candu1 wrote:A couple of quick question:
If I complete the HW and SW mod in post 1, I don't need to manually config the GPS itself, right?

right

Candu1 wrote:When the system is working properly, what are the correct LED flashing sequence for the GPS and I2C board during and after power initiation?


After power on, the I2C boards starts blinking slowly (1s/1s). If it get' s a GPS fix, it flashed 2 or 3 times with 1 s pause to indicate 2D/3D fix. The GPS itself has only a power led.

pm1
Posts: 136
Joined: Sun Jan 22, 2012 7:26 pm

Re: Crius GPS and I2C_GPS_NAV

Post by pm1 »

Ok, here a updated, simplified recipe how I did get this combination to work:

1. Download this version of i2c_nav : Download
2. solder a bridge between pin 13+34 of gps board (picture included in download)
3. use arduino 1.01 to flash i2c_nav with downloaded version
4. update fc multiwii 2.1 with activated #define I2C_GPS in config.h
5. connect everything
6 go *outside*
7. connect battery -> after about one minute (depending on reception quality), the led on i2c board start flashing 3 times in intervals
8. it works!

trex450
Posts: 3
Joined: Mon Jun 04, 2012 12:16 am

Re: Crius GPS and I2C_GPS_NAV

Post by trex450 »

Can you also post the PIDs you used ? just to get an idea of where it should be..

Pby11
Posts: 2
Joined: Sun Aug 26, 2012 9:12 am

Re: Crius GPS and I2C_GPS_NAV

Post by Pby11 »

pm1 wrote:Ok, here a updated, simplified recipe how I did get this combination to work:

1. Download this version of i2c_nav : Download
2. solder a bridge between pin 13+34 of gps board (picture included in download)
3. use arduino 1.01 to flash i2c_nav with downloaded version
4. update fc multiwii 2.1 with activated #define I2C_GPS in config.h
5. connect everything
6 go *outside*
7. connect battery -> after about one minute (depending on reception quality), the led on i2c board start flashing 3 times in intervals
8. it works!

My hw is:
Crius Multiwii SE+crius i2c-gps nav module +CN-06 GPS receiver.
With I2C_GPS_NAV_latest, I get a lot of errors, I used arduino-1.0.1:


I2C_GPS_NAV\twiMW.c.o: In function `twi_setAddress':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/twiMW.c:96: multiple definition of `twi_setAddress'
twiMW.c.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/twiMW.c:96: first defined here
I2C_GPS_NAV\twiMW.c.o: In function `twi_readFrom':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/twiMW.c:109: multiple definition of `twi_readFrom'
twiMW.c.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/twiMW.c:109: first defined here
I2C_GPS_NAV\twiMW.c.o: In function `twi_writeTo':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/twiMW.c:172: multiple definition of `twi_writeTo'
twiMW.c.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/twiMW.c:172: first defined here
I2C_GPS_NAV\twiMW.c.o: In function `twi_transmit':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/twiMW.c:230: multiple definition of `twi_transmit'
twiMW.c.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/twiMW.c:230: first defined here
I2C_GPS_NAV\twiMW.c.o: In function `twi_attachSlaveRxEvent':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/twiMW.c:260: multiple definition of `twi_attachSlaveRxEvent'
twiMW.c.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/twiMW.c:260: first defined here
I2C_GPS_NAV\twiMW.c.o: In function `twi_attachSlaveTxEvent':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/twiMW.c:271: multiple definition of `twi_attachSlaveTxEvent'
twiMW.c.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/twiMW.c:271: first defined here
I2C_GPS_NAV\twiMW.c.o: In function `twi_reply':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/twiMW.c:283: multiple definition of `twi_reply'
twiMW.c.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/twiMW.c:283: first defined here
I2C_GPS_NAV\twiMW.c.o: In function `twi_stop':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/twiMW.c:299: multiple definition of `twi_stop'
twiMW.c.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/twiMW.c:299: first defined here
I2C_GPS_NAV\twiMW.c.o: In function `twi_stop_slv':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/twiMW.c:319: multiple definition of `twi_stop_slv'
twiMW.c.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/twiMW.c:319: first defined here
I2C_GPS_NAV\twiMW.c.o: In function `twi_releaseBus':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/twiMW.c:334: multiple definition of `twi_releaseBus'
twiMW.c.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/twiMW.c:334: first defined here
I2C_GPS_NAV\twiMW.c.o: In function `__vector_24':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/twiMW.c:341: multiple definition of `__vector_24'
twiMW.c.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/twiMW.c:341: first defined here
I2C_GPS_NAV\twiMW.c.o: In function `twi_init':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/twiMW.c:67: multiple definition of `twi_init'
twiMW.c.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/twiMW.c:67: first defined here
I2C_GPS_NAV\LeadFilter.cpp.o: In function `LeadFilter::get_position(long, int)':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/LeadFilter.cpp:15: multiple definition of `LeadFilter::get_position(long, int)'
LeadFilter.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/LeadFilter.cpp:15: first defined here
I2C_GPS_NAV\PICtrl.cpp.o: In function `PICtrl::get_p(long)':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/PICtrl.cpp:4: multiple definition of `PICtrl::get_p(long)'
PICtrl.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/PICtrl.cpp:4: first defined here
I2C_GPS_NAV\PICtrl.cpp.o: In function `PICtrl::get_i(long, float)':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/PICtrl.cpp:9: multiple definition of `PICtrl::get_i(long, float)'
PICtrl.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/PICtrl.cpp:9: first defined here
I2C_GPS_NAV\PICtrl.cpp.o: In function `PICtrl::get_pi(long, float)':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/PICtrl.cpp:23: multiple definition of `PICtrl::get_pi(long, float)'
PICtrl.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/PICtrl.cpp:23: first defined here
I2C_GPS_NAV\PICtrl.cpp.o: In function `PICtrl::reset_I()':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/PICtrl.cpp:31: multiple definition of `PICtrl::reset_I()'
PICtrl.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/PICtrl.cpp:31: first defined here
I2C_GPS_NAV\PIDCtrl.cpp.o: In function `PIDCtrl::get_p(long)':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/PIDCtrl.cpp:4: multiple definition of `PIDCtrl::get_p(long)'
PIDCtrl.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/PIDCtrl.cpp:4: first defined here
I2C_GPS_NAV\PIDCtrl.cpp.o: In function `PIDCtrl::get_i(long, float)':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/PIDCtrl.cpp:9: multiple definition of `PIDCtrl::get_i(long, float)'
PIDCtrl.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/PIDCtrl.cpp:9: first defined here
I2C_GPS_NAV\PIDCtrl.cpp.o: In function `PIDCtrl::get_d(long, float)':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/PIDCtrl.cpp:23: multiple definition of `PIDCtrl::get_d(long, float)'
PIDCtrl.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/PIDCtrl.cpp:23: first defined here
I2C_GPS_NAV\PIDCtrl.cpp.o: In function `PIDCtrl::get_pi(long, float)':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/PIDCtrl.cpp:43: multiple definition of `PIDCtrl::get_pi(long, float)'
PIDCtrl.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/PIDCtrl.cpp:43: first defined here
I2C_GPS_NAV\PIDCtrl.cpp.o: In function `PIDCtrl::get_pid(long, float)':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/PIDCtrl.cpp:49: multiple definition of `PIDCtrl::get_pid(long, float)'
PIDCtrl.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/PIDCtrl.cpp:49: first defined here
I2C_GPS_NAV\PIDCtrl.cpp.o: In function `PIDCtrl::reset_I()':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/PIDCtrl.cpp:55: multiple definition of `PIDCtrl::reset_I()'
PIDCtrl.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/PIDCtrl.cpp:55: first defined here
I2C_GPS_NAV\WireMW.cpp.o: In function `TwoWire':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/WireMW.cpp:46: multiple definition of `TwoWire::TwoWire()'
WireMW.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/WireMW.cpp:46: first defined here
I2C_GPS_NAV\WireMW.cpp.o: In function `TwoWire':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/WireMW.cpp:46: multiple definition of `TwoWire::TwoWire()'
WireMW.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/WireMW.cpp:46: first defined here
I2C_GPS_NAV\WireMW.cpp.o: In function `TwoWire::beginTransmission(unsigned char)':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/WireMW.cpp:99: multiple definition of `TwoWire::beginTransmission(unsigned char)'
WireMW.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/WireMW.cpp:99: first defined here
I2C_GPS_NAV\WireMW.cpp.o: In function `TwoWire':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/WireMW.cpp:46: multiple definition of `TwoWire::transmitting'
WireMW.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/WireMW.cpp:46: first defined here
I2C_GPS_NAV\WireMW.cpp.o: In function `TwoWire':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/WireMW.cpp:46: multiple definition of `TwoWire::txAddress'
WireMW.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/WireMW.cpp:46: first defined here
I2C_GPS_NAV\WireMW.cpp.o: In function `TwoWire':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/WireMW.cpp:46: multiple definition of `TwoWire::txBufferIndex'
WireMW.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/WireMW.cpp:46: first defined here
I2C_GPS_NAV\WireMW.cpp.o: In function `TwoWire':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/WireMW.cpp:46: multiple definition of `TwoWire::txBufferLength'
WireMW.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/WireMW.cpp:46: first defined here
I2C_GPS_NAV\WireMW.cpp.o: In function `TwoWire::beginTransmission(unsigned char)':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/WireMW.cpp:99: multiple definition of `TwoWire::beginTransmission(int)'
WireMW.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/WireMW.cpp:99: first defined here
I2C_GPS_NAV\WireMW.cpp.o: In function `TwoWire::available()':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/WireMW.cpp:170: multiple definition of `TwoWire::available()'
WireMW.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/WireMW.cpp:170: first defined here
I2C_GPS_NAV\WireMW.cpp.o: In function `TwoWire':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/WireMW.cpp:46: multiple definition of `TwoWire::rxBufferLength'
WireMW.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/WireMW.cpp:46: first defined here
I2C_GPS_NAV\WireMW.cpp.o: In function `TwoWire':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/WireMW.cpp:46: multiple definition of `TwoWire::rxBufferIndex'
WireMW.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/WireMW.cpp:46: first defined here
I2C_GPS_NAV\WireMW.cpp.o: In function `TwoWire::read()':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/WireMW.cpp:183: multiple definition of `TwoWire::read()'
WireMW.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/WireMW.cpp:183: first defined here
I2C_GPS_NAV\WireMW.cpp.o: In function `TwoWire':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/WireMW.cpp:46: multiple definition of `TwoWire::rxBuffer'
WireMW.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/WireMW.cpp:46: first defined here
I2C_GPS_NAV\WireMW.cpp.o: In function `TwoWire::peek()':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/WireMW.cpp:198: multiple definition of `TwoWire::peek()'
WireMW.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/WireMW.cpp:198: first defined here
I2C_GPS_NAV\WireMW.cpp.o: In function `TwoWire::flush()':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/WireMW.cpp:208: multiple definition of `TwoWire::flush()'
WireMW.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/WireMW.cpp:208: first defined here
I2C_GPS_NAV\WireMW.cpp.o: In function `TwoWire::onReceiveService(unsigned char*, int)':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/WireMW.cpp:211: multiple definition of `TwoWire::onReceiveService(unsigned char*, int)'
WireMW.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/WireMW.cpp:211: first defined here
I2C_GPS_NAV\WireMW.cpp.o: In function `TwoWire':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/WireMW.cpp:46: multiple definition of `TwoWire::user_onReceive'
WireMW.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/WireMW.cpp:46: first defined here
I2C_GPS_NAV\WireMW.cpp.o: In function `TwoWire::onRequestService()':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/WireMW.cpp:239: multiple definition of `TwoWire::onRequestService()'
WireMW.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/WireMW.cpp:239: first defined here
I2C_GPS_NAV\WireMW.cpp.o: In function `TwoWire':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/WireMW.cpp:46: multiple definition of `TwoWire::user_onRequest'
WireMW.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/WireMW.cpp:46: first defined here
I2C_GPS_NAV\WireMW.cpp.o: In function `TwoWire::onReceive(void (*)(int))':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/WireMW.cpp:253: multiple definition of `TwoWire::onReceive(void (*)(int))'
WireMW.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/WireMW.cpp:253: first defined here
I2C_GPS_NAV\WireMW.cpp.o: In function `TwoWire::onRequest(void (*)())':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/WireMW.cpp:259: multiple definition of `TwoWire::onRequest(void (*)())'
WireMW.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/WireMW.cpp:259: first defined here
I2C_GPS_NAV\WireMW.cpp.o: In function `TwoWire':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/WireMW.cpp:46: multiple definition of `Wire'
WireMW.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/WireMW.cpp:46: first defined here
I2C_GPS_NAV\WireMW.cpp.o: In function `TwoWire::write(unsigned char const*, unsigned int)':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/WireMW.cpp:152: multiple definition of `TwoWire::write(unsigned char const*, unsigned int)'
WireMW.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/WireMW.cpp:152: first defined here
I2C_GPS_NAV\WireMW.cpp.o: In function `TwoWire::write(unsigned char)':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/WireMW.cpp:127: multiple definition of `TwoWire::write(unsigned char)'
WireMW.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/WireMW.cpp:127: first defined here
I2C_GPS_NAV\WireMW.cpp.o: In function `TwoWire':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/WireMW.cpp:46: multiple definition of `TwoWire::txBuffer'
WireMW.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/WireMW.cpp:46: first defined here
I2C_GPS_NAV\WireMW.cpp.o: In function `TwoWire::endTransmission()':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/WireMW.cpp:115: multiple definition of `TwoWire::endTransmission()'
WireMW.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/WireMW.cpp:115: first defined here
I2C_GPS_NAV\WireMW.cpp.o: In function `TwoWire::requestFrom(unsigned char, unsigned char)':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/WireMW.cpp:83: multiple definition of `TwoWire::requestFrom(unsigned char, unsigned char)'
WireMW.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/WireMW.cpp:83: first defined here
I2C_GPS_NAV\WireMW.cpp.o: In function `TwoWire::requestFrom(int, int)':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/WireMW.cpp:93: multiple definition of `TwoWire::requestFrom(int, int)'
WireMW.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/WireMW.cpp:93: first defined here
I2C_GPS_NAV\WireMW.cpp.o: In function `TwoWire::begin()':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/WireMW.cpp:54: multiple definition of `TwoWire::begin()'
WireMW.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/WireMW.cpp:54: first defined here
I2C_GPS_NAV\WireMW.cpp.o: In function `TwoWire::begin(unsigned char)':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/WireMW.cpp:63: multiple definition of `TwoWire::begin(unsigned char)'
WireMW.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/WireMW.cpp:63: first defined here
I2C_GPS_NAV\WireMW.cpp.o: In function `TwoWire::begin(int)':
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/WireMW.cpp:73: multiple definition of `TwoWire::begin(int)'
WireMW.cpp.o:C:\Users\Helge\AppData\Local\Temp\build3750026297571771979.tmp/WireMW.cpp:73: first defined here

pm1
Posts: 136
Joined: Sun Jan 22, 2012 7:26 pm

Re: Crius GPS and I2C_GPS_NAV

Post by pm1 »

Pby11 wrote:With I2C_GPS_NAV_latest, I get a lot of errors, I used arduino-1.0.1:
...
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/twiMW.c:96


It look like as if you copied for some reason the I2C_GPS_NAV somewhere to the arduino library folder. Delete it there and put it somewhere else on the hard disk,

Pby11
Posts: 2
Joined: Sun Aug 26, 2012 9:12 am

Re: Crius GPS and I2C_GPS_NAV

Post by Pby11 »

pm1 wrote:
Pby11 wrote:With I2C_GPS_NAV_latest, I get a lot of errors, I used arduino-1.0.1:
...
C:\Users\Helge\Downloads\arduino-1.0.1-windows\arduino-1.0.1\libraries\I2C_GPS_NAV/twiMW.c:96


It look like as if you copied for some reason the I2C_GPS_NAV somewhere to the arduino library folder. Delete it there and put it somewhere else on the hard disk,


Stupid me.
The first contact with the Arduino. :?
Thanks for the help pm1, and everyone else here in the forum. Everything seems to work. :)

scanman
Posts: 74
Joined: Thu Jun 21, 2012 9:26 am
Location: Durban, South Africa
Contact:

Re: Crius GPS and I2C_GPS_NAV

Post by scanman »

pm1 wrote:Ok, here a updated, simplified recipe how I did get this combination to work:
.......
8. it works!


Hey PM1, once again thanks a lot for helping out. my i2c nav board stopped getting a fix after some heavey crashes on the weekend and so i uploaded your code , did the solder thing and now it works! Thanks a lot.

By the way, instead of waiting for 2 seconds after the i2c board boots, why not flash the indicator light to show us something is happening, and that its your code not the original code, also , it would be nice to have some flashing light every few seconds to indicate that data has been received from the ublox , even if its not a fix, that way we can know if we have the correct serial port settings.


//blink a few times //lets some time to GPS module to init
for (i=0;i<20;i++) {
digitalWrite(13, HIGH); // set the LED on
delay(100);
digitalWrite(13, LOW); // set the LED off
delay(100);
}
digitalWrite(13, HIGH); // set the LED on

pm1
Posts: 136
Joined: Sun Jan 22, 2012 7:26 pm

Re: Crius GPS and I2C_GPS_NAV

Post by pm1 »

trex450 wrote:Can you also post the PIDs you used ? just to get an idea of where it should be..

... screenshot in the download...

rortega2
Posts: 4
Joined: Wed Aug 29, 2012 8:49 pm

Re: Crius GPS and I2C_GPS_NAV

Post by rortega2 »

pm1 wrote:I have the Neo-6m running at 115200 baud and 10 Hz. The steps I had to do (rctimer gps+i2c board):

1. Solder pin 13+14 of neo6-m together -> (baudrate to 38400)
2. use arduino 1.0 + eosbandi's path for twi.c and twi.h (1.01 didn't work for me for some reason, if twi patch applied or not)
3. activate #define UBLOX on i2c board
4. Flash i2c board with the initialization sequence below
5. activate #define I2C_GPS in multiwii 2.1

Code: Select all

setup() {

  delay(3000);      //lets some time to GPS module to init
  Serial.begin(38400);
 
  //set GPS dynamic platform to "pedestrian"
  PROGMEM prog_uchar conf2[]={0xB5, 0x62, 0x06, 0x24, 0x24, 0x00, 0xFF, 0xFF, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x10, 0x27, 0x00, 0x00, 0x05, 0x00, 0xFA, 0x00, 0xFA, 0x00,

....
....
....   
  delay(500);
  Serial.end();
  Serial.begin(115200);
  delay(100);

  while (Serial.available()) Serial.read();


Hi all, this is the first time I participate but I folow the forum since a year...(I've built my quadx from scratch and I'm using Multiwii 2.1) :)

Some days ago, I bought one GPS CRIUS CN-6 (UBLOX NEO-6M-0-001) and I try to connect it throught I2C bus connecting an ARDUINO UNO board to comunicate with the flight control board that I designed and built by myself. The ARDUINO UNO is running I2C_NAV sketch with your patch, but with some diferences:

    in void setup() I start at 9600 bauds becaus it's the default in my gps and I don't want to solder the pins.
    I put the GPS update frecuency at 5hz, I belive that my GPS doesn`t support 10hz, but not sure
    I put the GPS UART1 for working at 38400 bauds

I've tested it and after starting de ARDUINO UNO the I2C NAV configures the GPS. If I test the GPS with u-center y see the UBX messages as desired and gives the possition, bla, bla, ... By now every thing ok. But for some reason that I don't know, the led in the ARDUINO UNO alwais blinks during half second on and half second off, and NO GPS Fix is reported to the flight controller. I monitor it through bluetooth with Android Multiwii All In One and there are none I2C errors.

Som days ago with a friend we tested a direrent GPS (not from CRIUS) using I2C NAV loaded in a seeduino as I2C slave connecte to the same quadx (mine). The GPS also had a UBLOX NEO-6M-0-001 but in diferent pcb. In this case we used EOS Bandi patch and it worked perfectly, but that code with my CRIUS GPS doesn't work.

By the moment I only can do somthing with success using yor code with my modifications, as I told, I can configure the GPS from I2C_NAV sketch but it dosent' report GPS FIX to the flight controller.

One of the images shows the UBX messages that mi GPS report after configured. ¿Do yo see if something is missing?
The other two shows both sides of my new CRIUS GPS.
Thanks
ubx-messages.png

IMAG1615.jpg

IMAG1616.jpg
Attachments
ubx-messages.png

pm1
Posts: 136
Joined: Sun Jan 22, 2012 7:26 pm

Re: Crius GPS and I2C_GPS_NAV

Post by pm1 »

Hi,
you seem to have exactly the same board as me. The data in u-center is looking fine.
When I tried to get it to work, I had to fiddle around with the delays for unknown reason. Maybe give that a try. I tried to move the change of baud rate to the beginning -> no success. I can confirm, that my neo6-m works definitely at 10 Hz, I mesaured the time between consecutive gps_new_data in a debug variable, and it show around 100 ms. When I configured 5 Hz, it was around 200 ms as expected. Btw. you are using arduino 1.01?

rortega2
Posts: 4
Joined: Wed Aug 29, 2012 8:49 pm

Re: Crius GPS and I2C_GPS_NAV

Post by rortega2 »

The problem was in a wire bad connected in the arduino during the test. Now every thing works nice and I can see gps data on the Android Multiwii All In One.
Next steep is to try GPS HOLD and GPS RETURN TO HOME while flying. Do you have any suggestion on the best way to test it to avoid crashes?

Thanks for your reply.

pm1
Posts: 136
Joined: Sun Jan 22, 2012 7:26 pm

Re: Crius GPS and I2C_GPS_NAV

Post by pm1 »

Start only with PH. I hadn't very much luck with the orginal code. The parameters were very sensitive. I changed a few lines of code in the pos_hold routine (have a look in my download). After that, It's now solid as a rock, even in stronger wind.

Best regards

P.S. I changed the i2c_nav code (download link some posts before) now in that way, that without any valid reception from GPS it blinks slowly 1s/1s, if it gets valid frames even when no GPS fix is there, it blinks 100ms/1s. I think, that's good for diagnostics...

godwisper
Posts: 21
Joined: Thu Aug 23, 2012 6:35 pm

Re: Crius GPS and I2C_GPS_NAV

Post by godwisper »

Pm1 I have just bought the multiwii se V1 with gps...

Do I program your file into the crius SE board (FTDI) with the gps connected ?

Or do I need to connect the pc directly to the GPS or the nav board ??

Why short pins 13/14 ?

Sorry but am new to this....

This is my board:

Image
Last edited by godwisper on Mon Sep 03, 2012 11:07 am, edited 3 times in total.

rortega2
Posts: 4
Joined: Wed Aug 29, 2012 8:49 pm

Re: Crius GPS and I2C_GPS_NAV

Post by rortega2 »

pm1 wrote:Start only with PH. I hadn't very much luck with the orginal code. The parameters were very sensitive. I changed a few lines of code in the pos_hold routine (have a look in my download). After that, It's now solid as a rock, even in stronger wind.

Best regards

P.S. I changed the i2c_nav code (download link some posts before) now in that way, that without any valid reception from GPS it blinks slowly 1s/1s, if it gets valid frames even when no GPS fix is there, it blinks 100ms/1s. I think, that's good for diagnostics...


Thanks for your reply.


I haven't tested yet "posh hold" because of wind. I'll begin the tests with the original code, to which I and a friend have made some changes for controlling also the sonar. To avoid problems of lost GPS dataframe caused by continously requesting to the sonar for calculating the altitude value, we have used the arduino library NewPing. It works using interrupts and it helped us to resolved us the problem.

I've tested at indoor the sonar and it works very well, and I've monitored the GPS with Android Multiwii AllinOne and it seems to work well. I hope that it works while flying.

pm1
Posts: 136
Joined: Sun Jan 22, 2012 7:26 pm

Re: Crius GPS and I2C_GPS_NAV

Post by pm1 »

If you try the original code, be careful with the PIDs. It flew fine with no wind, and then had bad oszillations leading to a crash with some wind. Therefore I changed function GPS_calc_poshold to limit possible speed while only correcting position. Maybe have a look into that...

rortega2
Posts: 4
Joined: Wed Aug 29, 2012 8:49 pm

Re: Crius GPS and I2C_GPS_NAV

Post by rortega2 »

I've seen your changes, you've erased d factor and have constrained x and y targets speeds, it seems very simple but very much interesting. What could be an aproximation to the range of wind speed supported with your changes? Do you have any video link where I could see it in action for having a reference about the behavior which my quadx should have?. Thanks.

pm1
Posts: 136
Joined: Sun Jan 22, 2012 7:26 pm

Re: Crius GPS and I2C_GPS_NAV

Post by pm1 »

My changes only limit *speed over ground* while PH. It has no influence due to wind. So the limiting factors in wind is the maximum I term and max bank angle (30 degrees in my last version). I can't tell for real, where the limit is, but here were already some stronger wind gusts wirhout problem.

turbothief
Posts: 1
Joined: Thu Sep 20, 2012 6:49 pm

Re: Crius GPS and I2C_GPS_NAV

Post by turbothief »

godwisper wrote:Pm1 I have just bought the multiwii se V1 with gps...

Do I program your file into the crius SE board (FTDI) with the gps connected ?

Or do I need to connect the pc directly to the GPS or the nav board ??

Why short pins 13/14 ?

Sorry but am new to this....

This is my board:

Image


I also have tried several times with no success. I have tried and want to start all over. How to upload to gps the codes. Light on i2c board blinks 1 sec on/ 1 sec off.

godwisper
Posts: 21
Joined: Thu Aug 23, 2012 6:35 pm

Re: Crius GPS and I2C_GPS_NAV

Post by godwisper »

I have sorted out by replacing the gps...seems it got faulty most probably when I tried soldering the pins 13 and 14

cardboard
Posts: 183
Joined: Tue Mar 15, 2011 9:40 am

Re: Crius GPS and I2C_GPS_NAV

Post by cardboard »

I to have just started having issues with position hold (haven't dared tried RTH until Pos hold is working). When Pos hold is activated (along with baro and mag) the copter stays still for a few seconds then slowly starts to fly away until it reaches max gps nav speed by which time I turn off RTH to save a flyaway. It always seems to want to fly in the same direction in these cases, backwards/northish, not sure which one it really is as I fly from the same point all the time.
The very first time I used gps features it worked perfectly, I havn't used them in a while and just now it has gone weird. This has happened over 2 different days of flying as well.

Anyone like to have a guess as to what is causing this?

pm1
Posts: 136
Joined: Sun Jan 22, 2012 7:26 pm

Re: Crius GPS and I2C_GPS_NAV

Post by pm1 »

turbothief wrote:...
I also have tried several times with no success. I have tried and want to start all over. How to upload to gps the codes. Light on i2c board blinks 1 sec on/ 1 sec off.
...

I have here improved the recipe, how me and some others got it to work:
http://www.rcgroups.com/forums/showthread.php?t=1724694

pm1
Posts: 136
Joined: Sun Jan 22, 2012 7:26 pm

Re: Crius GPS and I2C_GPS_NAV

Post by pm1 »

cardboard wrote:...
Anyone like to have a guess as to what is causing this?


Some suggestion:
- check, if PIDs have changed
- calibrate MAG
- ensure MAG is activated

cardboard
Posts: 183
Joined: Tue Mar 15, 2011 9:40 am

Re: Crius GPS and I2C_GPS_NAV

Post by cardboard »

pm1 wrote:
cardboard wrote:...
Anyone like to have a guess as to what is causing this?


Some suggestion:
- check, if PIDs have changed
- calibrate MAG
- ensure MAG is activated


I do not believe Pids have changed but I may do a epprom clear before the next flight.
I will recalibrate the mag, I didn't think it could cause this much issue but I fly with heading hold on all the time and it seems to work
Mag is always activated whenever pos hold or rth are activated

cardboard
Posts: 183
Joined: Tue Mar 15, 2011 9:40 am

Re: Crius GPS and I2C_GPS_NAV

Post by cardboard »

Went out today on a dead clam day and I think I have figured out the issue.
If the copter has no velocity when pos hold is activated it works really well, but if the copter is moving when pos hold is activated it over corrects and misses the pos hold location by a huge margin and it only gets worse from then on. Basically needs the nav pids tuned in

pm1
Posts: 136
Joined: Sun Jan 22, 2012 7:26 pm

Re: Crius GPS and I2C_GPS_NAV

Post by pm1 »

Try my version: I had the same issues and changed the code...
http://www.rcgroups.com/forums/showthread.php?t=1724694

cardboard
Posts: 183
Joined: Tue Mar 15, 2011 9:40 am

Re: Crius GPS and I2C_GPS_NAV

Post by cardboard »

I was using an older version of that I do believe but I'll try the latest version next time I'm out
Thanx for the update :)

cardboard
Posts: 183
Joined: Tue Mar 15, 2011 9:40 am

Re: Crius GPS and I2C_GPS_NAV

Post by cardboard »

tested it out today, same issue using default pids, way overshooting and circling.
Using the Pids supplied in the gps folder it was allot better and only needed slight tuning to get a pretty good result.
Will continue to narrow done the pids.

MrDrone
Posts: 6
Joined: Wed Aug 29, 2012 4:13 am

Re: Crius GPS and I2C_GPS_NAV

Post by MrDrone »

Greetings,

Please help end my hair pulling (with tweezers) agony. I have downloaded I2C_GPS_NAV and have it displayed in Arduino 1.0.1. I have my USB connector attached to my I2C-GPS board and have selected the NANO /AT meg328 board. I would love to upload the sketch to the I2C-NAV board via the FTDI connector but it will not verify (compile?), and will not upload until it verifies. What's with this? Also, is this just to get the board working or to incorporate RTH and waypoints? OR - Is this sketch supposed to be one of the many tabs that open with my MultiWii.pde and, if so, how do I accomplish that?

I am not certain I understand this concept, although so many have explained it so many ways. I saw the patch to insert into the GPS code into my MultiWii.pde, as well. Will this take the place of my trying to upload data to the I2c-NAV module?

I appreciate the comprehensive step-by-step explanations but they are not dumbed-down enough for me, just yet.

Thank You One & All - Baran

MrDrone
Posts: 6
Joined: Wed Aug 29, 2012 4:13 am

Re: Crius GPS and I2C_GPS_NAV

Post by MrDrone »

Please, please, please . . . I have two questions not previously addressed here.

1) How do I "FLASH" my I2C-GPS board with Arduino? It is assumed that one just does this with no problems - not true! Yes, I have the FTDI connection but Arduino refuses to "verify" hence, refuses to" upload" the I2C_GPS_NAV.INO file. I tried loading it as a file to my existing MUltiWii sketch to no avail. When I try to flash/upload to my I2C-GPS, I just get errors in my arduino. Someone please tell me my error.

2) What are the MTK Firmware Tool for? I downloaded them from a page but, once again, it seems I needed to have been born with this knowledge in order to make use of it.

pm1
Posts: 136
Joined: Sun Jan 22, 2012 7:26 pm

Re: Crius GPS and I2C_GPS_NAV

Post by pm1 »

MrDrone wrote:Please, please, please . . . I have two questions not previously addressed here.

1) How do I "FLASH" my I2C-GPS board with Arduino? It is assumed that one just does this with no problems - not true! Yes, I have the FTDI connection but Arduino refuses to "verify" hence, refuses to" upload" the I2C_GPS_NAV.INO file. I tried loading it as a file to my existing MUltiWii sketch to no avail. When I try to flash/upload to my I2C-GPS, I just get errors in my arduino. Someone please tell me my error.


The whole I2C_GPS_NAV is an own sketch like Multiwii. It consist of about 10 files (I2C_GPS_NAV.ino, PICtrl.cpp, ...) They all have to be in a folder I2C_GPS_NAV. Then open I2C_GPS_NAV.INO and you can compile/upload the software...

MrDrone
Posts: 6
Joined: Wed Aug 29, 2012 4:13 am

Re: Crius GPS and I2C_GPS_NAV

Post by MrDrone »

Thank you pm! I just needed to re-subscribe to WinZip. As the main file was present before extraction, I was baffled. One step at a time - you advice was most valuable and appreciated.

Post Reply