magellannh / rtl-wx

RTL-Wx logs data from 433Mhz wireless sensors using an RTL-SDR dongle. The Wiki has some screenshots of the results
GNU General Public License v2.0
21 stars 7 forks source link

Compile error - convenience_static #6

Open MartinSwanepoel opened 9 years ago

MartinSwanepoel commented 9 years ago

Keep getting this compile error:

gcc -O3 -Wall -Wextra -Wno-unused -Wsign-compare -g3 -fvisibility=hidden -o rtl-wx obj/rtl-wx.o obj/TagProc.o obj/DataStore.o obj/ConfProc.o obj/Scheduler.o obj/Util.o obj/rtl-433fm-demod.o obj/rtl-433fm-decode.o obj/getopt.o -Wl,-Bstatic -lconvenience_static -lrtlsdr -Wl,-Bdynamic -lpthread -lusb-1.0 -lm -L. -Llibrtlsdr/build/src /usr/bin/ld: cannot find -lconvenience_static collect2: ld returned 1 exit status Makefile:69: recipe for target 'rtl-wx' failed

Any idea how this can be fixed?

Thanks

magellannh commented 9 years ago

convenience_static is part of the librtlsdr package and this package must be built before you can build rtl-wx.

Complete instructions for installing on a raspberry pi can be found here: https://github.com/magellannh/rtl-wx/blob/master/doc/RaspberryPi-Install-Instructions/RaspberryPi%20Installation%20Instructions.txt

MartinSwanepoel commented 9 years ago

Did complile it. Can it be a path issue?

pi@Oregon ~/rtl-wx/src/librtlsdr/librtlsdr-0.5.3/build $ make Scanning dependencies of target convenience_static [ 5%] Building C object src/CMakeFiles/convenience_static.dir/convenience/convenience.c.o Linking C static library libconvenience_static.a [ 5%] Built target convenience_static Scanning dependencies of target rtlsdr_shared

On Sun, May 31, 2015 at 1:25 PM, magellannh notifications@github.com wrote:

convenience_static is part of the librtlsdr package and this package must be built before you can build rtl-wx.

Complete instructions for installing on a raspberry pi can be found here:

https://github.com/magellannh/rtl-wx/blob/master/doc/RaspberryPi-Install-Instructions/RaspberryPi%20Installation%20Instructions.txt

— Reply to this email directly or view it on GitHub https://github.com/magellannh/rtl-wx/issues/6#issuecomment-107158489.

MartinSwanepoel commented 9 years ago

copy from rtl-wx\src\librtlsdr\src\convenience to rtl-wx\src\librtlsdr\include

Do you copy convenience.h to include.h or is it a folder include with convenience.h in it ?

On Sun, May 31, 2015 at 1:25 PM, magellannh notifications@github.com wrote:

convenience_static is part of the librtlsdr package and this package must be built before you can build rtl-wx.

Complete instructions for installing on a raspberry pi can be found here:

https://github.com/magellannh/rtl-wx/blob/master/doc/RaspberryPi-Install-Instructions/RaspberryPi%20Installation%20Instructions.txt

— Reply to this email directly or view it on GitHub https://github.com/magellannh/rtl-wx/issues/6#issuecomment-107158489.

magellannh commented 9 years ago

Re: copy from rtl-wx\src\librtlsdr\src\convenience to rtl-wx\src\librtlsdr\include

That's only needed if you get a compile error when building librtlsdr. Your error seems to be a link error not a compile error.

magellannh commented 9 years ago

From the build snippet you submitted, it looks like your librtlsdr directory has a version number tacked onto the end of it. The makefile isn't set up by default to handle that. I think you can fix it by changing the makefile var LIBRTLSDR_DIR to point to the correct directory name.

MartinSwanepoel commented 9 years ago

OK finally it seems everything is running, but I don't get any data. Got a THGN800 temp sensor and a WGR800 wind direction / speed meter. This is in the log file:

Mon Jun 1 16:01:15 2015 RTL-Wx: Unable to create client send fifo:/tmp/WX_serverReceive Exiting...

Thanks, Martin

On Sun, May 31, 2015 at 2:28 PM, magellannh notifications@github.com wrote:

From the build snippet you submitted, it looks like your librtlsdr directory has a version number tacked onto the end of it. The makefile isn't set up by default to handle that. I think you can fix it by changing the makefile var LIBRTLSDR_DIR to point to the correct directory name.

— Reply to this email directly or view it on GitHub https://github.com/magellannh/rtl-wx/issues/6#issuecomment-107169942.

magellannh commented 9 years ago

That's probably a file permission error. The user that the software is running under needs to have write access to /tmp. I thought that was the default behavior on a pi, but maybe it isn't. Or maybe /tmp isn't automatically created?

magellannh commented 9 years ago

Also, as a test you could try running the software in standalone mode to see if everything else is working aside from the file permission issue.

Invoke the program in standalone mode using: rtl-wx -s

