Closed bhavin6666 closed 4 years ago
Hi and thanks
Yes this is very new and kinda rough. I dont have a JK-BMS so testing was done by another It looks like you are using the daemon / service? Did you follow that readme (it has the need to install python systemd in it)?
The best way to test is start on the command line. First what model JKBMS do you have? Is the app working (can you post the version details from there)
Can you post the output of
sudo hcitool lescan
jkbms -d
jkbms -D -p
Cheers
pi@raspberrypi:~ $ jkbms -d
Query BMS via BLE
Reading config file: /etc/jkbms/jkbms.conf
{'SETUP': {'mqtt_broker': 'mqtthost', 'max_connection_attempts': '3', 'records': '1', 'logging_level': '20'}, 'Power Wall 1': {'model': 'JK-B1A24S', 'mac': '3C:A5:09:0A:CF:6C', 'command': 'command', 'tag': 'Power_Wall_1', 'format': 'influx2'}}
Traceback (most recent call last):
File "/usr/local/bin/jkbms", line 11, in
pi@raspberrypi:~ $ jkbms -D -p
Query BMS via BLE
Reading config file: /etc/jkbms/jkbms.conf
Logging level: 10
DEBUG:JKBMS-BT:Config data - name: Power Wall 1, model: JK-B1A24S, mac: 3C:A5:09:0A:CF:6C, command: command, tag: Power_Wall_1, format: influx2
DEBUG:JKBMS-BT:Additional config - records: 1, maxConnectionAttempts: 3, mqttBroker: None
jkBMS Logging level: 10
DEBUG:JKBMS-BT:JKBMS instance --- name: Power Wall 1, model: JK-B1A24S, mac: 3C:A5:09:0A:CF:6C, command: command, tag: Power_Wall_1, format: influx2, records: 1, maxConnectionAttempts: 3, mqttBroker: None
Delegate JKBMS instance --- name: Power Wall 1, model: JK-B1A24S, mac: 3C:A5:09:0A:CF:6C, command: command, tag: Power_Wall_1, format: influx2, records: 1, maxConnectionAttempts: 3, mqttBroker: None
INFO:JKBMS-BT:Attempting to connect to Power Wall 1
WARNING:JKBMS-BT:Cannot connect to Power Wall 1 with mac 3C:A5:09:0A:CF:6C - exceeded 3 attempts
Traceback (most recent call last):
File "/usr/local/bin/jkbms", line 11, in
pi@raspberrypi:~ $ sudo hcitool lescan LE Scan ... 2E:76:88:FF:59:F5 (unknown) 3C:A5:09:0A:CF:6C (unknown) 3C:A5:09:0A:CF:6C JK-B1A24S Disable scan failed: Input/output error pi@raspberrypi:~ $ pi@raspberrypi:~ $ sudo hcitool lescan LE Scan ... 24:6E:F4:75:81:03 (unknown) 74:2F:C2:CF:51:45 (unknown) 74:2F:C2:CF:51:45 (unknown) 2E:76:88:FF:59:F5 (unknown) 8C:DE:52:F3:F8:A1 BEDJET 8C:DE:52:F3:F8:A1 (unknown) 50:EA:1B:6A:CD:71 (unknown) 41:9D:07:0A:83:7C (unknown) 65:20:B0:19:EE:45 (unknown) 65:20:B0:19:EE:45 (unknown) 5C:DE:DC:95:E8:58 (unknown) 0C:2C:D6:02:DC:A0 (unknown) 5C:DE:DC:95:E8:58 (unknown) ^Cpi@raspberrypi:~ $
i used a Bluetooth scanner on my phone to find out about the Bluetooth address first but after some reading i realized i can do it on pi. app is working fine v2.5.0
I am sure jblance will respond but I had to change my logging level to 30 in jkbms.conf.
Also make sure that phone app is not running.
after changing the log level to 30
pi@raspberrypi:~ $ jkbms -D -p
Query BMS via BLE
Reading config file: /etc/jkbms/jkbms.conf
Logging level: 10
DEBUG:JKBMS-BT:Config data - name: Power Wall 1, model: JK-B1A24S, mac: 3C:A5:09:0A:CF:6C, command: command, tag: Power_Wall_1, format: influx2
DEBUG:JKBMS-BT:Additional config - records: 1, maxConnectionAttempts: 3, mqttBroker: None
jkBMS Logging level: 10
DEBUG:JKBMS-BT:JKBMS instance --- name: Power Wall 1, model: JK-B1A24S, mac: 3C:A5:09:0A:CF:6C, command: command, tag: Power_Wall_1, format: influx2, records: 1, maxConnectionAttempts: 3, mqttBroker: None
Delegate JKBMS instance --- name: Power Wall 1, model: JK-B1A24S, mac: 3C:A5:09:0A:CF:6C, command: command, tag: Power_Wall_1, format: influx2, records: 1, maxConnectionAttempts: 3, mqttBroker: None
INFO:JKBMS-BT:Attempting to connect to Power Wall 1
INFO:JKBMS-BT:Connected to b'JK-B1A24S\x00'
INFO:JKBMS-BT:Read characteristic: Characteristic
so it is getting something but how do i see it and how do i extrapolate that data in grafana
Did you setup service and data base?
setup the service as described in other document. not sure about db. did not see any explicit instructions. can i not add it to the current influx db
yes of course you can add it to existing db. jkbms.conf. What address you have for MQTT broker?
i used the mppsolar setup for LV5048 from his earlier project.
just and FYI @DMIINC i used a direct USB cable connection to my raspberry pi with the mppsolar for LV5048 setup. just need to change the target a bit. it is noted in the documentation but since i am not that good at programming it took me a while to understand. still using raspian not ubuntu.
I am not good at programing either. However I have learned some things along the way with jblance. Question/s You have setup DB for LV5048? You have data flowing into your DB for LV5048? You can display data from LV5048 DB in Grafana? If answer is yes to all three question you are super close to having jkbms running and storing data in the same DB as LV5048. I have it setup exactly the same way.
yes to all 3 question. just need to get the jkbms data in there so i can have everything in same dashboard.
OK. can you copy paste contents of your jkbms.conf file in this thread?
i see it now. i am missing the command = command
mqtt broker?
What does it say?
[SETUP] mqtt_broker = mqtthost max_connection_attempts = 3 records = 1
logging_level = 30
[Power Wall 1] model = JK-B1A24S mac = 3C:A5:09:0A:CF:6C command = command tag = Power_Wall_1 format = influx2
it should actually be set to 20 but for some reason it was not working
with 30 it shows something.
line 2 is worong. It should be: mqtt_broker = localhost (or ip address)
And yes keep it at 30
got it. now need to figure out how to display in grafana
go to terminal type influx use (you database name) command select * from jkbms limit 20
and see what you get
i was able to get it in grafana. not able to label each cell but thats ok. i can at least see all the cells. that is very much convenient than walking over to the garage to see the status to be in range of the jkbms. Thanks @DMIINC and @jblance you guys rock.
You should be able to label cells. All depends what you are doing in grafana. You are welcome.
Thanks both - closing this as it looks resolved
first to begin with thanks for all your efforts and work on LV5048 and jkbms. first time user but was able to get through the LV5048 setup. took me about a week to understand and setup the pi and data collection. not perfect but still need to learn a lot more of grafana and influx db. for this project of jkbms had to install python3 systemd, glib 2.0 in addition whatever was in the readme. maybe add more details to getting and adding the bluetooth address in jkbms.conf overall update the install document with more details for noobs like me.
still not working for me. not sure what am i missing added the correct jkbms and the bluetooth address and service and all that after browsing through all the files but still not working. how to check if the jkbms is talking to pi and sending the data? how to see the data in grafana?