Closed cwkowalski closed 3 years ago
Looks like CC is not set in your make env
Just put CC=gcc in the top of the Makefile and it should be ok. Another option is to comment out (#) the include for Makefile.dep
From: Xenodius notifications@github.com Sent: Thursday, February 4, 2021 4:28 PM To: sshoecraft/jbdtool jbdtool@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [EXTERNAL] [sshoecraft/jbdtool] Missing file on make (#1)
CAUTION: This email was sent from an EXTERNAL source. Use caution when clicking links or opening attachments.
Hello, fantastic work here, I was about to recreate these functions for my ASI raspberry pi display! Really want to integrate the BMS into it so I can monitor its charge/discharge independent of the controller current. I was going to settle for serial but I'd love to use Bluetooth so I can fallback on the Android app to configure the BMS. I am running 32-bit piCore (linux) on a raspberry pi 4, but haven't been able to compile it yet.
When I run 'make', I get:
cc -MT main.o -MMD -MP -MF .deps/main.d -I../mybmm -Wall -g -DDEBUG=1 -DMQTT -DBLUETOOTH -c -o main.o main.c
make: cc: No such file or directory
make: *** [../mybmm/Makefile.dep:9: main.o] Error 127
I have gcc, g++, etc and all the compiler flags that I've successfully used to build Qt, scipy, and several others packages on this installation-- however, I'm a novice programmer beyond Python data science tools and haven't been able to find a solution. Any advice?
CFLAGS="-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -Os -pipe"
CXXFLAGS="-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -Os -pipe -fno-exceptions -fno-rtti"
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/sshoecraft/jbdtool/issues/1__;!!KMayzP4JbQ!LvKXlpi6_MzQhE1Y2aeF-CYiPzT5eVBmOmw6RaEXhi66U-cDbYhN0Uq546VEilY-B4kwRPg$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/ALDM57LTV46EOIT3JADGBJ3S5MNOHANCNFSM4XDVGK5A__;!!KMayzP4JbQ!LvKXlpi6_MzQhE1Y2aeF-CYiPzT5eVBmOmw6RaEXhi66U-cDbYhN0Uq546VEilY-tdiBFng$.
Here’s a static compiled version
From: Xenodius notifications@github.com Sent: Thursday, February 4, 2021 4:28 PM To: sshoecraft/jbdtool jbdtool@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [EXTERNAL] [sshoecraft/jbdtool] Missing file on make (#1)
CAUTION: This email was sent from an EXTERNAL source. Use caution when clicking links or opening attachments.
Hello, fantastic work here, I was about to recreate these functions for my ASI raspberry pi display! Really want to integrate the BMS into it so I can monitor its charge/discharge independent of the controller current. I was going to settle for serial but I'd love to use Bluetooth so I can fallback on the Android app to configure the BMS. I am running 32-bit piCore (linux) on a raspberry pi 4, but haven't been able to compile it yet.
When I run 'make', I get:
cc -MT main.o -MMD -MP -MF .deps/main.d -I../mybmm -Wall -g -DDEBUG=1 -DMQTT -DBLUETOOTH -c -o main.o main.c
make: cc: No such file or directory
make: *** [../mybmm/Makefile.dep:9: main.o] Error 127
I have gcc, g++, etc and all the compiler flags that I've successfully used to build Qt, scipy, and several others packages on this installation-- however, I'm a novice programmer beyond Python data science tools and haven't been able to find a solution. Any advice?
CFLAGS="-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -Os -pipe"
CXXFLAGS="-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -Os -pipe -fno-exceptions -fno-rtti"
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/sshoecraft/jbdtool/issues/1__;!!KMayzP4JbQ!LvKXlpi6_MzQhE1Y2aeF-CYiPzT5eVBmOmw6RaEXhi66U-cDbYhN0Uq546VEilY-B4kwRPg$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/ALDM57LTV46EOIT3JADGBJ3S5MNOHANCNFSM4XDVGK5A__;!!KMayzP4JbQ!LvKXlpi6_MzQhE1Y2aeF-CYiPzT5eVBmOmw6RaEXhi66U-cDbYhN0Uq546VEilY-tdiBFng$.
I just updated the repo; you might do a git pull and see if your issue is fixed
Thank you for the very prompt reply! I can't see the attachment here or in my email notifications, but you're right that the previous error was local-- after checking I found I had trouble using gcc elsewhere, but restoring to a recent backup fixed that issue. The gcc extension hash changed so probably corruption. Nonetheless, just pulled the latest commit and trying to make jbdtool or mybmm results in:
cc -MT main.o -MMD -MP -MF .deps/main.d -DJBDTOOL -I../mybmm -DSTATIC_MODULES -Wall -g -DDEBUG=1 -DMQTT -DBLUETOOTH -c -o main.o main.c
In file included from main.c:29:
../mybmm/mqtt.h:6:10: fatal error: MQTTClient.h: No such file or directory
6 | #include <MQTTClient.h>
| ^~~~~~~~~~~~~~
compilation terminated.
Trying to bypass by editing makefile MQTT=no
results in:
In file included from ../mybmm/mybmm.h:16,
from main.c:25:
main.c: In function 'main':
main.c:843:26: error: 'mqtt' undeclared (first use in this function)
843 | dprintf(1,"mqtt: %p\n", mqtt);
| ^~~~
../mybmm/debug.h:12:130: note: in definition of macro 'dprintf'
12 | , args...) { if (debug >= level) log_write(LOG_DEBUG, "%s(%d): " format, __FUNCTION__, __LINE__, ## args); }
| ^~~~
main.c:843:26: note: each undeclared identifier is reported only once for each function it appears in
843 | dprintf(1,"mqtt: %p\n", mqtt);
| ^~~~
../mybmm/debug.h:12:130: note: in definition of macro 'dprintf'
12 | , args...) { if (debug >= level) log_write(LOG_DEBUG, "%s(%d): " format, __FUNCTION__, __LINE__, ## args); }
| ^~~~
main.c:860:7: warning: implicit declaration of function 'mqtt_new' [-Wimplicit-function-declaration]
860 | s = mqtt_new(conf->mqtt_broker,clientid,conf->mqtt_topic);
| ^~~~~~~~
main.c:860:5: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
860 | s = mqtt_new(conf->mqtt_broker,clientid,conf->mqtt_topic);
| ^
main.c:862:7: warning: implicit declaration of function 'mqtt_connect' [-Wimplicit-function-declaration]
862 | if (mqtt_connect(s,20,conf->mqtt_username,conf->mqtt_password)) return 1;
| ^~~~~~~~~~~~
main.c:863:3: warning: implicit declaration of function 'mqtt_disconnect' [-Wimplicit-function-declaration]
863 | mqtt_disconnect(s,10);
| ^~~~~~~~~~~~~~~
main.c:864:3: warning: implicit declaration of function 'mqtt_destroy'; did you mean 'list_destroy'? [-Wimplicit-function-declaration]
864 | mqtt_destroy(s);
| ^~~~~~~~~~~~
| list_destroy
make: *** [../mybmm/Makefile.dep:9: main.o] Error 1
I fixed the issue with MQTT=no
Do a git pull and try make again.
Alternatively, you could install paho mqtt: https://github.com/eclipse/paho.mqtt.c
Tried again with MQTT = no, thanks for fix, I copied gattlib.h from jbltool to mybmm as make looked for it there. Although I have glib-2.0 and glibc-dev I get:
tc@box:/mnt/mmcblk0p2/bms/jbdtool$ sudo make
cc -DJBDTOOL -I../mybmm -DSTATIC_MODULES -Wall -g -DDEBUG=1 -DBLUETOOTH -rdynamic -static -o jbdtool main.o module.o jbd_info.o jbd.o parson.o list.o utils.o cfg.o daemon.o can.o can_ip.o dsfuncs.o serial.o ip.o bt.o -ldl ./libgattlib.a -lglib-2.0 -lpthread
/usr/local/bin/ld: cannot find -lglib-2.0
/usr/local/bin/ld: can_ip.o: in function `can_ip_open':
/mnt/mmcblk0p2/bms/jbdtool/../mybmm/can_ip.c:110: warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
collect2: error: ld returned 1 exit status
make: *** [Makefile:58: jbdtool] Error 1
Yet sudo ld -lglib-2.0 by itself finds it with warning;
ld: warning: cannot find entry symbol _start; defaulting to 0000000000010248
Currently investigating, will report if I can solve. Ensured the glib-2.0 dir (/usr/local/lib) is LD_LIBRARY_PATH but no change.
edit: successfully compiled paho mqtt, with mqtt=yes I get a similar ld warning but it still breaks at collect2. Some kind of linkage problem, possibly piCore related and my responsibility not yours:
cc -MT mqtt.o -MMD -MP -MF .deps/mqtt.d -DJBDTOOL -I../mybmm -DSTATIC_MODULES -Wall -g -DDEBUG=1 -DMQTT -DBLUETOOTH -c -o mqtt.o ../mybmm/mqtt.c
cc -DJBDTOOL -I../mybmm -DSTATIC_MODULES -Wall -g -DDEBUG=1 -DMQTT -DBLUETOOTH -rdynamic -static -o jbdtool main.o module.o jbd_info.o jbd.o parson.o list.o utils.o cfg.o daemon.o can.o can_ip.o dsfuncs.o serial.o ip.o bt.o mqtt.o -ldl ./libpaho-mqtt3c.a ./libgattlib.a -lglib-2.0 -lpthread
/usr/local/bin/ld: cannot find -lglib-2.0
/usr/local/bin/ld: ./libpaho-mqtt3c.a(Socket.c.o): in function `Socket_new':
Socket.c:(.text+0x1b9c): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/local/bin/ld: can_ip.o: in function `can_ip_open':
/mnt/mmcblk0p2/bms/jbdtool/../mybmm/can_ip.c:110: warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
collect2: error: ld returned 1 exit status
make: *** [Makefile:58: jbdtool] Error 1
find /usr -name libglib-2.0.a
does it find that file? if not, install libglib2.0-dev
Did you get the precompiled version for the PI I sent you?
Hmmmm... I don't have a static .a, but I have all the shared .so-- complete filelist, and find /usr | grep libglib-2.0
:
/usr/local/share/gdb/auto-load/usr/local/lib/libglib-2.0.so.0.6400.2-gdb.py
/usr/local/lib/libglib-2.0.so.0.6400.2
/usr/local/lib/libglib-2.0.so.0
/usr/local/lib/libglib-2.0.so
/usr/local/lib/glib-2.0/libglib-2.0.so
I did not get it. I checked my email notifications and here. I'm on 32-bit pi4 but could switch to 64-bit. PMing my email!
Edit: I should be able to static compile glib to resolve the dependency, will report back.
I attached the binary to this thread:
https://diysolarforum.com/threads/jbd-bms-wi-fi-module.17252/page-2
lol forgot to post it ... if you checked in the last 20m try again plz
Thanks, I registered there and tried it out but get an error.
tc@box:/tmp$ ./jbdtool -t bt:A4:C1:38:BE:AC:FD
./jbdtool: line 2: syntax error: unexpected newline
tc@box:/tmp$ ./jbdtool -t bt:A4:C1:38:BE:AC:FD,ff01
./jbdtool: line 2: syntax error: unexpected newline
After compiling static glib and editing Makefile LIBS=-ld
to LIBS=/usr/local/bin/ld
it compiles successfully, though still with the previously posted warnings about shared libraries, and on trying to run:
tc@box:/usr/local/bin$ ./jbdtool -t bt:A4:C1:38:BE:AC:FD
./jbdtool: error while loading shared libraries: : cannot open shared object file: No such file or directory
Despite obviously having all the shared libraries I just used to build it still installed... hrmph.
tc@box:/usr/local/bin$ ldd jbdtool
./jbdtool: error while loading shared libraries: ./jbdtool: unsupported version 0 of Verneed record
PS edit: No links-- will see if I can find out how to add them. I think it has to be done during the build? Bit over my head. But I think, each of those libraries I got a warning from needs to be linked in order for it to look them up in memory.
PSS edit: I'm a doober and read LIBS=-ldl as -ld. Pulled repo again and without any changes except including gattlib.h in mybmm, it compiles without ld: cannot find -lglib-2.0
error. Have some extra setup to get a connection but it appears to run. Thanks for your help!
./jbdtool: line 2: syntax error: unexpected newline
This tells me that’s a text file … ?
LIBS=-ldl = is not bin/ld (the command), but instead the library:
/lib/arm-linux-gnueabihf/libdl.so.2
It SHOULD say LIBS=-ldl
(for dynamic linker)
Did you try the static compiled binary here:
https://diysolarforum.com/threads/jbd-bms-wi-fi-module.17252/page-2
Also, no idea why this is going to my work email; I really need to fix that
From: Xenodius notifications@github.com Sent: Friday, February 5, 2021 3:25 PM To: sshoecraft/jbdtool jbdtool@noreply.github.com Cc: Shoecraft, Stephen Stephen.Shoecraft@McKesson.com; Comment comment@noreply.github.com Subject: [EXTERNAL] Re: [sshoecraft/jbdtool] Missing file on make (#1)
CAUTION: This email was sent from an EXTERNAL source. Use caution when clicking links or opening attachments.
Thanks, I registered there and tried it out but get an error.
./jbdtool: line 2: syntax error: unexpected newline
tc@box:/tmp$ ./jbdtool -t bt:A4:C1:38:BE:AC:FD,ff01
./jbdtool: line 2: syntax error: unexpected newline
After compiling static glib and editing Makefile LIBS=-ld to LIBS=/usr/local/bin/ld it compiles successfully, though still with the previously posted warnings about shared libraries, and on trying to run:
./jbdtool: error while loading shared libraries: : cannot open shared object file: No such file or directory
Despite obviously having all the shared libraries I just used to build it still installed... hrmph. May I ask which pi/OS you're using?
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/sshoecraft/jbdtool/issues/1*issuecomment-774296744__;Iw!!KMayzP4JbQ!LvSx_rvszXamrwNDEDwY9sEWsg8EwpNAbajo9frkq7Pusihq7REn0moLwHyEQEL_I-gZKDE$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/ALDM57O7MOBY2LDI7CT5KYDS5RO3XANCNFSM4XDVGK5A__;!!KMayzP4JbQ!LvSx_rvszXamrwNDEDwY9sEWsg8EwpNAbajo9frkq7Pusihq7REn0moLwHyEQEL_e0X8IQ4$.
By the way, my PI is a 3B+
Also, let me know if it actually works for bluetooth. Some folks have had mixed success.
The gattlib library I provide in the repo here and the static binary I shared on diysolarforums
https://diysolarforum.com/threads/jbd-bms-wi-fi-module.17252/page-2
Both have a "patched" version of gattlib ... using the default settings means using dbus, which for me didnt work. It might for your Pi4, which is why I'm interested in your success.
I don't think it's a text file (at least, nano can't read it) but the static binary I downloaded from diysolarforums! I hosted it publically and used wget.
Interesting, I'm having trouble setting up bluetooth on piCore (hciattach hangs and times out) but I'll let you know how it goes. I'm using piCore for reliability over Raspbian, have spent the last 2 months setting up what took me 90 minutes on raspbian lol. Just have to do it once though. I sure hope I can use dbus. Had I not seen the thread on endless-sphere I'd never have thought to try, but now am very excited to get BMS integration. I passthrough the BMS on my ebike and connected the controller directly to the pack for efficiency/cost-- 300 amps peak! I use the BMS only for balancing, charging, and powering a 12v dc-dc converter for accessories. So, by polling the BMS I'll be able to coulomb-count accessory drain, more intelligently detect pack charges, and add cell-level LVC/HVC faults I lost from bypassing the BMS.
I'll let you know how it turns out, will probably add a fork of this to my ASI_AmpyDisplay repo, and give you credit =)
Hello, fantastic work here, I was about to recreate these functions for my ASI raspberry pi display! Really want to integrate the BMS into it so I can monitor its charge/discharge independent of the controller current. I was going to settle for serial but I'd love to use Bluetooth so I can fallback on the Android app to configure the BMS. I am running 32-bit piCore (linux) on a raspberry pi 4, but haven't been able to compile it yet.
When I run 'make', I get:
I have gcc, g++, etc and all the compiler flags that I've successfully used to build Qt, scipy, and several others packages on this installation... mybmm source is specified... however, I'm a novice programmer beyond Python data science tools and may be missing something that's obvious to an expert. Any advice?