There's more documentation at these links: https://github.com/magellannh/rtl-wx/blob/master/doc/UsersGuide.txt https://github.com/magellannh/rtl-wx/blob/master/doc/UsersGuide-Advanced.txt

MartinSwanepoel commented 9 years ago

Thanks for the patience!!!!

This is output captured in standalone mode:

root@Oregon:~/rtl-wx/bin# ./rtl-wx -s Ready to gather weather sensor data

                                   <<Hit 'h' for help, any key for

status, ESC to quit>>

Found 1 device(s):

0: Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM Found Rafael Micro R820T tuner Tuner gain set to automatic. Tuner error set to 56 ppm.

Tuned to 433925000 Hz.

Oversampling input by: 9x.

Oversampling output by: 1x.

Buffer size: 16384kB 7.59ms Exact sample rate is: 1080000.025749 Hz Sampling at 1080000 S/s.

Output at 120000 Hz.

Registering protocol[01] Oregon Scientific Weather Sensor

RTL-Wx Weather Data Monitoring Software

                  This program attempts to collect data from 433Mhz

wireless weather sensors

or an Oregon Scientific weather station connected through a serial port.

Commands:

h - help (this message) a - Display Action Scheduler Info

c - Process configuration file

d - Show debugging statistics

e - Show energy data (kilowatts) for last 15 mins f - invoke file parser - to replace tags w/data

i - Show config info

l - clear log file (rtl-wx.log) m - show historical max/min data

n - clear historical max/min data

r - reset sensor lock codes and clear timeout counts s - Save data snapshot now t - Toggle raw sensor message display mode

u - Initiate FTP upload

