BLE Names and no WX module no Wx Tx fix
This commit is contained in:
parent
a0b9eb14d7
commit
98557c3883
|
|
@ -530,8 +530,8 @@
|
|||
<div class="col-6 mt-1">
|
||||
<label for="bluetooth.type" class="form-label">Bluetooth Type</label>
|
||||
<select name="bluetooth.type" id="bluetooth.type" class="form-control">
|
||||
<option value="0">BT Classic</option>
|
||||
<option value="1">BLE for iPhone</option>
|
||||
<option value="0">BLE for iPhone</option>
|
||||
<option value="1">BT Classic</option>
|
||||
<option value="2">BLE for Android</option>
|
||||
</select>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ BLECharacteristic *pCharacteristicTx;
|
|||
BLECharacteristic *pCharacteristicRx;
|
||||
|
||||
extern Configuration Config;
|
||||
extern Beacon *currentBeacon;
|
||||
extern logging::Logger logger;
|
||||
extern bool sendBleToLoRa;
|
||||
extern bool bluetoothConnected;
|
||||
|
|
@ -69,10 +70,9 @@ namespace BLE_Utils {
|
|||
}
|
||||
|
||||
void setup() {
|
||||
uint8_t dmac[6];
|
||||
esp_efuse_mac_get_default(dmac);
|
||||
std::string BLEid = "LoRa Tracker " + std::to_string(dmac[4]) + std::to_string(dmac[5]);
|
||||
BLEDevice::init(BLEid);
|
||||
String id = currentBeacon->callsign;
|
||||
String BLEid = id.substring(0, id.indexOf("-")) + "-BLE";
|
||||
BLEDevice::init(BLEid.c_str());
|
||||
pServer = BLEDevice::createServer();
|
||||
pServer->setCallbacks(new MyServerCallbacks());
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
|
||||
extern Configuration Config;
|
||||
extern Beacon *currentBeacon;
|
||||
extern BluetoothSerial SerialBT;
|
||||
extern logging::Logger logger;
|
||||
extern TinyGPSPlus gps;
|
||||
|
|
@ -35,12 +36,10 @@ namespace BLUETOOTH_Utils {
|
|||
SerialBT.register_callback(BLUETOOTH_Utils::bluetoothCallback);
|
||||
SerialBT.onData(BLUETOOTH_Utils::getData); // callback instead of while to avoid RX buffer limit when NMEA data received
|
||||
|
||||
uint8_t dmac[6];
|
||||
esp_efuse_mac_get_default(dmac);
|
||||
char ourId[5];
|
||||
snprintf(ourId, sizeof(ourId), "%02x%02x", dmac[4], dmac[5]);
|
||||
String id = currentBeacon->callsign;
|
||||
String BTid = id.substring(0, id.indexOf("-")) + "-BT";
|
||||
|
||||
if (!SerialBT.begin(String("LoRa Tracker " + String(ourId)))) {
|
||||
if (!SerialBT.begin(String(BTid))) {
|
||||
logger.log(logging::LoggerLevel::LOGGER_LEVEL_ERROR, "Bluetooth", "Starting Bluetooth failed!");
|
||||
displayShow("ERROR", "Starting Bluetooth failed!", "");
|
||||
while(true) {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ float newHum, newTemp, newPress, newGas;
|
|||
uint32_t bmeLastReading = -60000;
|
||||
int wxModuleType = 0;
|
||||
uint8_t wxModuleAddress = 0x00;
|
||||
bool wxModuleFound = false;
|
||||
|
||||
|
||||
Adafruit_BME280 bme280;
|
||||
|
|
@ -54,7 +55,6 @@ namespace BME_Utils {
|
|||
if (Config.bme.active) {
|
||||
getWxModuleAddres();
|
||||
if (wxModuleAddress != 0x00) {
|
||||
bool wxModuleFound = false;
|
||||
#ifdef HELTEC_V3_GPS
|
||||
if (bme280.begin(wxModuleAddress, &Wire1)) {
|
||||
logger.log(logging::LoggerLevel::LOGGER_LEVEL_INFO, "BME", " BME280 sensor found");
|
||||
|
|
@ -245,7 +245,7 @@ namespace BME_Utils {
|
|||
if (type == 1) {
|
||||
wx = " - C - % - hPa";
|
||||
} else {
|
||||
wx = ".../...g...t...r...p...P...h..b.....";
|
||||
wx = ".../...g...t...";
|
||||
}
|
||||
return wx;
|
||||
} else {
|
||||
|
|
@ -275,7 +275,7 @@ namespace BME_Utils {
|
|||
} else {
|
||||
wx = ".../...g...t";
|
||||
wx += tempStr;
|
||||
wx += "r...p...P...h";
|
||||
wx += "h";
|
||||
wx += humStr;
|
||||
wx += "b";
|
||||
wx += presStr;
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ extern bool smartBeaconActive;
|
|||
extern bool winlinkCommentState;
|
||||
|
||||
extern int wxModuleType;
|
||||
extern bool wxModuleFound;
|
||||
extern bool gpsIsActive;
|
||||
extern bool gpsShouldSleep;
|
||||
|
||||
|
|
@ -210,12 +211,12 @@ namespace STATION_Utils {
|
|||
}
|
||||
|
||||
String packet;
|
||||
if (Config.bme.sendTelemetry && type == 1) { // WX
|
||||
if (Config.bme.sendTelemetry && wxModuleFound && type == 1) { // WX
|
||||
packet = APRSPacketLib::generateGPSBeaconPacket(currentBeacon->callsign, "APLRT1", Config.path, "/", APRSPacketLib::encodeGPS(gps.location.lat(),gps.location.lng(), gps.course.deg(), 0.0, currentBeacon->symbol, Config.sendAltitude, gps.altitude.feet(), sendStandingUpdate, "Wx"));
|
||||
if (wxModuleType != 0) {
|
||||
packet += BME_Utils::readDataSensor(0);
|
||||
} else {
|
||||
packet += ".../...g...t...r...p...P...h..b.....";
|
||||
packet += ".../...g...t...";
|
||||
}
|
||||
} else {
|
||||
String path = Config.path;
|
||||
|
|
|
|||
Loading…
Reference in New Issue