GY-86 not working - am I missing something?

Development & General Chat for the superb openxvario project.

Moderator: rainer

hotfly
Posts: 11
Joined: Sat Jun 08, 2019 1:24 pm
Country: -

GY-86 not working - am I missing something?

Post by hotfly » Sat Aug 10, 2019 1:58 pm

oXs is working very well with MPU6050, MS5611 and GPS modules.
When I change the MPU6050 and MS5611 to a GY-86 to save space, it does not work, no SPort data is sent, not even from the GPS
I also set the following:
#define FIRST_BARO_SENSOR_USE GY86

I know that the GY86 is 'alive' because it returns the 0x68 and 0x77 addresses when I run an I2C Scanner.

Any ideas? Justin


User avatar
kalle123
Posts: 852
Joined: Sat Mar 29, 2014 10:59 am
Country: -
Location: Moenchengladbach

Re: GY-86 not working - am I missing something?

Post by kalle123 » Sun Aug 11, 2019 6:57 am

So the GY-86 seems to be ok. That is not the initial problem.

Check the wiring and post oXs_config_basic and oXs_config_advance.

br KH

hotfly
Posts: 11
Joined: Sat Jun 08, 2019 1:24 pm
Country: -

Re: GY-86 not working - am I missing something?

Post by hotfly » Sun Aug 11, 2019 7:22 pm

