Water meter: Itron Aquadis+ with pulse sensor
-
@bisschopsr can you post the error message? Maybe that will help in fixing the error...
@hek: I agree with you, its not a float. I tried it to see how the interperter of VS responds. I did not mention this eralier, but I use the Visual Micro plugin in VS.
@Yveaux: I took a quick screenshot of the error message:
As I see it the interperter expects the function as it is, somehow it does report an error though.
Regards,
Ralph -
@hek: I agree with you, its not a float. I tried it to see how the interperter of VS responds. I did not mention this eralier, but I use the Visual Micro plugin in VS.
@Yveaux: I took a quick screenshot of the error message:
As I see it the interperter expects the function as it is, somehow it does report an error though.
Regards,
Ralph@bisschopsr thanks for posting the actual error message; that helps a lot :smile:
Apparently the type of pulseCount is volatile unsigned long.
The MyMessage class has no set() - method directly taking this type as input, so the compiler starts looking for the next closest match. It finds 3: bool, uint8_t and int32_t and can't make a choice. That's why you get the error.
To fix it, either change the type of pulseCount to one of the supported types, or cast it to one of these types just before calling the set() - method on the message. -
@bisschopsr thanks for posting the actual error message; that helps a lot :smile:
Apparently the type of pulseCount is volatile unsigned long.
The MyMessage class has no set() - method directly taking this type as input, so the compiler starts looking for the next closest match. It finds 3: bool, uint8_t and int32_t and can't make a choice. That's why you get the error.
To fix it, either change the type of pulseCount to one of the supported types, or cast it to one of these types just before calling the set() - method on the message.@Yveaux As you might have understood, I'm not that experienced in the language. But I think I get the explanation you gave. Indeed pulseCount is of type volatile unsigned long. So if I change it to for example int32_t, will the Arduino compiler still understand and use a similar type as unsigned long? On the other hand, I guess this is related to the libraries of mySensors, isn’t it? So should the library not support unsigned long as well?
Thanks again,
Ralph
-
@Yveaux As you might have understood, I'm not that experienced in the language. But I think I get the explanation you gave. Indeed pulseCount is of type volatile unsigned long. So if I change it to for example int32_t, will the Arduino compiler still understand and use a similar type as unsigned long? On the other hand, I guess this is related to the libraries of mySensors, isn’t it? So should the library not support unsigned long as well?
Thanks again,
Ralph
@bisschopsr depends... Currently the library understands a lot of c++ types, but not all as you have seen.
Choosing a comparable type will simply fix your issues. The int32_t is identical to unsigned long on Arduino, except for the sign. If your values do not exceed 2^31 you can just as well store it in an int32_t, but keep the volatile: volatile uint32_t pulseCount
Maybe we can add some template trickery to the library to support all c++ types. -
Hi
@bisschopsr : I try to put my TCRT5000 sensor on the Aquadis but I am not satisfied of the position/orientation. Would you send me a draw with the position of the two LEDS over the aquadis itron ?
thanks
-
Hi
@bisschopsr : I try to put my TCRT5000 sensor on the Aquadis but I am not satisfied of the position/orientation. Would you send me a draw with the position of the two LEDS over the aquadis itron ?
thanks
@samuel-wieczorek Hi Samuel. I positioned the sensor over the 1 liter wheel. I did not used the TCRT5000 module, but made a custom built PCB. Howver the principle is the same (in fact the schematics is 100% the same as the TCRT module.
If you go to https://www.openhardware.io/view/15/Itron-Aquadis-watermeter-sensor-V10 you can see pictures of the module. Some tips I can share with you:
Shield the sensor and the rotating disk area from incoming light. This influences the sensor. Use a piece of plastic tube for example. In NL we have electrical wire tubes that can be used (the grey ones)
Bring the sensor close to the disk. The reflection should do the rest. Setting up the TCRT is tricky as you have little room to manouver (considering reflection and the point where the schmit trigger swaps state)
Be aware that when the disk stops with the edge near the sensor you get false readings. That is why I swapped to a software driven solution using SW hysteresis on the arduino.
Hope this helps. If you can open it, I can share a DXF file with the sizes of the bottom plate I use. Let me know!Ralph