matthias-bs / BresserWeatherSensorReceiver

Bresser 5-in-1/6-in-1/7-in-1 868 MHz Weather Sensor Radio Receiver for Arduino based on CC1101, SX1276/RFM95W or SX1262
MIT License
100 stars 21 forks source link

New library -> adjust examples #133

Closed tonbor closed 5 months ago

tonbor commented 5 months ago

pragma message("Receiver chip: " RECEIVER_CHIP)

                                            ^

e:\Arduino files\libraries\BresserWeatherSensorReceiver\src/WeatherSensorCfg.h:538:170: note: #pragma message: Pin config: RST->RST_LoRa, CS->SS, GD0/G0/IRQ->DIO0, GDO2/G1/GPIO->DIO1

pragma message("Pin config: RST->" STR(PIN_RECEIVER_RST) ", CS->" STR(PIN_RECEIVER_CS) ", GD0/G0/IRQ->" STR(PIN_RECEIVER_IRQ) ", GDO2/G1/GPIO->" STR(PIN_RECEIVER_GPIO) )

                                                                                                                                                                      ^

E:\Arduino files\BresserWeatherSensorMQTT_Display_nosleep_copy_20240124113954\BresserWeatherSensorMQTT_Display_nosleep_copy_20240124113954.ino: In function 'void publishWeatherdata(bool)': E:\Arduino files\BresserWeatherSensorMQTT_Display_nosleep_copy_20240124113954\BresserWeatherSensorMQTT_Display_nosleep_copy_20240124113954.ino:600:36: error: invalid conversion from 'int' to 'bool' [-fpermissive] if (lightning.pastHour(events)) { ^~ In file included from E:\Arduino files\BresserWeatherSensorMQTT_Display_nosleep_copy_20240124113954\BresserWeatherSensorMQTT_Display_nosleep_copy_20240124113954.ino:198: e:\Arduino files\libraries\BresserWeatherSensorReceiver\src/Lightning.h:222:24: note: initializing argument 1 of 'int Lightning::pastHour(bool, int)' int pastHour(bool valid = nullptr, int *quality = nullptr);



exit status 1

Compilation error: invalid conversion from 'int' to 'bool*' [-fpermissive]
matthias-bs commented 5 months ago

That's what I marked as breaking change in the v0.22.0 Release Notes! ;-) If you update the sketch together with the library, everything will work again...

tonbor commented 5 months ago

So your new library is not backwards compatible. So the homemade sketches must all be adapted. Can you tell us what part?

Op di 30 jan. 2024 21:37 schreef Matthias Prinke @.***>:

That's what I marked as breaking change in the v0.22.0 Release Notes https://github.com/matthias-bs/BresserWeatherSensorReceiver/releases/tag/v0.22.0! ;-) If you update the sketch together with the library, everything will work again...

— Reply to this email directly, view it on GitHub https://github.com/matthias-bs/BresserWeatherSensorReceiver/issues/133#issuecomment-1917850239, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKD7IIR5OE5NVZXLGT2R3UTYRFK2LAVCNFSM6AAAAABCR4NW7GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJXHA2TAMRTHE . You are receiving this because you authored the thread.Message ID: @.*** com>

matthias-bs commented 5 months ago

See https://github.com/matthias-bs/BresserWeatherSensorReceiver/commit/cd7c14fc176a4cff224c1ad4f474519caccb2f97 for changes in the library and https://github.com/matthias-bs/BresserWeatherSensorReceiver/commit/beac20e61911112c05d15ec730c3d711322377ab for changes in the sketch. Previously, the counter value was passed to the caller by reference, now as return value. While the valid flag was formerly provided as return value, it is now passed via pointer (if required).

tonbor commented 5 months ago

Thanks

Op wo 31 jan. 2024 23:43 schreef Matthias Prinke @.***>:

See cd7c14f https://github.com/matthias-bs/BresserWeatherSensorReceiver/commit/cd7c14fc176a4cff224c1ad4f474519caccb2f97 for changes in the library and beac20e https://github.com/matthias-bs/BresserWeatherSensorReceiver/commit/beac20e61911112c05d15ec730c3d711322377ab for changes in the sketch.

— Reply to this email directly, view it on GitHub https://github.com/matthias-bs/BresserWeatherSensorReceiver/issues/133#issuecomment-1920110617, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKD7IIUGUP5U2BYQPYXMDK3YRLCJJAVCNFSM6AAAAABCR4NW7GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRQGEYTANRRG4 . You are receiving this because you authored the thread.Message ID: @.*** com>

tonbor commented 3 months ago

the domoticz example is not correct (any more) because of new implementation of rain calculation String(weatherSensor.sensor[i].w.rain_mm 100, 1); should be rain mm per hour domo2_payload = String("{\"idx\":") + String(DOMO_RAIN_IDX) + String(",\"nvalue\":0,\"svalue\":\"") + String(rainGauge.pastHour() 100, 1);

if (weatherSensor.sensor[i].w.rain_ok) { domo2_payload = String("{\"idx\":") + String(DOMO_RAIN_IDX) + String(",\"nvalue\":0,\"svalue\":\"") + String(weatherSensor.sensor[i].w.rain_mm * 100, 1); domo2_payload += String(";") + String(weatherSensor.sensor[i].w.rain_mm, 1); domo2_payload += String("\"}"); Serial.printf("%s: %s\n", MQTT_PUB_DOMO, domo2_payload.c_str()); client.publish(MQTT_PUB_DOMO, domo2_payload.c_str(), false, 0); }