v - (not implemented) Trim CSV files (older entries removed w - Save webcam snapshot

q - quit client (server stays running)

ESC - Kill server (and quit client)

Date: 06/01/2015 Time: 18:27:19 Uptime: 0 hours, 2 Minutes Messages Processed: 15 Messages With Errors: 22 Lock Lock Code 300 sec. Snapshot Sensor Name Code Mismatches Timeouts Timeouts Last Valid Message Received Sunroom (Ch 1) 0xce 0 0 0 06/01/2015 at 18:27:09 (Msg# 15) Efergy Sensor 0x89 0 0 0 06/01/2015 at 18:26:53 (Msg# 14) Sensor Locking is DISABLED (edit rtl-wx.conf to change) ``` Date: 06/01/2015 Time: 18:28:31 Uptime: 0 hours, 4 Minutes ``` Messages Processed: 20 Messages With Errors: 33 Lock Lock Code 300 sec. Snapshot Sensor Name Code Mismatches Timeouts Timeouts Last Valid Message Received Sunroom (Ch 1) 0xce 0 0 0 06/01/2015 at 18:28:02 (Msg# 18) Efergy Sensor 0x89 0 0 0 06/01/2015 at 18:28:29 (Msg# 20) Sensor Locking is DISABLED (edit rtl-wx.conf to change) RTL-433FM OWL Msg: 29 14 0d 50 00 00 77 88 00 04 90 00 00 (Error Detected) OWLCM119 Error: Current: 21 (watts) Total:11597793.000 (kW) RTL-433FM Efergy: 08 6a 89 40 60 00 05 a0 00 ff ff ff 00 00 04 00 b8 71 0e 00 kW: 24.000 RTL-433FM OS Msg: f8 24 1c e2 03 20 82 81 59 00 00 00 00 00 00 00 00 00 00 00 RTL-433FM OWL Msg: 19 84 0f 30 50 c0 00 00 09 3d 60 00 00 (Error Detected) OWLCM119 Error: Current: 86028 (watts) Total:8559059.000 (kW) RTL-433FM Efergy Msg: 08 6a 89 40 b3 32 0a 64 00 ff ff ff 00 00 04 00 b4 71 0e 00 (Error Detected) RTL-433FM OWL Msg: 19 84 0f 30 50 c0 00 00 09 3d 60 00 00 (Error Detected) OWLCM119 Error: Current: 86028 (watts) Total:8559059.000 (kW) RTL-433FM Efergy Msg: 08 6a 89 40 c3 a2 02 e4 00 00 00 00 00 00 04 00 b8 71 0e 00 (Error Detected) root@Oregon:~/rtl-wx/www# more rtl-wx-latest.csv Time,efergyWatts,efergyLastHr,efergyLastDay,owlWatts,owlLastHr,owlLastDay,fuelGallonsLastHr,fuelLastDay,fuelTotal,oduTemp,oduDewpoint,iduTemp,iduDewpoint,ext1Temp,ext1Dewpoint,e xt2Temp,ext2Dewpoint,ext3Temp,ext3Dewpoint,ext4Temp,ext4Dewpoint,iduSealevelPressure 1433176020,23932,0,0,-99,0,0,-99.00,0.00,0.00,-99.0,-99.0,-99.0,-99.0,73.2,39.1,-99.0,-99.0,-99.0,-99.0,-99.0,-99.0, 0.00 This is the normal rtl-433 output: root@Oregon:~/rtl_433/build/src# ./rtl_433 Registering protocol "Silvercrest Remote Control" Registering protocol "Rubicson Temperature Sensor" Registering protocol "Prologue Temperature Sensor" Registering protocol "Waveman Switch Transmitter" Registering protocol "Steffen Switch Transmitter" Registering protocol "ELV EM 1000" Registering protocol "ELV WS 2000" Registering protocol "LaCrosse TX Temperature / Humidity Sensor" Registering protocol "Acurite 5n1 Weather Station" Registering protocol "Acurite 896 Rain Gauge" Registering protocol "Acurite Temperature and Humidity Sensor" Registering protocol "Oregon Scientific Weather Sensor" Registering protocol "Mebus 433" Registering protocol "Intertechno 433" Registering protocol "KlikAanKlikUit Wireless Switch" Registering protocol "AlectoV1 Weather Sensor" Registering protocol "Cardin S466-TX2" Registering protocol "Fine Offset Electronics, WH-2 Sensor" Registering protocol "Nexus Temperature & Humidity Sensor" Registering protocol "Ambient Weather Temperature Sensor" Found 1 device(s): 0: Realtek, RTL2838UHIDIR, SN: 00000001 Using device 0: Generic RTL2832U OEM Found Rafael Micro R820T tuner Exact sample rate is: 250000.000414 Hz [R82XX] PLL not locked! Sample rate set to 250000. Sample rate decimation set to 0. 250000->250000 Bit detection level set to 10000. Tuner gain set to Auto. Reading samples in async mode... Tuned to 433920000 Hz. Message: 19 84 0f 30 00 c0 00 00 04 30 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Raw: 00 00 00 58 91 20 fc 00 03 00 00 00 2c 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Weather Sensor WGR800 Wind Gauge Gust Wind Speed : 1 m/s Wind direction 0 dgrs Message received from unrecognized Oregon Scientific v3 sensor. (----------------------Rain Gauge-----------------) Message: 29 14 0d 50 00 00 77 88 00 04 90 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Raw: 00 00 00 54 98 20 ba 00 00 0e e1 10 00 29 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Weather Sensor THGR810 Channel 1 Temp: 22.9C 73.2F Humidity: 30% Message: 19 84 0f 30 00 c0 00 00 04 30 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Raw: 00 00 00 58 91 20 fc 00 03 00 00 00 2c 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Weather Sensor WGR800 Wind Gauge Gust Wind Speed : 1 m/s Wind direction 0 dgrs Message: 19 84 0f 30 00 c0 00 00 04 30 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Raw: 00 00 00 58 91 20 fc 00 03 00 00 00 2c 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Weather Sensor WGR800 Wind Gauge Gust Wind Speed : 1 m/s Wind direction 0 dgrs Anything more just shout. Thanks, Martin On Mon, Jun 1, 2015 at 6:13 PM, magellannh notifications@github.com wrote: > Also, as a test you could try running the software in standalone mode to > see if everything else is working aside from the file permission issue. > > Invoke the program in standalone mode using: > rtl-wx -s > > There's more documentation at these links: > https://github.com/magellannh/rtl-wx/blob/master/doc/UsersGuide.txt > > https://github.com/magellannh/rtl-wx/blob/master/doc/UsersGuide-Advanced.txt > > — > Reply to this email directly or view it on GitHub > https://github.com/magellannh/rtl-wx/issues/6#issuecomment-107614496.
magellannh commented 9 years ago

Do you actually have an efergy electricity sensor or is that erroneous data?

Also from the dump it looks like you have three Oregon sensors: THGR810 temperature sensor (ID F824) WGR800 Wind sensor (ID 1984) PCR800 Rain Gauge (ID 2914)

The rtl-wx program thinks it's receiving valid efergy data and valid temperature data from the THGR810. It's logging the data to rtl-wx-latest.csv (and maybe to other files too). These csv files are used by the web server through rtl-wx.html. The image linked below shows an example screenshot from rtl-wx.html from my setup: https://github.com/magellannh/rtl-wx/blob/master/doc/screenshots/monitoring-webpage-1.PNG

rtl-wx doesn't know how to decode the WGR800 or PCR800, but it wouldn't be too difficult to add the code needed to get those recognized. It looks like someone added support for the WGR800 in rtl-433, so that code just needs to be ported to rtl-wx's rtl-433 decoder. The Rain Gauge shouldn't be too bad to decode either, but it doesn't look like anyone has done that yet. I don't have either of those two devices myself.

As you've probably figured out, rtl-wx provides a foundation and example use-case with some sophisticated capabilities. However, it require work to customize to your needs.

rtl-wx.conf allows you to change the sensor names that are displayed inside the program and in the program's web debugger (eg sensor 1 is sunroom in my house, you can change that in rtl-wx.conf).

rtl-wx.html is how I usually interact with my own system on a regular basis, now that it's all debugged and running all the time.

rtl-wx.html is html and javascript and is highly tuned to my setup. For others, it's mainly an example file the serve as the basis for their own customizations.