GPS lost communication with Arduino

Development & General Chat for the superb openxvario project.

Moderator: rainer

Post Reply
Richard
Posts: 183
Joined: Sat Mar 29, 2014 10:44 pm
Country: United States
Location: Coral Springs, FL

GPS lost communication with Arduino

Post by Richard »

Hi, gents.
I have been using the Arduino-NEO 7- M5611 with a lot of success, until i installed it in a EDF, for which, I had to extend the barometer cables. It may be I messed up with the wiring or something, the fact is that I was never able to get the GPS back in line. After a number of trials, I decided to buy new Arduino boards as well as GPSs. Surprisingly, the GPS still does not report to Taranis.
Now, I added a couple of additional tests. On one side, I measured in three Arduino-NEO 7 sets, signal in the GPS TX pad with a logical probe, and found signal out form the GPS. Not happy enough, I downloaded UBLOX software utility, and found out that the three GPSs were sending data to the PC, and actually, giving my position on its map.
On the other hand, the three Arduinos report to Taranis telemetry with good barometric information.
The only thing I can think of is that I am doing something wrong somewhere. Now I have to say, that before receiving the new hardware, I uploaded again the firmware to the arduinos, and as such, the same firmware was uploaded to the new board, meaning that if I used the wrong FW, I messed up all around.
One thing I was not able to figure out in any case was to verify data transfer from the Arduino to the GPS.
Anyhow, can someone tell me where should I look to confirm the GPS is enabled and just in case send me the correct FW, please?
Thanks a lot
Richard

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

Re: GPS lost communication with Arduino

Post by mstrens »

In principe, the version of oXs in the master branch on github should work. There is no other firmware.
There could be a wrong configuration in files oXs_config_basic.h and oXs_config_advanced.h (or a wrong wiring between arduino and GPS)

So, I suggest that you first check your configurations files.
If you are unsure about your config, you can post it here and I will have a look.

If it still does not work, we could try to understand the issue if we activate some debug options and let oXs works with a connection to the PC (the same you use when you upload a firmware into the arduino).

If you have a digital analyser it could also help to check the signals exchanged between arduino and gps. Let me know if you have one.

Please note that at start up an ublox GPS send messages in a NEMA format.
Still decoding this kind of messages requires more work on arduino side that when gps send messages in another format.
That is the reason why at startup, oXS send some commands to the GPS in order to deactivate the NEMA messages and to activate some UBLOX messages. Only UBLOX messages are decoded by oXS and sent to the receiver.
Debugging will consist to check if oXs get the expected Ublox messages.
Richard
Posts: 183
Joined: Sat Mar 29, 2014 10:44 pm
Country: United States
Location: Coral Springs, FL

Re: GPS lost communication with Arduino

Post by Richard »

<t>Thank you mstrens for all the info.<br/>
I do not have a digital analyzer. Just a digital prove that blinks at each edge in the data stream. For what you are saying, I should see data activity in the oXS pin 6 on power on (or soon after), when the oXS sends de-activation of NEMA and activation of UBLOX. WIll check that out. <br/>
This is how oXS and GPS are wired<br/>
GPS oXS<br/>
VCC VCC<br/>
GND GND<br/>
RX 6<br/>
TX RX1<br/>
<br/>
Plus, remember that before any change, everything was working, and without any change, stop working.<br/>

The oXs_config_basic.h shows:
// --------- 9 - GPS --------------- see oXs_config_advanced.h for additional parameters (normally no need to change them)
#define A_GPS_IS_CONNECTED YES // select between YES , NO

The oXs_config_advanced.h, shows:

line 26 #define DATA_ID_GPS 0x83 // 3 used for GPS data
line 163 through 165
// --------- 9 - GPS ------------------------------------------------------------------------------------------------
//#define GPS_SPEED_IN_KMH // uncomment this line if GPS speed has to be sent in km/h instead of knot/h (only for Frsky protocol)
#define GPS_SPEED_3D // uncomment this line if GPS speed has to be the 3d speed instead of the 2d speed (note: 3d is probably less accurate - to test)
#define GPS_REFRESH_RATE 5 // rate at which GPS sent new data; select between 1, 5 or 10 (Hz). Default = 5 Hz; Ublox NEO6 does not support 10 hz

