dl9rdz / rdz_ttgo_sonde

263 stars 92 forks source link

Debugging of attached GPS module #28

Closed scalvin1 closed 4 years ago

scalvin1 commented 4 years ago

Is there a way to check if the attached GPS module is working?

I have a NEO-6M module attached to GND, 5V and PIN3 (also labelled as RX). In the wiki/manual it says the software expects NMEA RMC messages. I have configured the module to only send RMC messages now, but it is unclear if this is necessary.

I can only receive sondes occasionally and it would be nice to debug the GPS without such reception.

The module is working (blinking for position fix), thus it would be nice if the rdxsonde server could print the position on a page or give GPS status information.

Thanks for the great piece of software. It will be near perfect once I have GPS working... :-)

scalvin1 commented 4 years ago

I figured out the serial debugging console in Linux arduino tool. Now I see that the GPS data never comes in as valid even though the GPS blinks 'I am ok and have a position fix'. I suppose I am doing something wrong with the pins. The debugging goes on indefinitely like below:

Running main loop in state 0. free heap: 123444; currentDisp:0 lastDisp:0 RS41: setting RX frequency to 402300000.00 AFC BW: 12500.000000 RX BW: 6250.000000 TIMEOUT RX result 1, laststate was -1 Timeout check: 113311 - 112091 vs -1; 113311 - 0 vs 0; 113311 - 113311 vs 0 lastState is 0 NORX timer expired event b: action is 41 nextRxSonde: 0 receive Result is 8001 rx task: activate=128 mainstate=0 rx task: calling sonde.setup()

Sonde::setup() on sonde index 0 waitRXcomplete returning 8001 (RX_TIMEOUT) waitRX result is 8001 Loop: triggering action Sonde=0 (128) Sonde::updateState for event 128 Loop: action is 65, sonde index is 0 current main is 0, current rxtask is 0 TNC client not connected updateDisplay started GPS data: valid0 GPS at 999.000000,999.000000 (alt=-100663,cog=-2147483); sonde at dist=-1, dir=-1 rel.bear=-1 updateDisplay took 75 ms updateDisplay done Unused stack: 5768

scalvin1 commented 4 years ago

I think I solved this. It works whenever it is not plugged into a computer but into simple USB power. The reason I guess is that the debug console or serial console tries to also use the RX/TX UART internally before it converts to USB. Bit strange, but that explains it and now it works beautifully.