cyberman54 / ESP32-Paxcounter

Wifi & BLE driven passenger flow metering with cheap ESP32 boards
https://cyberman54.github.io/ESP32-Paxcounter/
Other
1.69k stars 397 forks source link

Can not get GPS fix with LoPy4 and Pytrack or Pytrack 2.0 x #712

Closed tjvandam closed 3 years ago

tjvandam commented 3 years ago

I have been trying this tutorial: https://www.hackster.io/simon-kemper/how-to-build-a-lorawan-smartphone-counter-with-esp32-1c22b6 with brand new LoPy4 and old Pytrack and Pytrack 2.0 x

I have uncommented the GPS lines in the hal/lopy4.h file.

Everything seems to work fine. LoRaWAN connection, BLE and WiFi counting. Downlinks. All works.

However, the GPS continues to report only 0,0 - whatever I do. Have been trying to use internal GPS antenna and external antenna. It just looks like the GPS is not properly read and/or activated. I get no errors at all. Can not see any debugging information to give me an idea where to look at what is going wrong.

Does someone have any idea what is missing here?

cyberman54 commented 3 years ago

What message do you get on serial console while device is starting up: Quectel L76 GPS chip found or Quectel L76 GPS chip not found on i2c bus, bus error <X>

And if not found, what is printed as "X"?

tjvandam commented 3 years ago

This is the serial output I get:

> [I][gpsread.cpp:56] gps_init(): Quectel L76 GPS chip found

If have tried to put the device outside with clear sky view for 30 minutes. It continues to report 0,0 on port 4 when I send a port 2 downlink with 0x84.

Any other ideas for debugging?

cyberman54 commented 3 years ago

Do you see any errors or reboots in the serial log?

tjvandam commented 3 years ago

No errors or reboots. All looks good.

cyberman54 commented 3 years ago

I checked it. Found a bug, that prevented the gps task starting if a i2c connected gps is used. Pytrack is one of the rare boards which is using i2c gps chip. I commited a fix. Please recompile current master software and try again.

cyberman54 commented 3 years ago

Meanwhile i could test the bugfix it with a LoPy (old one, a non 4) on a (old v1.1) Pytrack board. It works:

{
  "altitude": 37,
  "hdop": 2.18,
  "latitude": 52.xxxxx,
  "longitude": 13.xxxxx,
  "sats": 5
}

Note: it took ~15 minutes until the Quectel L76 gps chip got a fix after coldstart in an urban area. While it has no fix, no gps data is transmitted by paxcounter software.

tjvandam commented 3 years ago

Works on my side also now. Thanks for the quick fix!

cyberman54 commented 3 years ago

@tjvandam Can you confirm that it works on a Pytrack 2.0 board?

tjvandam commented 3 years ago

Yes I can confirm that.