Posts: 13
Threads: 3
Joined: Jan 2024
Country:
I've been given 3 TX and 1 RX board, and am trying to set them up for my first WX station. I've got the RX mainly working, but am getting a compile error for the TX (TH_SENSOR0 is defined as 0)
==================================================
Routines:10:22: error: expected primary-expression before '.' token
T_ExtS0 = SHT2x.getTemperature() * 100.0;
^
Routines:11:22: error: expected primary-expression before '.' token
H_ExtS0 = SHT2x.getHumidity() * 100.0;
^
exit status 1
expected primary-expression before '.' token
==================================================
With the TH_SENSOR0 defined to 1 (and also 9 (no sensor)) the code compiles ok.
With it set to 2 I get other errors.
Since I'm trying to re-set up the gear I've been given without much data on it, I'm not sure what sensors I've got, but I would assume the code should compile ok for all options.
Any ideas?
Thanks
Posts: 13
Threads: 3
Joined: Jan 2024
Country:
Hi,
Thanks for your reply.
I have got the AVR Boards v 1.6.21 (compiling for a Nano using the Old bootloader (tried the others but no difference).
It was great to have all the libraries with the code, however I did have to get some that the IDE indicated were missing. I can't recall details anymore on which ones, so went back to the supplied Libraries (deleted my folder). To make sure I'm using that library my IDE skethbook location is set to:
/home/gerard/Arduino/WeatherDuino/WeatherDuino_Pro2_Compact
So compiling the TX firmware gives this error:
=======================================
WeatherDuino_Pro2_Universal_TX_v7.0_b003:56:72: fatal error: HTU21D.h: No such file or directory
#include <HTU21D.h> // library for HTU21 Temp/Hum Sensor
^
compilation terminated.
exit status 1
HTU21D.h: No such file or directory
==============================================
I installed that library, and then the compile gets to the SHT2x problem: (note this is different in the upper/lowercase of some statements, as I started again with the supplied code in the rar file. I'm running a Linux system and because that tends to be more case sensitive, I'd changed the case of 'GetTemperature' to getTemperature' as it's written like that in the library file, to see if that was the problem)
==============================================================
/home/gerard/Arduino/WeatherDuino/WeatherDuino_Pro2_Compact/software/TX software/WeatherDuino_Pro2_Universal_TX_v7.0_b003/Routines.ino: In function 'void read_SHT21()':
Routines:10:22: error: expected primary-expression before '.' token
T_ExtS0 = SHT2x.GetTemperature() * 100.0;
^
Routines:11:22: error: expected primary-expression before '.' token
H_ExtS0 = SHT2x.GetHumidity() * 100.0;
^
exit status 1
expected primary-expression before '.' token
============================================================
Any further clues as what I can have set wrong?
Thanks, Gerard
Posts: 13
Threads: 3
Joined: Jan 2024
Country:
Thanks for that, I can now compile the TX software.
However only after renaming the 'Library' folder to 'library' (first letter case changed)!
Not doing this the IDE created a new (empty) 'library' folder.
I see the SHT2x library is from 2013, while the one I had is from 2023, so there might have been changes in that.
Ok, so I can now move onto the next step, but that may have to wait till the weekend.
Thanks again for the support.
Gerard
Posts: 5.358
Threads: 333
Joined: Apr 2014
Weather Station: WeatherDuino 4Pro
Country:
Hi,
Good to know you could compile the code now.
Don't know how it is on Linux, but on windows usually libraries are installed here: "C:\Users\userName\Documents\Arduino\libraries"
Rgs.
Werk_AG
Posts: 13
Threads: 3
Joined: Jan 2024
Country:
Yes, on Linux the folders are similar. However to make sure I was only using the library supplied with the WD TX software, I set the sketch location to where I extracted those files. And as the IDE didn't find a 'library' folder (as it was named 'Library'), it created it there automatically.
I'll merge them with my normal library, but will be careful to keep the correct version of the SHT2x library!
Cheers,
Gerard