Comments (5)
Sorry, I'm quite busy at the moment. I'll have a look at this as soon as my spare time permits.
from bresserweathersensorreceiver.
No problem.
Is mainly cosmetic.
from bresserweathersensorreceiver.
Hi,
o.k., let's discuss this step by step.
-
Order
data/LSDWetterSensor
(as in the example) orLSDWetterSensor/data
(your proposal)
The idea behind this was, thatdata
contains the topics for one or more sensors and nothing else.
If you prefer the second variant, you can just change the order of the format strings and the variables in thesnprintf()
function call
from// Try to map sensor ID to name to make MQTT topic explanatory for (int n=0; n<NUM_SENSORS; n++) { if (sensor_map[n].id == weatherSensor.sensor[i].sensor_id) { snprintf(mqtt_topic, TOPIC_SIZE+31, "%s/%s", mqttPubData, sensor_map[n].name.substr(0, 30).c_str()); break; } else { snprintf(mqtt_topic, TOPIC_SIZE+31, "%s/%8X", mqttPubData, weatherSensor.sensor[i].sensor_id); } }
to
// Try to map sensor ID to name to make MQTT topic explanatory for (int n=0; n<NUM_SENSORS; n++) { if (sensor_map[n].id == weatherSensor.sensor[i].sensor_id) { snprintf(mqtt_topic, TOPIC_SIZE+31, "%s/%s", sensor_map[n].name.substr(0, 30).c_str(), mqttPubData); break; } else { snprintf(mqtt_topic, TOPIC_SIZE+31, "%8X/%s", weatherSensor.sensor[i].sensor_id, mqttPubData); } }
The string length remains the same, so there is no risk of buffer overflow.
-
extra
as part of the sensor data
My idea was that to useextra
for any data not directly coming from a sensor, i.e. calculated data which might also be generated from signals received from different sensors. So it's basically a matter of taste and how you are using the topic. -
radio
as part of the sensor data
Yes, there is a strong correlation between the RSSI and the specific sensor, because the RSSI is read directly after receiving a message and finally assigned to the sensor's data structure after successful decoding. I agree. -
status
as part of the sensor data
status
provides information about the MQTT client and is not related to a specific sensor.
In general, you could move the topics around as you like - you just have to make sure that you do not exceed the buffer sizes. I think it makes sense to change the data types from char []
to String
.
After all, the examples are just... examples... not final software products.
But I will keep this in mind for the next release!
Best regards
Matthias
from bresserweathersensorreceiver.
Changed payload from char []
to String
in v0.11.0 as proposed above.
from bresserweathersensorreceiver.
Implemented 1. and 3. in v0.12.0
from bresserweathersensorreceiver.
Related Issues (20)
- 6-in-1 Decoder: Bresser 3-in-1 Professional Wind Gauge / Anemometer, PN 7002531 - automatic decoding of negative temperatures
- Upgraded to 0.20.0 from 0.19.5, now no data is received HOT 13
- Compile Error Wemos D1 mini with CC1101 with MQTT custom HOT 8
- Trouble with Heltec ESP32 WiFi LoRa 32(V3) / Wireless shell(V3) / Wireless stick lite (V3) SX1262 HOT 14
- Does it work with Bresser 3in1 as well? HOT 2
- Compatibility RFplayer HOT 1
- Radio sleep before ESP deep sleep to lower Power drain HOT 1
- decodeBresserLightningPayload(): Change counter decoding from binary to BCD
- Rain gauge no hour, day or week rapport HOT 3
- Config isn't saved HOT 4
- Unify RainGauge and Lightning classes
- New library -> adjust examples HOT 5
- MQTT example error affter upgrade
- Board Heltec WiFi Kit 32(V3) will not select SX1262 but SX1276 HOT 1
- Add support for Bresser CO2 PN 7009977 and HCHO/VOC PN 7009978 sensors
- Request for testing with Bresser CO2 sensor (P/N 7009977)
- Request for testing with Bresser HCHO/VOC sensor (P/N 7009978)
- Potential mix of weather sensor data using 6-in-1 decoder
- What receiver do you recommend? HOT 5
- rain implementation -> renew examples HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bresserweathersensorreceiver.