mirror of
https://github.com/thelsing/knx.git
synced 2026-03-07 02:17:30 +01:00
Arduino set Knx uart bugfix (#32)
* bugfix, print not allowed in constructor * Update tpuart_data_link_layer.cpp - start confirm timout only after last byte was sent - increase BYTE_TIMEOUT * -bugfix Arduino set knxUart * Update knx-bme680.ino * Update knx-demo.ino * Update knx-hdc1008.ino * Update knx-sonoffS20.ino * Update knx-bme680.ino * Update knx-demo.ino * Update arduino_platform.cpp * Update dpt.h * Update esp32_platform.h * Update esp_platform.h
This commit is contained in:
@@ -42,10 +42,10 @@ bool trigger = false;
|
||||
// Entry point for the example
|
||||
void setup(void)
|
||||
{
|
||||
SerialDBG.begin(115200);
|
||||
ArduinoPlatform::SerialDebug = SerialDBG;
|
||||
Serial.begin(115200);
|
||||
ArduinoPlatform::SerialDebug = Serial;
|
||||
delay(5000);
|
||||
SerialDBG.println("start");
|
||||
Serial.println("start");
|
||||
|
||||
#ifdef ARDUINO_ARCH_ESP8266
|
||||
WiFiManager wifiManager;
|
||||
@@ -92,8 +92,8 @@ void setup(void)
|
||||
if (knx.configured())
|
||||
{
|
||||
cyclSend = knx.paramInt(0);
|
||||
SerialDBG.print("Zykl. send:");
|
||||
SerialDBG.println(cyclSend);
|
||||
Serial.print("Zykl. send:");
|
||||
Serial.println(cyclSend);
|
||||
goRawTemperature.dataPointType(Dpt(9, 1));
|
||||
goPressure.dataPointType(Dpt(9, 1));
|
||||
goRawHumidity.dataPointType(Dpt(9, 1));
|
||||
@@ -112,7 +112,7 @@ void setup(void)
|
||||
iaqSensor.updateSubscription(sensorList, sizeof(sensorList)/sizeof(bsec_virtual_sensor_t), BSEC_SAMPLE_RATE_LP);
|
||||
checkIaqSensorStatus();
|
||||
String output = "Timestamp [ms], raw temperature [°C], pressure [hPa], raw relative humidity [%], gas [Ohm], IAQ, IAQ accuracy, temperature [°C], relative humidity [%], CO2";
|
||||
SerialDBG.println(output);
|
||||
Serial.println(output);
|
||||
}
|
||||
|
||||
// Function that is looped forever
|
||||
@@ -150,7 +150,7 @@ void loop(void)
|
||||
output += ", " + String(iaqSensor.runInStatus);
|
||||
output += ", " + String(iaqSensor.stabStatus);
|
||||
|
||||
SerialDBG.println(output);
|
||||
Serial.println(output);
|
||||
updateState();
|
||||
|
||||
if (sendCounter++ == cyclSend || trigger)
|
||||
@@ -180,26 +180,26 @@ void checkIaqSensorStatus(void)
|
||||
if (iaqSensor.status != BSEC_OK) {
|
||||
if (iaqSensor.status < BSEC_OK) {
|
||||
String output = "BSEC error code : " + String(iaqSensor.status);
|
||||
SerialDBG.println(output);
|
||||
Serial.println(output);
|
||||
for (;;)
|
||||
errLeds(); /* Halt in case of failure */
|
||||
}
|
||||
else {
|
||||
String output = "BSEC warning code : " + String(iaqSensor.status);
|
||||
SerialDBG.println(output);
|
||||
Serial.println(output);
|
||||
}
|
||||
}
|
||||
|
||||
if (iaqSensor.bme680Status != BME680_OK) {
|
||||
if (iaqSensor.bme680Status < BME680_OK) {
|
||||
String output = "BME680 error code : " + String(iaqSensor.bme680Status);
|
||||
SerialDBG.println(output);
|
||||
Serial.println(output);
|
||||
for (;;)
|
||||
errLeds(); /* Halt in case of failure */
|
||||
}
|
||||
else {
|
||||
String output = "BME680 warning code : " + String(iaqSensor.bme680Status);
|
||||
SerialDBG.println(output);
|
||||
Serial.println(output);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -216,10 +216,10 @@ void errLeds(void)
|
||||
uint8_t* loadBme680State(uint8_t* buffer)
|
||||
{
|
||||
// Existing state in EEPROM
|
||||
SerialDBG.println("Reading state from EEPROM");
|
||||
Serial.println("Reading state from EEPROM");
|
||||
|
||||
for (uint8_t i = 0; i < BSEC_MAX_STATE_BLOB_SIZE; i++) {
|
||||
SerialDBG.println(buffer[i], HEX);
|
||||
Serial.println(buffer[i], HEX);
|
||||
}
|
||||
|
||||
iaqSensor.setState(buffer);
|
||||
@@ -232,10 +232,10 @@ uint8_t* saveBme680State(uint8_t* buffer)
|
||||
iaqSensor.getState(buffer);
|
||||
checkIaqSensorStatus();
|
||||
|
||||
SerialDBG.println("Writing state to EEPROM");
|
||||
Serial.println("Writing state to EEPROM");
|
||||
|
||||
for (uint8_t i = 0; i < BSEC_MAX_STATE_BLOB_SIZE; i++) {
|
||||
SerialDBG.println(buffer[i], HEX);
|
||||
Serial.println(buffer[i], HEX);
|
||||
}
|
||||
return buffer + BSEC_MAX_STATE_BLOB_SIZE;
|
||||
}
|
||||
@@ -266,8 +266,8 @@ void updateState(void)
|
||||
// callback from trigger-GO
|
||||
void triggerCallback(GroupObject& go)
|
||||
{
|
||||
SerialDBG.println("trigger");
|
||||
SerialDBG.println((bool)go.value());
|
||||
Serial.println("trigger");
|
||||
Serial.println((bool)go.value());
|
||||
if (!go.value())
|
||||
return;
|
||||
|
||||
@@ -275,11 +275,11 @@ void triggerCallback(GroupObject& go)
|
||||
/* We call bsec_update_subscription() in order to instruct BSEC to perform an extra measurement at the next
|
||||
possible time slot
|
||||
*/
|
||||
SerialDBG.println("Triggering ULP plus.");
|
||||
Serial.println("Triggering ULP plus.");
|
||||
bsec_virtual_sensor_t sensorList[] = {
|
||||
BSEC_OUTPUT_IAQ, BSEC_OUTPUT_CO2_EQUIVALENT
|
||||
};
|
||||
|
||||
iaqSensor.updateSubscription(sensorList, 1, BSEC_SAMPLE_RATE_ULP_MEASUREMENT_ON_DEMAND);
|
||||
checkIaqSensorStatus();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,8 +54,8 @@ void resetCallback(GroupObject& go)
|
||||
|
||||
void setup()
|
||||
{
|
||||
SerialDBG.begin(115200);
|
||||
ArduinoPlatform::SerialDebug = SerialDBG;
|
||||
Serial.begin(115200);
|
||||
ArduinoPlatform::SerialDebug = Serial;
|
||||
|
||||
randomSeed(millis());
|
||||
|
||||
@@ -77,16 +77,16 @@ void setup()
|
||||
goMin.dataPointType(DPT_Value_Temp);
|
||||
goMax.dataPointType(DPT_Value_Temp);
|
||||
|
||||
SerialDBG.print("Timeout: ");
|
||||
SerialDBG.println(knx.paramByte(0));
|
||||
SerialDBG.print("Zykl. senden: ");
|
||||
SerialDBG.println(knx.paramByte(1));
|
||||
SerialDBG.print("Min/Max senden: ");
|
||||
SerialDBG.println(knx.paramByte(2));
|
||||
SerialDBG.print("Aenderung senden: ");
|
||||
SerialDBG.println(knx.paramByte(3));
|
||||
SerialDBG.print("Abgleich: ");
|
||||
SerialDBG.println(knx.paramByte(4));
|
||||
Serial.print("Timeout: ");
|
||||
Serial.println(knx.paramByte(0));
|
||||
Serial.print("Zykl. senden: ");
|
||||
Serial.println(knx.paramByte(1));
|
||||
Serial.print("Min/Max senden: ");
|
||||
Serial.println(knx.paramByte(2));
|
||||
Serial.print("Aenderung senden: ");
|
||||
Serial.println(knx.paramByte(3));
|
||||
Serial.print("Abgleich: ");
|
||||
Serial.println(knx.paramByte(4));
|
||||
}
|
||||
|
||||
// pin or GPIO the programming led is connected to. Default is LED_BUILTIN
|
||||
@@ -110,4 +110,4 @@ void loop()
|
||||
return;
|
||||
|
||||
measureTemp();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,10 +21,10 @@ uint32_t cyclSend = 0;
|
||||
// Entry point for the example
|
||||
void setup(void)
|
||||
{
|
||||
SerialDBG.begin(115200);
|
||||
ArduinoPlatform::SerialDebug = SerialDBG;
|
||||
Serial.begin(115200);
|
||||
ArduinoPlatform::SerialDebug = Serial;
|
||||
delay(5000);
|
||||
SerialDBG.println("start");
|
||||
Serial.println("start");
|
||||
|
||||
#ifdef ARDUINO_ARCH_ESP8266
|
||||
WiFiManager wifiManager;
|
||||
@@ -45,15 +45,15 @@ void setup(void)
|
||||
{
|
||||
|
||||
cyclSend = knx.paramInt(0);
|
||||
SerialDBG.print("Zykl. send:");
|
||||
SerialDBG.println(cyclSend);
|
||||
Serial.print("Zykl. send:");
|
||||
Serial.println(cyclSend);
|
||||
}
|
||||
|
||||
// start the framework.
|
||||
knx.start();
|
||||
|
||||
String output = "Timestamp [ms], temperature [°C], relative humidity [%]";
|
||||
SerialDBG.println(output);
|
||||
Serial.println(output);
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ void loop(void)
|
||||
String output = String(millis());
|
||||
output += ", " + String(temp);
|
||||
output += ", " + String(humi);
|
||||
SerialDBG.println(output);
|
||||
Serial.println(output);
|
||||
|
||||
if (sendCounter++ == cyclSend)
|
||||
{
|
||||
|
||||
@@ -24,8 +24,8 @@ void switchCallback(GroupObject& go)
|
||||
|
||||
void setup()
|
||||
{
|
||||
SerialDBG.begin(115200);
|
||||
ArduinoPlatform::SerialDebug = SerialDBG;
|
||||
Serial.begin(115200);
|
||||
ArduinoPlatform::SerialDebug = Serial;
|
||||
|
||||
#ifdef ARDUINO_ARCH_ESP8266
|
||||
WiFiManager wifiManager;
|
||||
|
||||
Reference in New Issue
Block a user