arduino-aprs-tracker icon indicating copy to clipboard operation
arduino-aprs-tracker copied to clipboard

Error in height and continuous sending of packets

Open ghost opened this issue 2 years ago • 23 comments

Hello, I see that the height error is a recurring theme. If I load the TinyGPS IDE example, the readings are correct, but with the smartbeaconing code it always shows me 1000000. I guess it could be an error with the data reading or conversion, at one point I put some serialprintln and it started to show me fine, but it didn't last long and it was gone.

Regarding the continuous sending of packets, it enters the update loop and has a hard time getting out, I could see that the course of being in normal values, goes to a negative value and 5 figures.

I currently use a 3.3v Pro mini board and a NEO6

Greetings

ghost avatar Feb 26 '22 13:02 ghost

Hi,

Can you please test an older version of Arduino ? 1.8.13 ?

1.8.19 that i just tried uses more memory Sketch uses 16284 bytes (53%) of program storage space. Maximum is 30720 bytes. Global variables use 1243 bytes (60%) of dynamic memory, leaving 805 bytes for local variables. Maximum is 2048 bytes.

In the mean time i will look at it

billygr avatar Feb 27 '22 07:02 billygr

Can you please check the recent update on the smartbeaconing branch ?

We will be able to narrow it down

billygr avatar Feb 27 '22 11:02 billygr

Ok

Two different topics: Altitude 1000000 comes from TinyGPS when the Altitude is invalid Course 1000 if the course is invalid

I tried to fix the course issue, in the latest update. I was able to reproduce it locally but now my GPS is not giving a valid course (inside the house) to confirm it

billygr avatar Feb 27 '22 13:02 billygr

I just uploaded the smartbeaconing update. The continuous sending of packets problem was apparently solved, it only fires eventually by turning, but being without movement. The height still shows 1000000. I also try to print the number of satellites it receives and it shows me 255 If I load the example from the TinyGPS IDE it shows me the height fine. I currently use IDE 1.8.15 You can see me on aprs.fi as LW7EEA-7

ghost avatar Feb 28 '22 19:02 ghost

When stationary the GPS cannot provide a valid course (it jumps left,right) so it will get fired randomly.

The height is not valid that's why you get a 1000000. Will fix that also by ignoring this values

billygr avatar Mar 01 '22 06:03 billygr

I keep doing tests.

When I uncomment this line

// Serial.write(c); // uncomment this line if you want to see the GPS data flowing

I see the data that the GPS extracts, but the GPGGA sentence is not seen, which is the one that throws the height and satellite data.

On the other hand, if I uncomment this line

// uncomment this line to turn on RMC (recommended minimum) and GGA (fix data) including altitude //GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);

it gives me compilation error.

ghost avatar Mar 02 '22 14:03 ghost

I have pushed another update to the smartbeaconing branch 5 minutes ago. Can you please do another test ? its more clean/better output etc

billygr avatar Mar 02 '22 14:03 billygr

I see that the code works quite a bit. Now I get this indefinitely

No fix detected No fix detected Waiting for valid lat/lon 0.000000 0.000000
Waiting for valid lat/lon -38.726406-61.287612 Waiting for valid lat/lon -38.726417-61.287612 Waiting for valid lat/lon -38.726413-61.287620 Waiting for valid lat/lon -38.726413-61.287624 Waiting for valid lat/lon -38.726406-61.287628 Waiting for valid lat/lon -38.726406-61.287628 Waiting for valid lat/lon -38.726406-61.287631

ghost avatar Mar 02 '22 15:03 ghost

Yes and it will stay in that loop till the altitude is correct

billygr avatar Mar 02 '22 15:03 billygr

it's fine. comment out that loop, and the height keeps reading 1000000 for many minutes. Are you sure the library is reading the GPGGA statement?

ghost avatar Mar 02 '22 15:03 ghost

Yeap, no changes on the library. It is what TinyGPS reports, the value of 1000000 means invalid altitude

billygr avatar Mar 02 '22 15:03 billygr