Hi Kalle - the wiring must be OK because the I2C Scanner gave the correct addresses (I didn't change the wiring when I ran this).

I will take another look at the oXs config basic and advanced files.

I assume that other people have had success with the GY-86 and recent versions of oXs.

Justin

mstrens
Posts: 1434
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: GY-86 not working - am I missing something?

Post by mstrens » Mon Aug 12, 2019 6:07 am

What is the I2C address when you run the GY86?
The mS5611 has 2 I2S address.
Perhaps the GY86 is designed to use the other one (0x76).

You can change this in the file openXsensor.ino in the folowing code
#define I2C_MS5611_Add 0x77 // 0x77 The I2C Address of the MS5611 breakout board
// (normally 0x76 or 0x77 configured on the MS5611 module
// via a solder pin or fixed)

hotfly
Posts: 11
Joined: Sat Jun 08, 2019 1:24 pm
Country: -

Re: GY-86 not working - am I missing something?

Post by hotfly » Tue Aug 13, 2019 9:23 pm

Hi mstens - I was getting 0x68 and 0x77 when I ran the scanner and I have 0x77 selected in openXsensor.ino.

I presume that other people are successfully using oXs with a GY-86??


mstrens
Posts: 1434
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: GY-86 not working - am I missing something?

Post by mstrens » Wed Aug 14, 2019 6:36 am

The 2 I2C adress are correct.
Normally it should work with a GY-86.
I build one (at least using an oldier version of oXs).
Can you post here your 2 config files.

Are you sure that your Aduino is using a AVR328P. Some are using a AVR168 that has less memory?
Still I expect this should generate an error at compilation/flashing.

hotfly
Posts: 11
Joined: Sat Jun 08, 2019 1:24 pm
Country: -

Re: GY-86 not working - am I missing something?

Post by hotfly » Thu Aug 15, 2019 8:37 pm

Hi mstrens - the two files are attached.

Yes - the Arduino is a -328 and works very well with separate MPU and MS5611 modules. I did try a separate Arduino (Pro Mini 3.3V), but same result.

Thanks - Justin
Attachments
oXs_config_basic.h
(11.18 KiB) Downloaded 102 times
oXs_config_advanced.h
(19.15 KiB) Downloaded 115 times

mstrens
Posts: 1434
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: GY-86 not working - am I missing something?

Post by mstrens » Sat Aug 17, 2019 1:54 pm

Your config seems OK.
There is perhaps a bug in oXs.
Can I ask you to test following things:
- test disabling the GPS (GPS and GY86 require quite a lot of memory and perhaps there is a conflict)

- test using #define FIRST_BARO_SENSOR_USE MS5611 in your config (so with MS5611 instead of GY86).
You normally can still use #define VSPEED_SOURCE BARO_AND_IMU if you have also #define A_MPU6050_IS_CONNECTED YES

- test using #define FIRST_BARO_SENSOR_USE MS5611 in your config but ask for getting the Vspeed without using the IMU calculation
So use #define VSPEED_SOURCE FIRST_BARO
In this cas, you can use #define A_MPU6050_IS_CONNECTED YES or NO depending if you want the roll/pitch/acceleration or not

Let me know the result of the tests.

hotfly
Posts: 11
Joined: Sat Jun 08, 2019 1:24 pm
Country: -

Re: GY-86 not working - am I missing something?

Post by hotfly » Mon Aug 19, 2019 10:07 pm

Hi Michel, I have been doing some testing:
Test disabling the GPS - no change
#define FIRST_BARO_SENSOR_USE MS5611 - no change
#define FIRST_BARO_SENSOR_USE MS5611 + Vspeed without using the IMU calculation - no change
However, when I set
#define A_MPU6050_IS_CONNECTED NO, the GPS and MS5611 work OK, so it is a problem with this.

There may be a problem with my GY-86, even though the correct I2C addresses are found with the scanner. The code works OK with separate MS5611 and MPU modules. Tried to scope the interrupt line to the MPU - noisy signal. I probably need to get a new GY-86.
Justin

User avatar
Kilrah
Posts: 10796
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: GY-86 not working - am I missing something?

Post by Kilrah » Mon Aug 19, 2019 11:00 pm

Does oXs use the magnetometer on the GY-86? Another project uses the GY-85 and nowadays most of the boards that are sold have a fake/clone "5883" that doesn't work right, at least not like the original. Apparently there are software changes needed but no datasheet can be found and while some managed to get it to somewhat work it does so poorly, leading to people having to try and find sources with an original by trial and error. Most likely the same issue exists with the GY-86.

mstrens
Posts: 1434
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: GY-86 not working - am I missing something?

Post by mstrens » Tue Aug 20, 2019 6:24 am

Thanks for the information.
When the option GT86 is activated in oXs it does not use the magnetometer.
In order to use the 5883, you have to explicitely activate it (as a separate option).
So, this could not be the reason here.

User avatar
kalle123
Posts: 852
Joined: Sat Mar 29, 2014 10:59 am
Country: -
Location: Moenchengladbach

Re: GY-86 not working - am I missing something?

Post by kalle123 » Tue Aug 20, 2019 12:24 pm

Do we now have a problem with some GY-86 or is the code putting to much load on the Arduino?

If necessary, I could do tests here ....

br KH

mstrens
Posts: 1434
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: GY-86 not working - am I missing something?

Post by mstrens » Tue Aug 20, 2019 1:07 pm

There is no new version of oXs since many weeks now.
I expect GY86 option combined with a GPS should work but It could be good to test it to be sure.
So if you have the hardware to make test it would be fine to report here the result.

User avatar
kalle123
Posts: 852
Joined: Sat Mar 29, 2014 10:59 am
Country: -
Location: Moenchengladbach

Re: GY-86 not working - am I missing something?

Post by kalle123 » Tue Aug 20, 2019 6:07 pm

Just did a short test here on the window sill.

Just pluged the components together. Arduino UNO, BN-180 GPS, GY-86 FrSky S6R.

Took the oXs_config files, Justin posted.

Image

Image

I do see GPS and Alt values. I forgot to define Vario source in Open TX, but for me, there is no issue at the moment.

br KH

mstrens
Posts: 1434
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: GY-86 not working - am I missing something?

Post by mstrens » Tue Aug 20, 2019 6:28 pm

Thank you for the test.

hotfly
Posts: 11
Joined: Sat Jun 08, 2019 1:24 pm
Country: -

Re: GY-86 not working - am I missing something?

Post by hotfly » Tue Aug 20, 2019 6:50 pm

Kalle - thanks for doing this test - interesting result.
Your set up works OK, without needing to set #define A_MPU6050_IS_CONNECTED NO. Did you select any MPU values (Pitch, Roll or Ay) for display on the Tx?
Mine does not work unless I deselect the MPU6050. I am using a Pro-Mini 3.3V Arduino, so that is different... or there is an issue with my GY-86.
The GY-86 modules are quite expensive now - I will, probably connect my separate MS5611 and MPU modules together - these work fine.
Justin

mstrens
Posts: 1434
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: GY-86 not working - am I missing something?

Post by mstrens » Tue Aug 20, 2019 7:14 pm

Perhaps there is an issue with a pro mini at 3.3V because it is running at 8 Mhz instead of 16 MHZ and handling the imu +gps + MS5611 is perhaps too much.

User avatar
kalle123
Posts: 852
Joined: Sat Mar 29, 2014 10:59 am
Country: -
Location: Moenchengladbach

Re: GY-86 not working - am I missing something?

Post by kalle123 » Tue Aug 20, 2019 7:31 pm

Justin, did not do anything special. Flashed the Arduino Uno with the code (your config files), connected the components, switch it on and did a telemetry search on Taranis. That is all.

Get an 5V 16 Mhz Arduino and do another test. ;)