line 223: #define BASED_ON_GPS_SPEED 1

lines 225 through 227
#ifdef GPS_INSTALLED
//#include "HardwareSerial.h"
#endif

lines 328 through 328
#ifdef A_GPS_IS_CONNECTED
#if ( A_GPS_IS_CONNECTED == YES )
#define GPS_INSTALLED
#endif
#endif

Anyway, I will send you later the files, and pictures showing the wiring.
Richard
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: GPS lost communication with Arduino

Post by mstrens »

Please note that I recommend having a resistor between GPS RX pin and Arduino pin 6 because Arduino output a 5Volt level and GPS is normally 3.3 Volt.
Here the extract from oXs_config_description.h
* - GPS Rx pin is connected to a resistor (e.g. 10k) and the other pin of the resistor is connected to Arduino pin 6 (digital pin 6).
* This resistor is added (at least for an Arduino 5 volt) in order to protect the GPS pin.
* This is requested because Arduino will generate a signal with a high level equal to arduino Vcc (so normally 5 volt) while the GPS module should normally not accept more than 3.3 Volt.
* To be safier, you could even add a second resistor between GPS Rx pin and Ground (value= 22k) but, in my case, it worked without this second resistor.
* Note: it would be possible to use another pin than Arduino pin 6 but then it requires to change some parameters in file oXs_gps.cpp (see "Setup the GPS sensor").

In the worse case, it could be that the GPS Rx (input) does not accept commands anymore and stay sending default NEMA messages.
You could test this if you connect directly the GPS to the PC (using USB serial FTDI working in 3.3 volt) and use the UBLOX configuration software to see if Ublox stil accept commands from the PC.

Still, I do not expect that your GPS will be defect because you also tried with another GPS module and it did not worked.

If the only thing you changed is the length of the cable to the baro sensor, it could be that the I2C signal to/from baro sensor are corrupted and that oXs blocks. Still I do not expect that this would be the reason, because in this case you should not get telemetry values from the the baro sensor.
Anyway, as a test, you could try to upload in arduino a config where you declare that there is no baro.

If you can't solve the issue, I can try to explain you how to debug the program just changing some lines of code in the program.
Richard
Posts: 183
Joined: Sat Mar 29, 2014 10:44 pm
Country: United States
Location: Coral Springs, FL

Re: GPS lost communication with Arduino

Post by Richard »

Mstrens,
I was using the single 10K resistor, and in my last install I decided not to use it anymore. Reason is that the FTI adapter uses 5V, and that didn't kill the GPS. However, you made a point. It may be dead, and I don't know because so fat I was not checking any data towards the GPS.
Also, I agree with you that the oXs should be ok, for the same reasons you mentioned, unless the driver to the pin 6 is dead in all three oXss.
The thing I definitely need to check is if the GPS can get data out from the PC, and verify that is running UBLOX. I will work on that either this night or tomorrow afternoon, and report back.
Here I am sending you a picture of the new wiring (no 10K resistor), and the config files you suggested yesterday.
20180326_130946.jpg
oXs_config_basic.h
(11.12 KiB) Downloaded 397 times
oXs_config_advanced.h
(18.52 KiB) Downloaded 353 times
Richard

Richard
Posts: 183
Joined: Sat Mar 29, 2014 10:44 pm
Country: United States
Location: Coral Springs, FL

Re: GPS lost communication with Arduino

Post by Richard »

Well, mstrens I connected the FTI as you suggested on 3.3V configuration to the PC and UBLOX sw, and to start, the bottom line shows protocol NMEA. I was not able to find in the sw manual how to change the protocol from NMEA to UBX. In the messages screen all related to UBX is grayed (I guess that should be because it is not the currently used protocol). Therefore, I need some help on how to verify that the command to set UBX is sent and confirmed.
Richard
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: GPS lost communication with Arduino

