- fix ntripClient

- fix gyroscope
- fix init screen
This commit is contained in:
2024-07-19 12:15:44 +02:00
parent 87743c8e67
commit 73fde34e48
9 changed files with 25 additions and 18 deletions
+2 -1
View File
@@ -39,6 +39,7 @@ Have to:
-> check new course calculation between points -> check new course calculation between points
-> menu route data und ui disconnecten -> menu route data und ui disconnecten
-> use routeCache in captureRoute and autopilot -> use routeCache in captureRoute and autopilot
-> make ntrip client useable without user and password
-> understand gyroscope offsets
+6 -6
View File
@@ -14,16 +14,16 @@
#include <stdint.h> #include <stdint.h>
#define ZUHAUSE #define HOTSPOT
#ifdef HOTSPOT #ifdef HOTSPOT
namespace NetworkConfig namespace NetworkConfig
{ {
const char ssid[] = "Kleiax Handy"; const char ssid[] = "Nubsi";
const char password[] = "12345677"; const char password[] = "12345677";
const char ip[] = "192.168.43.4"; const char ip[] = "192.168.72.7";
const char subnet[] = "255.255.255.0"; const char subnet[] = "255.255.255.0";
const char gateway[] = "192.168.43.1"; const char gateway[] = "192.168.72.228";
const char dns[] = "8.8.8.8"; const char dns[] = "8.8.8.8";
const bool mqtt = false; const bool mqtt = false;
} }
@@ -81,9 +81,9 @@ namespace NtripConfig
{ {
const char host[] = "rtk2go.com"; const char host[] = "rtk2go.com";
const uint16_t port = 2101; const uint16_t port = 2101;
// const char mountPoint[] = "GER-Dortmund"; const char mountPoint[] = "GER-Dortmund";
// const char mountPoint[] = "GER-Papenburg"; // const char mountPoint[] = "GER-Papenburg";
const char mountPoint[] = "Rtkramerntrip"; // const char mountPoint[] = "Rtkramerntrip";
const char user[] = "alklein1@gmx.de"; const char user[] = "alklein1@gmx.de";
const char password[] = "none"; const char password[] = "none";
} }
+1 -1
View File
@@ -14,7 +14,7 @@
LcdWrapper::LcdWrapper(LiquidCrystal_I2C *lcd) LcdWrapper::LcdWrapper(LiquidCrystal_I2C *lcd)
: lcd{lcd}, changed{false} : lcd{lcd}, changed{false}
{ {
this->clear(); // this->clear();
} }
void LcdWrapper::run() void LcdWrapper::run()
+1
View File
@@ -194,6 +194,7 @@ void MotorControl::setRealPower(int8_t power)
} }
ledcWrite(this->pwmChannel, pwm_val); ledcWrite(this->pwmChannel, pwm_val);
std::cout << "MotorControl::serRealPower - pwm: " << static_cast<int>(pwm_val) << std::endl;
this->dutycycle = pwm_val; this->dutycycle = pwm_val;
} }
+5 -1
View File
@@ -12,8 +12,12 @@
#include "ntripClient.h" #include "ntripClient.h"
NTRIPClient::NTRIPClient(SFE_UBLOX_GNSS *gnss, const char *host, uint16_t port, const char *mountPoint, const char *user, const char *password) NTRIPClient::NTRIPClient(SFE_UBLOX_GNSS *gnss, const char *host, uint16_t port, const char *mountPoint, const char *user, const char *password)
: gnss{gnss}, port{port}, host{host}, mountPoint{mountPoint}, user{user}, password{password}, ntripClient{new WiFiClient}, state{NTRIPClientStates::closingConnection} : gnss{gnss}, port{port}, ntripClient{new WiFiClient}, state{NTRIPClientStates::closingConnection}
{ {
strcpy(this->host, host);
strcpy(this->mountPoint, mountPoint);
strcpy(this->user, user);
strcpy(this->password, password);
Component::loopDelay = NTRIPClient::loopDelay; Component::loopDelay = NTRIPClient::loopDelay;
} }
+6 -5
View File
@@ -120,12 +120,13 @@ private:
uint32_t lastGPGGAPushTime = 0; uint32_t lastGPGGAPushTime = 0;
uint32_t lastReconnectTime = 0; uint32_t lastReconnectTime = 0;
const char *host; static const uint8_t connectionDataLength = 32;
const char *mountPoint; char host[connectionDataLength];
const char *user; char mountPoint[connectionDataLength];
const char *password; char user[connectionDataLength];
char password[connectionDataLength];
const uint8_t maxReconnectAttemps = 10; const uint8_t maxReconnectAttemps = 10;
const uint16_t reconnectDelayTime = 1000; const uint16_t reconnectDelayTime = 5000;
const uint16_t timeOut = 10000; const uint16_t timeOut = 10000;
const uint16_t bufferSize = 512; const uint16_t bufferSize = 512;
const uint16_t bufferSizePushGPGGA = 128; const uint16_t bufferSizePushGPGGA = 128;
+2 -2
View File
@@ -89,7 +89,7 @@ void SensorData::enableGyroscope()
this->gyroscope->initialize(); this->gyroscope->initialize();
if (!this->gyroscope->testConnection()) if (!this->gyroscope->testConnection())
{ {
std::cout << "SensorData::enableGyroscope: Gyroskop is not conntected. Freeze!" << std::endl; std::cout << "SensorData::enableGyroscope: Gyroscope is not connected. Freeze!" << std::endl;
while (true) while (true)
{ {
} }
@@ -107,7 +107,7 @@ void SensorData::enableGyroscope()
{ {
this->gyroscope->CalibrateAccel(6); this->gyroscope->CalibrateAccel(6);
this->gyroscope->CalibrateGyro(6); this->gyroscope->CalibrateGyro(6);
this->gyroscope->PrintActiveOffsets(); // this->gyroscope->PrintActiveOffsets();
this->gyroscope->setDMPEnabled(true); this->gyroscope->setDMPEnabled(true);
} }
else else
+1 -1
View File
@@ -21,7 +21,7 @@
#include <SparkFun_u-blox_GNSS_Arduino_Library.h> #include <SparkFun_u-blox_GNSS_Arduino_Library.h>
#include <QMC5883LCompass.h> #include <QMC5883LCompass.h>
#include <MPU6050_6Axis_MotionApps20.h> #include <MPU6050_6Axis_MotionApps612.h>
#include "calcAzimuth.h" #include "calcAzimuth.h"
#include "ntripClient.h" #include "ntripClient.h"
+1 -1
View File
@@ -130,7 +130,7 @@ void setup()
static_cast<const char *>(NtripConfig::mountPoint), static_cast<const char *>(NtripConfig::mountPoint),
static_cast<const char *>(NtripConfig::user), static_cast<const char *>(NtripConfig::user),
static_cast<const char *>(NtripConfig::password)); static_cast<const char *>(NtripConfig::password));
// sensorData->enableGyroscope(); sensorData->enableGyroscope();
driveManager = new DriveManager(&moveController, sensorData, controlPad->getControlPadDataPtr()); driveManager = new DriveManager(&moveController, sensorData, controlPad->getControlPadDataPtr());
char wifiIndicator = 'X'; char wifiIndicator = 'X';