Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Compile Error Routines SHT2x
#1

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
Reply
#2

Hi,

(04-02-2024, 22:31)GerardvanA Wrote:  ...
but I would assume the code should compile ok for all options.
...

Your assumption is right, the code should compile fine for any of the user selectable options, and it does.


WeatherDuino Pro2 Universal TX AT328 - Version: 7.0_b003

[Image: GerardvanA_TXcompile.png]


I may be wrong but apparently it seems something related to sensors libraries.
If you got the TX software from here, then the package should include all the libraries in the correct version for the code to compile.

Please check this things:

- You are using the libraries included on the firmware package and not any other version no matter it is newer or older.
- Arduino IDE is using AVR boards version 1.6.21

Please let me know if this solved the problem.
Thank you.

Werk_AG

Reply
#3

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
Reply
#4

(05-02-2024, 03:06)GerardvanA Wrote:  ...
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)
...

Hi,

There is something strange here. On the SHT2x library that I'm using, the library uses 'GetTemperature' and not not 'getTemperature'.

As soon as I can, I will try to make a firmware package with only the Pro2 TX firmware and all the required libraries, exactly the ones I'm using, then I will post here some info to where to download it.
I should do it tomorow.

Rgs.
Werk_AG
Reply
#5

Hello again Gerard ,

As said I build a new software package with just the Pro2 TX software and all the required libraries, exactly the ones I'm using in my computer.
Please download it from here: https://www.meteocercal.info/forum/thread-2281.html

Let me know if that solved the compiling issue.

Rgs.
Werk_AG

Reply
#6

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
Reply
#7

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
Reply
#8

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
Reply




Users browsing this thread: 1 Guest(s)