br KH

PeterB
Posts: 27
Joined: Tue Jan 07, 2020 6:40 pm
Country: -

Re: GY-86 not working - am I missing something?

Post by PeterB » Mon Feb 03, 2020 2:31 pm

Just wondering if this issue was resolved?

I have just received a GY63 module & hooked it, but am not getting any Serial port output during the IMU calibration process.
IMU is selected & 1st BARO set as GY63 etc. Interrupt pin 2 is selected & used.
The Serial port output line is also uncommented.

The GY63 has been tested with a simple program which reads the IMU registers (doesn’t use interrupt output) with I2C address 0x68 and I get Acc & G output values which change to different values as I move the sensor axis orientation.
Temperature reading is good & changes correctly when held/released to cool

Where do I check which I2C address OSX is using?
Peter

mstrens
Posts: 1434
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: GY-86 not working - am I missing something?

Post by mstrens » Mon Feb 03, 2020 2:57 pm

It is not clear what type you are using.
In your message you refer to GY63 and to IMU calibration.
The GY63 module does have an IMU. It has only a MS5611 (baro sensor).

Please clarify if you are using a GY63 or a GY86.
If you are using a GY86, please declare your first baro sensor as a GY86.

For information, oXs uses this adress for INV6050
#define INV6050_addr 0x68
#

PeterB
Posts: 27
Joined: Tue Jan 07, 2020 6:40 pm
Country: -

Re: GY-86 not working - am I missing something?

Post by PeterB » Mon Feb 03, 2020 4:00 pm

Sorry, a typo. Should be GY86!
I am using an Arduino Uno for my test setup if that makes any difference.
I think that I have everything configured correctly?
The GY86 connections are untouched from my working simple IMU sketch.
GY86 INTA pin is definitely connected to Uno D2 (INT0).
Peter
Attachments
oXs_config_basic.h
(11.47 KiB) Downloaded 114 times
oXs_config_advanced.h
(15.86 KiB) Downloaded 114 times

mstrens
Posts: 1434
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: GY-86 not working - am I missing something?

Post by mstrens » Mon Feb 03, 2020 4:24 pm

It should work with an Uno instead of a Pro mini.

Your config seems OK.

