Open adewilt8 opened 5 years ago
@lvzon could you please help?
These are merely compiler warnings, it looks like the application does compile. Does the script create an executable file called p1-test-p1
?
yep
Well then the program should work. :-) Do note that it's just a test-application though... (This code is mostly meant as a basis for writing your own lightweight applications for reading smart meters in C.)
I'm compiling for FreeBSD. Compiler gets stuck at:
/usr/local/bin/ld: /tmp//ccKzaaHF.o:/home/user/dev/dsmr-p1-parser/logmsg.h:30: multiple definition of "logger"; /tmp//ccaIiEle.o:/home/user/dev/dsmr-p1-parser/logmsg.h:30: first defined here /usr/local/bin/ld: /tmp//ccX1wzik.o:/home/user/dev/dsmr-p1-parser/logmsg.h:30: multiple definition of "logger"; /tmp//ccaIiEle.o:/home/user/dev/dsmr-p1-parser/logmsg.h:30: first defined here collect2: error: ld returned 1 exit status
I'm compiling for FreeBSD. Compiler gets stuck at: ...
Adding -z muldefs
to the gcc compiler options in make.sh seems to do the trick. I hope this is the correct way to go ;-)
Hi there,
I bought a P1 cable at sos solutions and was able to read messages using a PiZero using cu. I tried your solution, made sure to install ragel and build-essentials first, cloned the github but then when running make.sh I get the following error:
pi@ZeroW-Black:~/dsmr-p1-parser $ ./make.sh fsm name : parser num states: 576
p1-parser.c:996:18: warning: ‘parser_en_main’ defined but not used [-Wunused-const-variable=] static const int parser_en_main = 574; ^
~~~~~ p1-parser.c:995:18: warning: ‘parser_en_rest_of_line’ defined but not used [-Wunused-const-variable=] static const int parser_en_rest_of_line = 572; ^~~~~~ crc16.c: In function ‘crc16’: crc16.c:31:13: warning: unused variable ‘x’ [-Wunused-variable] uint8_t x; ^ p1-parser.c:996:18: warning: ‘parser_en_main’ defined but not used [-Wunused-const-variable=] static const int parser_en_main = 574; ^~~~~~ p1-parser.c:995:18: warning: ‘parser_en_rest_of_line’ defined but not used [-Wunused-const-variable=] static const int parser_en_rest_of_line = 572; ^~~~~~ crc16.c: In function ‘crc16’: crc16.c:31:13: warning: unused variable ‘x’ [-Wunused-variable] uint8_t x; ^Any idea how I can continue?
Kr,
Andreas