Ihopethisworks
New Member
- Joined
- May 9, 2021
- Messages
- 3
any update on a setup/install guide? Been trying to figure this out all day.
Hey, life is more important; so everyone understands, I appreciate what you have done/continue to do.Thanks for reminding me. I started it, but then life happened. I'll pick it up asap.
I'm by no means an expert here, but the F-string print function was introduced in Python 3.6. Raspian Buster came with Python 2.7 or something. Your "python" in the command line will use 2.7. If you have a newer version of python, use "python3.9" or whatever version you have installed. Try "python --version" or "python3.9(or whatever) --version" to see what you have installed.Great thread. Much learning to do but I see a path, just need some help getting started. My solar batteries/jbd bms(s) (8s2p) are remote and I have a pi3 connected to a cellular modem so that I have vnc and ssh access from anywhere. Pi is running raspian buster. (have not updated python from what ever was the default with Buster).
I can see the JBD BT devices and addresses with the Pi3 bluetooth. I'm hoping to get the bms data (just the data to start) and later put it into a database and pretty graphical format as shown in this thread.
First attempt to get a connection and data with the python script has failed. Not sure if I'm proceeding correctly and could use some pointers.
I have run the following commands via a ssh connection and get the following:
pi@raspberrypi:~/Downloads/bms-main $ python jbdbms-8-socket.py -b A4:C1:38:88:59:5E -i 10 -m jbdbms
File "jbdbms-8-socket.py", line 45
print(f'Error creating socket: {e}')
^
SyntaxError: invalid syntax
Help appreciated, I realize this thread is beyond were I'm getting stuck. Hoping someone can assist. thanks.
Followed the instructions and installed bluepy on the pi3. I believed it installed correctly. The command "sudo blescan" resulted in the following:As the error message stated: Have you installed bluepy at all?
GitHub - IanHarvey/bluepy: Python interface to Bluetooth LE on Linux
Python interface to Bluetooth LE on Linux. Contribute to IanHarvey/bluepy development by creating an account on GitHub.github.com
You're connected to the BMS and pulling data. It's erroring on the socket creation. I went with paho mqtt in the mqtt version of the code, not the socket in Telegraf, so I'm not familiar with that approach..Error creating socket: [Errno 2] No such file or directory
Wow can't wait till you figure it out, hopefully before Solar assistant integrates JBD and I can see it via Home assistant, spent 2 days doing what you are doing only to find out it doesn't work with HassIo, Joe.One step at a time. Slowly getting there. Not without my share of issues. Followed the the instructions from the bms-main folder with other google searches and installed telgraf, influxdb, and granfana. I seem to have it all running. At least reading data and building a database. Still having issue with Grafana. Hoping to get some verification that I'm on the right path and suggestion as to getting the graphical display with grafana
Grafana is giving me this error:
If you're seeing this Grafana has failed to load its application files
1. This could be caused by your reverse proxy settings.
2. If you host grafana under subpath make sure your grafana.ini root_url setting includes subpath. If not using a reverse proxy make sure to set serve_from_sub_path to true.
3. If you have a local dev build make sure you build frontend using: yarn start, yarn start:hot, or yarn build
4. Sometimes restarting grafana-server can help
5. Check if you are using a non-supported browser. For more information, refer to the list of supported browsers.
============================================================================
Here is the output from jdbms.py and telegraf --debug
pi@raspberrypi:~/Downloads/bms-main $ python jbdbms-8-socket.py -b A4:C1:38:88:59:5E -i 10 -m jbdbmscd
attempting to connect
connected A4:C1:38:88:59:5E
Error creating socket: [Errno 2] No such file or directory
meter,ovp,uvp,bov,buv,cot,cut,dot,dut,coc,duc,sc,ic,cnf
jbdbmscd,0,0,0,0,0,0,0,0,0,0,0,0,0
meter,protect,percent,fet,cells,temp1,temp2
jbdbmscd,0,63,3,8,9.0,8.9
meter,cell1,cell2,cell3,cell4,cell5,cell6,cell7,cell8
jbdbmscd,3377,3363,3373,3376,3380,3380,3379,3380
meter,cellmin,cellmax,delta
jbdbmscd,3363,3380,17
meter,volts,amps,watts,remain,capacity,cycles
jbdbmscd,27.01,6.74,182.05,113,180,2
meter,c01,c02,c03,c04,c05,c06,c07,c08
jbdbmscd,0,0,0,0,0,0,0,0
meter,c09,c10,c11,c12,c13,c14,c15,c16
jbdbmscd,0,0,0,0,0,0,0,0
=====================================================================
pi@raspberrypi:~ $ telegraf --debug
2021-12-02T19:57:42Z I! Starting Telegraf 1.20.4
2021-12-02T19:57:42Z I! Using config file: /etc/telegraf/telegraf.conf
2021-12-02T19:57:42Z I! Loaded inputs: cpu disk diskio kernel mem processes swap system
2021-12-02T19:57:42Z I! Loaded aggregators:
2021-12-02T19:57:42Z I! Loaded processors:
2021-12-02T19:57:42Z I! Loaded outputs: influxdb
2021-12-02T19:57:42Z I! Tags enabled: host=raspberrypi
2021-12-02T19:57:42Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"raspberrypi", Flush Interval:10s
2021-12-02T19:57:42Z D! [agent] Initializing plugins
2021-12-02T19:57:42Z D! [agent] Connecting outputs
2021-12-02T19:57:42Z D! [agent] Attempting connection to [outputs.influxdb]
2021-12-02T19:57:42Z D! [agent] Successfully connected to outputs.influxdb
2021-12-02T19:57:42Z D! [agent] Starting service inputs
2021-12-02T19:57:52Z D! [outputs.influxdb] Wrote batch of 13 metrics in 21.682593ms
2021-12-02T19:57:52Z D! [outputs.influxdb] Buffer fullness: 0 / 10000 metrics
2021-12-02T19:58:02Z D! [outputs.influxdb] Wrote batch of 18 metrics in 29.015974ms
2021-12-02T19:58:02Z D! [outputs.influxdb] Buffer fullness: 0 / 10000 metrics
2021-12-02T19:58:12Z D! [outputs.influxdb] Wrote batch of 18 metrics in 26.954032ms
2021-12-02T19:58:12Z D! [outputs.influxdb] Buffer fullness: 0 / 10000 metrics
2021-12-02T19:58:22Z D! [outputs.influxdb] Wrote batch of 18 metrics in 26.425589ms
===========================================================================================
Actually, you don't need Home Assistant at all. However, I'm rebuilding my RPi4B system with Raspian Bullseye and Home Assistant Supervised to hopefully get the best of both worlds.Wow can't wait till you figure it out, hopefully before Solar assistant integrates JBD and I can see it via Home assistant, spent 2 days doing what you are doing only to find out it doesn't work with HassIo, Joe.
The trickiest thing about Grafana is getting your data sources connected. It's easy from there on out.Still having issue with Grafana
A new Thread with all Your work published would be awesome - had all working perfect except the Python/Bluetooth and it's all still installed on HA, but disabled, Joe.Actually, you don't need Home Assistant at all. However, I'm rebuilding my RPi4B system with Raspian Bullseye and Home Assistant Supervised to hopefully get the best of both worlds.
I have a D1 Mini talking to my Victron SmartSolar via Ve.Direct and sending data over WiFi right now. I'll get my jbd python going again next. I'm trying to document a lot of it on my Github, but I'm not ready to brag about that just yet.
The plan is Device/Python>>MQTT>>NodeRed>>Influx>>Grafana for everything.
My devices to connect are the JBD BMS (Python/Bluetooth), Victron SmartSolar (D1 Mini/WiFi), Victron Shunt (D1 Mini/WiFi), Sonoff S31s (ESPHome/WiFi), Xioami Temp/humidity sensors(ESPHome/WiFi), Shelly 1 switches(ESPHome/WiFi)
I'll start a new thread once everything is worked out.
The trickiest thing about Grafana is getting your data sources connected. It's easy from there on out.