Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong data type in FRAME_SENSOR_TYPE_TABLE for Smart Water Xtreme sensors #51

Open
mereshow opened this issue Mar 11, 2022 · 0 comments

Comments

@mereshow
Copy link

The data type definitions table (FRAME_SENSOR_TYPE_TABLE) for the Smart Water Xtreme sensors in WaspFrameConstantsv15.h are not the same as the definitions (WTR_XTR_TYPE_TABLE) in WtrXtrFrameConstants.h, nor the same shown in the documentation.

For instance, WaspFrameConstantsv15.h says that WTRX_PHEHT_PH_B (140) is an uint8_t (type 0, 1 byte), but both the documentation and WtrXtrFrameConstants.h say that it is a float (type 2, 4 bytes).

The problem this causes: when I create a binary frame and add the values of Smart Water Xtreme sensors (PHEHT and NTU, for instance) like this:

// PHEHT - temperatura
frame.addSensor(WTRX_PHEHT_TC2_B, sensorPHEHT.sensorPHEHT.temperature);
// PHEHT - pH
frame.addSensor(WTRX_PHEHT_PH_B, sensorPHEHT.sensorPHEHT.pH);
// PHEHT - redox
frame.addSensor(WTRX_PHEHT_RX_B, sensorPHEHT.sensorPHEHT.redox);
// NTU - turbidez (NTUs)
frame.addSensor(WTRX_NTU_TN_C, sensorNTU.sensorNTU.turbidityNTU);

It gives the following error when creating the frame:

[FRAME] Error sensor type mismatch for index 140: api says 0 vs user says 2
[FRAME] Error sensor type mismatch for index 145: api says 0 vs user says 2
[FRAME] Error sensor type mismatch for index 181: 1 vs 2

The only solution is using for all float values a field I know is properly defined, such as WTRX_PHEHT_TC2_B, but then the code is misleading.

Analysing WaspFrameConstantsv15.h I think this file is not updated with the Smart Water Xtreme values (they are used for the industrial protocol values, that have different fields).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant