princeriley / ardupilot-mega

Automatically exported from code.google.com/p/ardupilot-mega
0 stars 0 forks source link

Enhancement to Debug_Subsystem: GPS Subsystem, U-Center via Xbee #56

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Set DEBUG_SUBSYSTEM to GPS Raw output
2. reload
3. monitor gps output

What is the expected output? U-Center cant read Ublox data (over XBee 
Bidirectionaly)

What do you see instead? Data is not readable by U-Center with Hex output type.

What version of the product are you using? Alpha 103 SVN 715 
On what operating system? Win7

Please provide any additional information below.

I have modified the code in debug.h line 201 to use BYTE output type instead of 
HEX, now U-Center can see the uBlox data. 

The basic change is this...

        Serial.print(incoming,HEX); // will output Hex values
to this...

        Serial.print(incoming,BYTE); // will output Byte values

(also take out the comma on line 202)

I like to see what the sats are doing if im not getting lockup right away. 
So rather than lugging out the ftdi cable etc, I can now get the data using 
u-center to see whats going on.

Even with the different baud rates on the ports, 
(xbee@115.2kbps-vs-ublox@38.4kbps) I've successfully used Serial3 bidirectonly 
over the xbee's so I can modify ublox config as well using U-Center.. 

Here is the full code I put together for debug section 5. If others can confirm 
it works with no issues I would find it helpful to see it added to the SVN. 

#if DEBUG_SUBSYSTEM == 5
void debug_subsystem()
{
    Serial.println("Begin Debug: GPS Subsystem, U-Center via Xbee");

    while(1){
    // Incoming from UBLOX to U-Center
    if(Serial3.available()>0)//Ok, let me see, the buffer is empty?
    {
        delay(30);
        while(Serial3.available()>0){
        byte incoming = Serial3.read();
        Serial1.print(incoming,BYTE); // will output Byte values
        }
    }
        // and back again... U-Center to UBLOX
    if(Serial1.available()>0)//Ok, let me see, the buffer is empty?
    {
        delay(30);
        while(Serial1.available()>0){
        byte incoming = Serial1.read();
        Serial3.print(incoming,BYTE); // will output Byte values
        }
    }

        }
}
#endif

Original issue reported on code.google.com by Draconis...@gmail.com on 28 Aug 2010 at 2:18

GoogleCodeExporter commented 9 years ago
Changed to enhancement

Original comment by analogue...@gmail.com on 28 Aug 2010 at 2:34

GoogleCodeExporter commented 9 years ago
Won't this make it very specific to Ublox with Xbee?
Would like to implement it but I need to know the user requirements.

Original comment by jasonshort on 29 Aug 2010 at 6:04

GoogleCodeExporter commented 9 years ago
Won't this make it very specific to Ublox with Xbee?
Would like to implement it but I need to know the user requirements.

Original comment by jasonshort on 29 Aug 2010 at 6:04

GoogleCodeExporter commented 9 years ago
Actually, your probably right as I use a ublox currently; but I am going to be 
ordering an MTK soon. Not sure if there is software to watch the same type of 
data though. U-Center is a handy tool. But Yes, I'll have to research a bit if 
its cross platform. 

The only real change was setting BYTE format. However FYI I found some better 
code on the ardupilot wiki regarding reloading the ublox firmware. which 
appears much more compact to get the same job done... but this can drop to low 
priority.

{ 
if (Serial.available()) 
Serial1.write(Serial.read()); 
if (Serial1.available()) 
Serial.write(Serial1.read()); 
}

Original comment by Draconis...@gmail.com on 30 Aug 2010 at 2:26

GoogleCodeExporter commented 9 years ago
Jason, Your current mod on debug.h to BYTE did work and I can see the ublox 
data in ucenter. as well as the code above does indeed allow two way for ublox 
config changes. so here is what im using for two way communication with gps, 
nice and short and sweet. cant wait for the mtk to see if it too can do two way.

#if DEBUG_SUBSYSTEM == 5
void debug_subsystem()
{
    Serial.println("Begin Debug: GPS Subsystem, RAW OUTPUT");

    while(1){
              if (Serial3.available()) 
                    Serial1.write(Serial3.read()); 
              if (Serial1.available()) 
                    Serial3.write(Serial1.read()); 
        }
}
#endif

Original comment by Draconis...@gmail.com on 31 Aug 2010 at 2:31

GoogleCodeExporter commented 9 years ago
We can drop this one for now, the two way is working but intermittantly, and 
untill I can sort that out, I'd rather not keep it on the list.

Original comment by Draconis...@gmail.com on 1 Sep 2010 at 11:22

GoogleCodeExporter commented 9 years ago

Original comment by jasonshort on 28 Sep 2010 at 6:33

GoogleCodeExporter commented 9 years ago
Ok guys, this I've had a bit of time to work on this; and its now working 
great. 

UBLOX access in "rawgps" cli mode now works bidirectional over telemetry port. 

Here is the proposed change below. 

The output from ublox is now working over xbee with both u-center and 
HappyKillmore's GCS. 

U-Center is able to update configuration changes to the U-blox as well. 
(please note, the normal baud rates for gps/telemetry ports are not getting 
passed into test.pde correctly, so I've hard coded mine in APM_Config.h and 
made note of it here. I will figure out why but for now, its better set then 
unset :)

I will update the svn tomorrow if none object.

---------
static int8_t
test_rawgps(uint8_t argc, const Menu::arg *argv)
{
    print_hit_enter();
    delay(1000);
            // I had to add to APM_Config.h - # define SERIAL3_BAUD 115200  - in order for this to work correctly 
            // I also had to add to APM_Config.h - # define SERIAL1_BAUD 38400  - seems these var's are not passed to test.pde
            // for now just add them to match your baud rates, The ones I have are so are good to go.
    while(1){
                 if (Serial3.available())    
                   Serial1.write(Serial3.read()); 
                 if (Serial1.available()) 
                   Serial3.write(Serial1.read()); 
        }
        if(Serial.available() > 0){
            return (0);
    }
}
-----

Original comment by Draconis...@gmail.com on 24 Feb 2011 at 2:23

GoogleCodeExporter commented 9 years ago
fixed in r2305
supports rawgps data bi-directionaly over telemetry port
supports HappyKillmore's GCS to view UBlox Binary protocol
supports U-Center full access to Ublox

Original comment by Draconis...@gmail.com on 24 Feb 2011 at 4:36