Post by mstrens »

I presume that you already downloaded the U-Center program (which allows to configure and check Ublox GPS.
If not here is a link explaining how to proceed.
https://www.youtube.com/watch?v=ZeYKwNC5Aao

Here a link to the user guide the user guide
https://www.u-blox.com/sites/default/fi ... 250%29.pdf

If you can change the config of the GPS with U-Center, then the GPS is working fine and we have to look more deeper at oXs side.
Richard
Posts: 183
Joined: Sat Mar 29, 2014 10:44 pm
Country: United States
Location: Coral Springs, FL

Re: GPS lost communication with Arduino

Post by Richard »

mstrens, I got both files before calling for help. Unfortunately I know nothing about GPS technology. The manual, just says that you can change the configuration from one given window, accessing a file (that I don't know where to get from, neither what file should I choose just to change the protocol). I watched this video that shows how to load the file into the GPS but that is not very helpful either, and I understand spanish quite well.'
Also, the guy says, if the GPS works you need to do nothing, and mine works, but it seems its using NMEA.
In short, if you know how can I check the RX port of the GPS it would be a great help.
This is the screen I am getting: when I connect the GPS to the PC:
GPS data 1.jpg
Richard
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: GPS lost communication with Arduino

Post by mstrens »

I presume that your GPS is working if U-center could display such information because I expect that this program sent some commands to the GPS at startup in order to recognise it.

So we can try to make some tests at oXs side.
Do the test one by one.

- 1) First, you can try to increase the delay oXs is waiting at startup before sending commands to the GPS. It could be that if the delay is too short that GPS would not yet be ready to accept the commands sent by oXs.
To do so, you have to go in file oXs_gps.cpp and find the line
delay(1000) ; // wait to be sure that GPS has started
Then replace the value 1000 by e.g. 9000
This will force oXs to wait 9 sec before sending commands.

- 2) if this does not solved the issue, you can try to upload a config where you deactivate the baro sensor. Just say NO_BARO in config (no need to change wires)

-3) if this still does not solved the issue, you can try to activate some debug options in order to let oXs send messages to the pc;
To do so you have to change some lines of code
-in oXs_config_advance, you should find a line
//#define DEBUG
Just remove the "//" in order to uncomment this line.
- in oXs_gps.cpp, you have lines
#define DEBUGPARSEGPS
//#define DEBUGSENDGPS
//#define DEBUG_FORWARD_GPS_MSG_TO_PC
Please change to
//#define DEBUGPARSEGPS
//#define DEBUGSENDGPS
#define DEBUG_FORWARD_GPS_MSG_TO_PC

