RS485 Wind Direction

userHead monica.cardenes 2023-03-15 22:42:49 622 Views2 Replies

When I do gcc -Wall -lwiringPi -o Wind_Speed *.c; the result is that. Can somebody help me?

2023-05-30 13:16:11

Hi, I encountered a few similar issues.. here's what I did to resolve - 

 

1) Check whether you've downloaded the correct WiringPi - 32-bit or 64-bit

WiringPi is required to be downloaded & run on Raspberry Pi. It has 32-bit (ARMHF) & 64-bit (ARM64) versions. The default instructions per DFRobot website to download the latest wiringpi library will auto-download the 32-bit version (WiringPi-ARMHF) which will not work on 64-bit Raspberry Pi.  If using 64-bit R PI, download Wiring Pi ARM64, filename "wiringpi-2.61-1-arm64.deb" from - https://github.com/WiringPi/WiringPi/releases/tag/2.61-1  Rename the downloaded filename from "wiringpi-2.61-1-arm64.deb" to "wiringpi-arm64.deb". This is to avoid Linux accidentally failing to install because it encounters a dot after "2" in the "2.61" of the filename.  To install it, open a Command Line Interface Terminal, direct it to the folder where it has been downloaded to with cd and use the dpkg command:>> dpkg -i wiringpi-arm64.deb   

2) Change variable declaration from ‘int’ to ‘static int’

Open the header file "RS485_Wind_Speed_Transmitter.h" & change line 14 "int fd" to "static int fd". Save the file. 

 

 

3) C compilation order

Instead of DFRobot website compilation instructions which is below - >> gcc -Wall -lwiringPi -o Wind_Speed *.c>> sudo ./Wind_SpeedChange the order of the compilation ("-lwiringPi" at the last instead of in the middle) as written below then compile as below - >> sudo gcc -Wall -o Wind_Speed *.c -lwiringPi 

 

Then type the below to see the windspeed reading in the Command Line Interface- 

>> sudo ./Wind_Speed 

 

Hope it helps.

userHeadPic Liam.Eric
2023-03-17 14:17:42

Have you change the min.c file befor doing gcc?

For more information about RS485 Wind Direction Transmitter(SKU:SEN0482), please see the link below.

https://wiki.dfrobot.com/RS485_Wind_Direction_Transmitter_SKU_SEN0482#target_5

 

 

userHeadPic NeloKin