new ntrip client

This commit is contained in:
2022-09-21 12:50:01 +02:00
parent af6cb98898
commit a1a976be57
15 changed files with 658 additions and 251 deletions
+10 -2
View File
@@ -19,6 +19,7 @@
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <BluetoothSerial.h>
#include <ESP32Ping.h>
#include "config.h"
@@ -74,8 +75,16 @@ void setup() {
Network::setIps();
Network::setupMQTT();
wifiIsActive = Network::connectWifi();
driveManager = new DriveManager(&moveController, wifiIsActive);
if (wifiIsActive) {
driveManager = new DriveManager(&moveController, true);
const char* remoteHost = "www.google.com";
std::cout << "Pinging host: " << remoteHost << std::endl;
if (Ping.ping(remoteHost))
std::cout << "Ping successful..." << std::endl;
else
std::cout << "Ping failed. :/" << std::endl;
if (Network::checkMQTT()) {
DebugMqtt::init(Network::getMqttClient(), Loglevel::debug);
std::cout << "Activate additional output via MQTT..." << std::endl;
@@ -85,7 +94,6 @@ void setup() {
outputBuf = new OutputBuf();
wifiIndicator = '-';
} else {
driveManager = new DriveManager(&moveController);
outputBuf = new OutputBuf();
}
std::cout.rdbuf(outputBuf);