Take care that to test this version you have to make some changes in the way you connect FTDI to Arduino.
Normally when you connect FTDI to Arduino, TX from FTDI is connected to RX from arduino and RX from FTDI is connected to TX from arduino.
You must keep it this way when you upload a new firmware into arduino. At this stage, GPS should not be connected to Arduino (otherwise signal sent by GPS will interact with the signal generated by PC/FTDI.

Still, once the firmware is uploaded, in order to test with the debug option, we need to connect as well the GPS as well as the FTDI to the arduino.
In order to avoid conflict between FTDI and GPS, best is to use only 2 wires between FTDI and Arduino. The wires should be Gnd and FTDX RX (to be connected to arduino Rx).

In order to get the oXs messages on the pc, you have to activate the arduino PC terminal (pressing CTRL + SHIFT + M) and you have to change the baudrate of the pc terminal to 38400 (this parameter in on the PC terminal screen at the right below).
If you have to run this test, send me a copy of the messages displayed on the PC terminal.

I hope this is clear enough.
ReSt
Posts: 1581
Joined: Tue Dec 27, 2011 11:34 pm
Country: -

Re: GPS lost communication with Arduino

Post by ReSt »

Richard, have a look here in this description of how I did set up a gps module. It shows something about NMEA mode and SIRF mode of a GPS module.

http://openrcforums.com/wiki/index.php/ ... _GPS_mouse

From there go to Step 8.2

Reinhard
Richard
Posts: 183
Joined: Sat Mar 29, 2014 10:44 pm
Country: United States
Location: Coral Springs, FL

Re: GPS lost communication with Arduino

Post by Richard »

Thanks a lot ReSt.
Will look into it right now. I'll follow mstrens lead but I also will look into your link because one way or another is something more I learn.
Richard
Richard
Posts: 183
Joined: Sat Mar 29, 2014 10:44 pm
Country: United States
Location: Coral Springs, FL

Re: GPS lost communication with Arduino

Post by Richard »

Mstrens, it seems you hit the nail as usual. I changed the delay to 9000, and it worked. But let me tell you all the process: initially, I didn't connect the barometer, and the GPS was not discovered by the Taranis, therefore, I thought the oXs was failing, but, on the other hand, it was working before. Under those conditions, I remember that before the oXs was reporting data from the barometer, therefore, I reconnected the MS5611. This time, the barometer was not discovered. I revised the wiring, and found the baro's SDA and SCL were reversed, so I reconnected them. Surprisingly (for me at least), not the Taranis not only discovered the Baro, but also the GPS.
Thinking further, I think that you mentioned before that something wrong in the A4 or A6 may affect the pin 6. Anyhow, I still do not have clear why the absence of the baro, will not allow for the discovery of the GPS.
I will keep an eye on the connections, and do some additional tests, unless there is any sense for why the GPS was not discovered when the baro was not connected.
On the other hand, I was thinking about the 10 K resistor, and given there are not properly defined specifications for the RX and TX pins of the GPS other than they have a 500 ohm resistance input (or output), and assuming it has an internal regulator to drop the 5V input to 3.3V, I am not sure that the RX pin would be protected for a 5V input, and on to p of that, I am not sure either that a 10K in series is too much of a guarantee to protect the pin, I will use the voltage divider that you suggest in the oxs_config_description.h, adding a 22K resistor to ground. just to be sure. Given that I have more modules that what I need, I will keep one working without any resistor and find out the hard way if the 5V NEO is or not 5V all the way.
Cheers, and lots of thanks for your help.
Richard
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: GPS lost communication with Arduino

Post by mstrens »

The GPS module has a 3.3 voltage regulator but this is used to power on the GPS module.
When a 5 volt Arduino is used, it can generate a 5 volt signal on his output pins while the GPS input pins does not accept more than 3.3 volt.
Still the GPS input pins have probably an internal diode connected to GPS VCC (so 3.3 volt).

If there is a resistor between the arduino output pin (pin 6) and the GPS input pin, the current that goes into the diode will be limited and GPS should not become out of use.
Therefore I recommended a 10k resistor (to be safe) but it could be that a value of 500 ohm would already enough.
So if the GPS module has already a 500 resistor, it could be that the GPS is already protected and there is perhaps no need to protect it further more with a 10 k.
Still, if it works with a 10 k it is safier to keep it.

Note: if you use a config that says that there is baro sensor but if this sensor is not conected (or is connected in a wrong way), oXs will loose a lot of time looking at signal from baro sensor. During this time, it will not read all characters coming from the GPS (because it can't do both at the same time).
If some characters from GPS are lost, the full frame sent by GPS is lost and if it occurs often, it could be that nothing is sent to the transmitter.
Richard
Posts: 183
Joined: Sat Mar 29, 2014 10:44 pm
Country: United States
Location: Coral Springs, FL

Re: GPS lost communication with Arduino

Post by Richard »

You have a point. According to the supposed electric diagram, there is no diode to protect the RX pin, therefore, as you said, either the 10K or the voltage divider are mandatory to protect the module.
I am attaching the diagram I got just in case it help someone else.
GPS electrical.pdf
(35.22 KiB) Downloaded 315 times
Richard

Post Reply

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