neutrinus / everblu-meters

Fetch water usage data from Cyble meters
33 stars 27 forks source link

How to compile the code #3

Closed smartmatic closed 1 year ago

smartmatic commented 2 years ago

Hi,

first of all thank you for that project. Hopefully i am able to get it running. I am currently working on the setup and have some questions.

1) I've installed WiringPi via NPM. Is it just to install it or is additional configuration necessary?

2) Which application is needed to compile the code? I tried Arduino but just after opening the tool its complaining that only .ino and .pde files can be opened?

Please support me with the compiling step!

Thank you in advance!

neutrinus commented 2 years ago
  1. it should be enough
  2. You don't need arduino at all! Just run make
smartmatic commented 2 years ago

Sorry, i dont get it. I need do download the files from Github and add my meter data an mqtt settings. I understood that with make command i program the GPIOs. Please share the command line how to perform the make.

neutrinus commented 2 years ago

The command is make - it uses Makefile to know what it should be doing.

smartmatic commented 2 years ago

@neutrinus Got it Can you pls tell me in which file i can adjust or define the exact frequency for the cc1101?

smartmatic commented 2 years ago

@neutrinus Which method did you use to get wiringpi installed? I tried now node and perl but both methods are producing errors. I performed exactly the steps from the docu: https://github.com/WiringPi/WiringPi-Perl

Here is the log for the perl method:

`pi@raspberrypi:~ $ sudo apt-get install swig2.0 libperl-dev Reading package lists... Done Building dependency tree... Done Reading state information... Done Package swig2.0 is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source However the following packages replace it: swig

E: Package 'swig2.0' has no installation candidate pi@raspberrypi:~ $ git clone http://github.com/wiringpi/wiringpi-perl Cloning into 'wiringpi-perl'... warning: redirecting to https://github.com/wiringpi/wiringpi-perl/ remote: Enumerating objects: 65, done. remote: Total 65 (delta 0), reused 0 (delta 0), pack-reused 65 Receiving objects: 100% (65/65), 392.42 KiB | 5.61 MiB/s, done. Resolving deltas: 100% (28/28), done. pi@raspberrypi:~ $ cd wiringpi-perl pi@raspberrypi:~/wiringpi-perl $ ./build.sh Updating submodule... Submodule 'WiringPi' (https://github.com/WiringPi/WiringPi.git) registered for path 'WiringPi' Cloning into '/home/pi/wiringpi-perl/WiringPi'... Submodule path 'WiringPi': checked out '9a8f8bee5df60061645918231110a7c2e4d3fa6b' Generating bindings... ./build.sh: line 6: swig2.0: command not found Building against: /usr/lib/arm-linux-gnueabihf/perl/5.32/CORE wiringpi_wrap.c: In function ‘_wrap_wiringPiGpioMode’: wiringpi_wrap.c:1942:5: warning: implicit declaration of function ‘wiringPiGpioMode’; did you mean ‘wiringPiNewNode’? [-Wimplicit-function-declaration] 1942 | wiringPiGpioMode(arg1); | ^~~~ | wiringPiNewNode pi@raspberrypi:~/wiringpi-perl $ ./test.pl Can't locate wiringpi.pm in @INC (you may need to install the wiringpi module) (@INC contains: /etc/perl /usr/local/lib/arm-linux-gnueabihf/perl/5.32.1 /usr/local/share/perl/5.32.1 /usr/lib/arm-linux-gnueabihf/perl5/5.32 /usr/share/perl5 /usr/lib/arm-linux-gnueabihf/perl-base /usr/lib/arm-linux-gnueabihf/perl/5.32 /usr/share/perl/5.32 /usr/local/lib/site_perl) at ./test.pl line 5. BEGIN failed--compilation aborted at ./test.pl line 5. `

Is this project really working?

Nevertheless i tried to compile the code but then the next error is popping up

pi@raspberrypi:~/Documents/everblu-meters-main $ make gcc everblu_meters.c -o everblu_meters -lwiringPi -lmosquitto -lpthread -Wall everblu_meters.c:19:10: fatal error: mosquitto.h: No such file or directory 19 | #include <mosquitto.h> | ^~~~~~~~~~~~~ compilation terminated. make: *** [Makefile:4: main] Error 1

In the file everblu_meters.c is an include for mosquitto.h and indeed there is no file. How should that work?

neutrinus commented 1 year ago

It seems like you miss dependencies:

./build.sh: line 6: swig2.0: command not found

also, please install libmosquitto-dev as you clearly miss it.

smartmatic commented 1 year ago

switched to another solution which works