okay. I don't know what is causing the error in altitude. when I load the example from the TinyGPS IDE I get the altitude fine and instantly. That's why I thought that the GPS was not getting all the data. When I do a c serialprint, which would be the raw GPS data, I never see the GGA statement, nor do I see the height and satellite values. but well, I appreciate your time and predisposition to try to solve it. a hug and thanks

ghost avatar Mar 02 '22 15:03 ghost

First of all thanks for the hug !!!. I can reproduce it with a NEO 6M here, and i think it is a matter of timing (processing data from the module). The reason the TinyGPS example that it is working is that it is pretty simple.

After a reset of the arduino, even with the GPS on a fix, i will get a lot of lines with 255 satellites and invalid latitude

Still looking at it

billygr avatar Mar 03 '22 07:03 billygr

The issue is the RAM usage, excluding the libaprs part the code behaves as expected (so your GPS it not faulty)

billygr avatar Mar 03 '22 14:03 billygr

Updated.

Not RAM usage but the ADC ISR killing the SoftwareSerial... give it a try

Its not the best solution to reduce the speed of the GPS to 4800 but it is more stable

Please enable the define on the code

billygr avatar Mar 05 '22 07:03 billygr

Well, I just uploaded the new code, but unfortunately it's still the same.

Do not worry

03/05/2022 12:53:18 -38.726333-61.287624 0.00 0.19 3843.57S/06117.25W 1000000.00/4200 0 0 1325 03/05/2022 12:53:19 -38.726333-61.287624 0.00 0.15 3843.57S/06117.25W 1000000.00/4200 0 0 1649 03/05/2022 12:53:20 -38.726333-61.287624 0.00 0.11 3843.57S/06117.25W 1000000.00/4200 0 0 2189 03/05/2022 12:53:21 -38.726333-61.287624 0.00 0.37 3843.57S/06117.25W 1000000.00/4200 0 0 677 03/05/2022 12:53:23 -38.726337-61.287624 0.00 0.13 3843.58S/06117.25W 1000000.00/4200 0 0 1881 03/05/2022 12:53:26 -38.726337-61.287624 0.00 0.22 3843.58S/06117.25W 1000000.00/4200 0 0 1109 03/05/2022 12:53:27 -38.726337-61.287624 0.00 0.11 3843.58S/06117.25W 1000000.00/4200 0 0 2189 03/05/2022 12:53:29 -38.726337-61.287628 0.00 0.00 3843.58S/06117.25W 1000000.00/4200 0 0 0 03/05/2022 12:53:30 -38.726337-61.287624 0.00 0.54 3843.58S/06117.25W 1000000.00/4200 0 0 476

ghost avatar Mar 05 '22 12:03 ghost

Give it some time and eventually the 1000000 altitude gets fixed

billygr avatar Mar 05 '22 13:03 billygr

I have no luck, more than 30 minutes working and still the same.

ghost avatar Mar 05 '22 14:03 ghost

Give it a try with 4800 baud, mine is sitting on my desk and recovers after 2-3 minutes

billygr avatar Mar 06 '22 06:03 billygr

It's fine. I will try again. I understood that the last update was already at 4800, right? Upload it as it is in the file. Or do you have to modify something?

ghost avatar Mar 06 '22 10:03 ghost

Only if you remove the comments from the define neo-6m. If you want to revert it to 9600 you will need to power cycle it (after disabling the define again )

billygr avatar Mar 06 '22 20:03 billygr

Now yes my friend!!!! After so much work it works!!! what a genius.... Now I can see the height and the number of satellites I receive without problems. In fact this last update improved the course, no more high values are seen. I am going to work on showing in the APRS comment, instead of the height in feet, that it shows me the number of satellites. Very grateful for all your time and wisdom, it's really a pleasure to have dealt with you.

ghost avatar Mar 06 '22 22:03 ghost

Just remember that it is a workaround for the real issue . At least you have something to play with

billygr avatar Mar 07 '22 09:03 billygr