Depth sensor Bar100 Keller LD - problem with the library?

Hi !

I work for the Limnology Center at EPFL (University of Lausanne - Switzerland).
We made an trigger system which have to start and stop an instrument (mounted on an autonomous profiler) depending on the depth (from 0 to 110m deep).
This trigger is made of an Arduino and a depth sensor in a bluerobotics enclosure. We were using the Bar30 sensor and everything was working great. But since the trigger will stay in a lake for weeks, we bought the Bar100 sensor. As it’s written on your website, the Bar30 sensor must be dried once per day or the values will drift…

But now we have a problem. I added the Keller LD library but it seems that something is wrong when I try to compile the code. Here is the message I have :

C:\Users\Aphys\Documents\Arduino\libraries\BlueRobotics_KellerLD_Library-master\KellerLD.cpp: In member function ‘void KellerLD::read()’:

C:\Users\Aphys\Documents\Arduino\libraries\BlueRobotics_KellerLD_Library-master\KellerLD.cpp:77:57: error: ‘P_mode’ was not declared in this scope

P_bar = (float(P)-16384)*(P_max-P_min)/32768 + P_min + P_mode;

                                                     ^~~~~~

C:\Users\Aphys\Documents\Arduino\libraries\BlueRobotics_KellerLD_Library-master\KellerLD.cpp:77:57: note: suggested alternative: ‘mode’

P_bar = (float(P)-16384)*(P_max-P_min)/32768 + P_min + P_mode;

                                                     ^~~~~~

                                                     mode

I have this error message on my code, but also on your example code. I am sorry, I am a beginner with Arduinos but I don’t understand what is the problem here. Is it a problem in the library ? Does someone have the same issue ?

Thanks a lot !
Guillaume

Hi @Guillaumeee,

P_mode was added quite recently to handle some additional sensor types, and it seems like in that process I forgot to update the header file to declare it (so yes, it’s a library issue - thanks for finding and reporting it, and sorry that you had to).

I’ve made a pull request to fix it here, which should hopefully be merged soon. In the meantime, you should be able to modify the file on your computer by yourself. You can find it at

C:\Users\Aphys\Documents\Arduino\libraries\BlueRobotics_KellerLD_Library-master\KellerLD.h

and I believe the only necessary change is adding float P_mode; at line 101, e.g. change

	float P_bar;
	float P_min;
	float P_max;

to

	float P_bar;
	float P_mode;
	float P_min;
	float P_max;

Would be great if you could report back if that indeed fixes the issue :slight_smile:

Hi Eliot,

Great ! Thanks a lot ! :grinning:

Today I am on the field, I will try in the next few days, I will let you know if it worked.

No worries, glad I could help :slight_smile:

I realised I can still compile without needing the sensor to test with, and adding that line does indeed make compiling work again. I’m currently in the process of getting a new version released so that it can be properly installed/updated through the Arduino Library Manager :slight_smile:

Confirming that this is now done. In the library manager the BlueRobotics Keller LD Library should be updatable to version 1.1.1, which includes this fix. If you’re not using the library manager, the code in the repository is also updated with the fix.

Thanks again for bringing this up :slight_smile:

Hi,

Everything works perfectly for me now ! I can compile the code :slightly_smiling_face:

Thanks again Eliott !!

1 Like