Does you get some messages on Arduino serial terminal when the UNO is reset? (I presume you know how to open the serial terminal, select the COM port, set the baudrate on 112500.
Can you report the message you get.

PeterB
Posts: 27
Joined: Tue Jan 07, 2020 6:40 pm
Country: -

Re: GY-86 not working - am I missing something?

Post by PeterB » Mon Feb 03, 2020 5:27 pm

Hi,
The serial terminal opens ok either using the Arduino IDE tools tab serial monitor, or Ctrl + Shift + M, using the same Com Port as for the sketch upload, but I get get no output at all on the serial terminal!
(I have tried several serial terminal speeds including 115200).
Peter

mstrens
Posts: 1434
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: GY-86 not working - am I missing something?

Post by mstrens » Mon Feb 03, 2020 5:54 pm

Can you test the folowwing:

In the .ino file, there is the setup function which starts with
void setup(){
// set up the UART speed (38400 if GPS installed else 115200)
#ifdef GPS_INSTALLED
Serial.begin(38400); // when GPS is used, baudrate is reduced because main loop must have the time to read the received char.
#endif
#ifdef DEBUG
#ifndef GPS_INSTALLED
Serial.begin(115200L); // when GPS is not used, baudrate can be 115200
#endif
Serial.println(F("openXsensor starting.."));
Serial.print(F(" milli="));
Serial.println(millis());
Serial.print(F("freeRam="));
Serial.println(freeRam());
#endif

First I suggest that you add 1 line nearly at the end of this extract to be sure that the DEBUG option is active.
So having
Serial.println(F("openXsensor starting.."));
Serial.print(F(" milli="));
Serial.println(millis());
Serial.print(F("freeRam="));
Serial.println(freeRam());

#error DEBUG is activated

#endif

With this line added, you should get a compilation error with a message "DEBUG is activated"
It you get the compilation error, it is fine and you can go to the next test:

Remove then the line you just added (to avoid the compilation error) and replace it by a delay(5000)like this
Serial.println(F("openXsensor starting.."));
Serial.print(F(" milli="));
Serial.println(millis());
Serial.print(F("freeRam="));
Serial.println(freeRam());

delay(5000);

#endif

Adding this line should give enough time to the Uno to send some messages to the arduino terminal before going further on (and perhaps blocking)

This is just to be sure that the beginning of the program works and that the serial port is OK

PeterB
Posts: 27
Joined: Tue Jan 07, 2020 6:40 pm
Country: -

Re: GY-86 not working - am I missing something?

Post by PeterB » Mon Feb 03, 2020 6:45 pm

I have inserted the “#error DEBUG is activated” text at the location identified but get no compilation error & the sketch uploads ok.
I have also tried putting the same text in the GPS_INSTALLED ifdef section (34800 baud) & get the same result!

mstrens
Posts: 1434
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: GY-86 not working - am I missing something?

Post by mstrens » Mon Feb 03, 2020 7:01 pm

So, it means that DEBUG option is not activated.
Normally, this option is activated automatically if you oXs_config_advanced.h file have this line uncommented
//#define DISPLAY_ACC_OFFSET

It was uncommented in the file you posted here above.
Was it still uncommented in the test you just made?

PeterB
Posts: 27
Joined: Tue Jan 07, 2020 6:40 pm
Country: -

Re: GY-86 not working - am I missing something?

Post by PeterB » Mon Feb 03, 2020 7:07 pm

Yes, all IMU6050 lines are uncommented in the advanced config file

PeterB
Posts: 27
Joined: Tue Jan 07, 2020 6:40 pm
Country: -

Re: GY-86 not working - am I missing something?

Post by PeterB » Mon Feb 03, 2020 7:35 pm

Mstrens,
I have just commented out the display offset instruction line, compiled & uploaded to the 3.3v Pro Mini.
I can discover all acc values, Alt & Vspeed on the Transmitter & values change when I re-orientate the sensor, so it seems that the problem is just with the calibration serial output.

mstrens
Posts: 1434
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: GY-86 not working - am I missing something?

Post by mstrens » Mon Feb 03, 2020 7:57 pm

Yes, I expect it is just with the serial output.
Serial output does not work because DEBUG option is not automatically activated.

It seems that the reason is that in your config advanced file you have this line
#include "oXs_config_macros.h"

This line does not exist anymore in the latest version I published on github (I moved it into several other files).
So there could be some inconsistency.

So, if you want to try the calibration process, I suggest that you download the latest version on github and manually edit the config file in this new version.
Changes in the new version have been done just in order to work properly with the configurator but not to the code for baro or IMU sensors.

PeterB
Posts: 27
Joined: Tue Jan 07, 2020 6:40 pm
Country: -

Re: GY-86 not working - am I missing something?

Post by PeterB » Mon Feb 03, 2020 8:32 pm

Many thanks,
downloading the latest version of OxS from github has resolved the problem & I now get a serial output.
I thought that I had used the version of oXs downloaded on only 21st Jan, but maybe not ....
Peter


Post Reply

Return to “OpenXVario - an open source vario supported by the open source firmwares!!”