GPS testing

This commit is contained in:
Klaus K Wilting 2018-06-09 17:59:59 +02:00
parent b43834a962
commit 77431dbdde
6 changed files with 7 additions and 17 deletions

View File

@ -32,7 +32,7 @@ lib_deps_display =
lib_deps_rgbled =
SmartLeds@>=1.1.3
lib_deps_gps =
TinyGPSPlus@>=1.0.0
https://github.com/mikalhart/TinyGPSPlus.git
build_flags =
; we need build_flag for logging, otherwise we can't use ESP_LOGx in arduino framework
; ---> NOTE: For production run set DEBUG_LEVEL level to NONE! <---

View File

@ -58,7 +58,7 @@ typedef struct {
uint16_t altitude;
} gpsStatus_t;
extern gpsStatus_t gps_status; // struct for storing gps data
//extern TinyGPSPlus gps; // Make TinyGPS++ instance globally availabe
extern TinyGPSPlus gps; // Make TinyGPS++ instance globally availabe
#endif
extern configData_t cfg;

View File

@ -4,7 +4,7 @@
// Local logging tag
static const char TAG[] = "main";
/*
// GPS read data to global struct
void gps_read(){
gps_status.latitude = gps.location.lat();
@ -32,5 +32,4 @@ void gps_loop(void * pvParameters) {
vTaskDelay(1/portTICK_PERIOD_MS); // reset watchdog
}
}
*/
#endif // HAS_GPS

View File

@ -136,7 +136,6 @@ void do_send(osjob_t* j){
ESP_LOGI(TAG, "%d bytes queued to send", sizeof(mydata));
sprintf(display_lmic, "PACKET QUEUED");
/*
#ifdef HAS_GPS
if (cfg.gpsmode && gps.location.isValid()) {
gps_read();
@ -144,7 +143,6 @@ void do_send(osjob_t* j){
ESP_LOGI(TAG, "HDOP=%d, SATS=%d, LAT=%d, LON=%d", gps_status.hdop, gps_status.satellites, gps_status.latitude, gps_status.longitude );
}
#endif
*/
// clear counter if not in cumulative counter mode
if (cfg.countermode != 1) {

View File

@ -581,10 +581,10 @@ xTaskCreatePinnedToCore(sniffer_loop, "wifisniffer", 2048, ( void * ) 1, 1, NULL
// if device has GPS and GPS function is enabled, start GPS reader task on core 0
#ifdef HAS_GPS
//if (cfg.gpsmode) {
//ESP_LOGI(TAG, "Starting GPS task on core 0");
//xTaskCreatePinnedToCore(gps_loop, "gpsreader", 2048, ( void * ) 1, 1, NULL, 0);
//}
if (cfg.gpsmode) {
ESP_LOGI(TAG, "Starting GPS task on core 0");
xTaskCreatePinnedToCore(gps_loop, "gpsreader", 2048, ( void * ) 1, 1, NULL, 0);
}
#endif
// kickoff sendjob -> joins network and rescedules sendjob for cyclic transmitting payload
@ -628,11 +628,6 @@ void loop() {
reset_salt(); // get new salt for salting hashes
}
// read gps
while (GPS_Serial.available()) {
gps.encode(GPS_Serial.read());
}
if ( (uptime() % 10000) == 0 )
ESP_LOGI(TAG, "GPS NMEA data passed %d / failed: %d / with fix: %d || Sats: %d / HDOP: %d || m/s: %d / %d", gps.passedChecksum(), gps.failedChecksum(), gps.sentencesWithFix(), gps.satellites.value(), gps.hdop.value(), gps.time.minute(), gps.time.second() );

View File

@ -259,7 +259,6 @@ void get_voltage (uint8_t val) {
void get_gps (uint8_t val) {
ESP_LOGI(TAG, "Remote command: get gps status");
/*
#ifdef HAS_GPS
if (gps.location.isValid()) {
gps_read();
@ -267,7 +266,6 @@ void get_gps (uint8_t val) {
ESP_LOGI(TAG, "HDOP=%d, SATS=%d, LAT=%d, LON=%d", gps_status.hdop, gps_status.satellites, gps_status.latitude, gps_status.longitude );
}
#endif
*/
};