Connecting two GPS on VOXL2
-
@Aks Those connections look reasonable. Let me do a little digging to see what would be required to use pins 7 and 8 on J19 for the new magnetometer.
-
@Aks I looked through the code and I don't see any obvious roadblocks to using pins 7 and 8 on J19 for the second magnetometer. The current magnetometer driver uses
-b 1
to specify the i2c bus on pins 4 and 5 of J19. For pins 7 and 8 I think you would need to specify-b 4
. I'll try to wire something up and try it on those pins in the next couple of days. -
@Aks I hooked up a magnetometer to pins 7 and 8 and it didn't work. But I found the issue in PX4 and was able to get it working by changing a couple of files. Here is the required diff:
voxl-px4-1.12/px4-firmware$ git diff diff --git a/boards/modalai/rb5-flight/src/board_config.h b/boards/modalai/rb5-flight/src/board_config.h index d205d7b124..479fb95652 100644 --- a/boards/modalai/rb5-flight/src/board_config.h +++ b/boards/modalai/rb5-flight/src/board_config.h @@ -54,7 +54,7 @@ #define PX4_I2C_BUS_EXPANSION 3 // I2C3: J14 / Power #define PX4_I2C_BUS_EXPANSION2 9 // I2C9: J15 / Radio Receiver / Sensors -#define PX4_NUMBER_I2C_BUSES 3 +#define PX4_NUMBER_I2C_BUSES 4 #define PX4_I2C_OBDEV_BMP280 0x76 diff --git a/boards/modalai/rb5-flight/src/i2c.cpp b/boards/modalai/rb5-flight/src/i2c.cpp index ce4b99a20c..49e361a877 100644 --- a/boards/modalai/rb5-flight/src/i2c.cpp +++ b/boards/modalai/rb5-flight/src/i2c.cpp @@ -36,6 +36,7 @@ constexpr px4_i2c_bus_t px4_i2c_buses[I2C_BUS_MAX_BUS_ITEMS] = { initI2CBusExternal(1), initI2CBusExternal(2), + initI2CBusExternal(4), initI2CBusInternal(5) //initI2CBusExternal(3), //initI2CBusExternal(9),
-
@Eric-Katzfey Thank you for this information. I highly appreciate this. How about using J18 for GPS UART? What changes would be essential for this? Also any idea about EKF configuration for using dual GPS?
-
@Aks Should be no problem using J18 for GPS instead of ESC.
-
@Aks We've never done a dual GPS configuration so not sure what is required for PX4.
-
@Eric-Katzfey All the points noted. Thanks alot for all the detailed digging into this. I would try out this configuration. One point which I missed is, In order to connect GPS to J18 UART, we need to change some port number / QUP number right? If you can clarify this it would be great.
-
@Aks Unfortunately, there seems to be a bug in the handling of options in the gps driver. The standard uart ports are 2 for the ESC (J18), 6 for the GPS (J19), and 7 for RC (Also on J19). The default port in the gps code is 6. You should be able to pass a different port to the gps driver using the -d option. However, px4_getopt in gps.cpp isn't parsing it if I pass it a different port with the -d option. In fact, you can see that the Holybro gps start line includes -d 7 and -b 115200. The code seems to parse the baudrate fine but not the port which is a good thing because port 7 is for RC, not GPS! Anyways, long story short, in order to put the gps on port 2 you would need to figure out why the gps driver is not parsing the d option correctly first.
-
@Eric-Katzfey Cool thank you. This gives me some lead to think on. I will debug this further. One small query. Can I run two gps driver with different 'd' options from config file or their can be conflict of same name services running? Just checking for clarity.
-
@Aks You should be able to run two. But, again, we have never tested.