-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BMS repeatedly becomes unavailable and fails to reconnect. #42
Comments
Did you try using an USB Bluetooth dongle instead of the RPI on-board? |
I
No, I don't have one on hand. Is there something wrong with the onboard unit? I have also seen this error, where the host must be restarted to resolve it. Let me know if you can't zoom in, it was a screenshot and the only way I could get a copy of it at the time. |
The RPI onboard unit is fine, however I experienced Bluetooth Low Energy stack implementation to be a buggy on some platforms. This seems to be related to some low level driver issues, as with the error you posted. |
If I get a bluetooth dongle, how do I change the BatMon add-on to use it instead? |
If i recall correctly, the RPI will automatically use the USB dongle instead of the onboard unit.
|
Thanks, I'm still yet to buy a dongle as I'm not convinced it's the issue. Using my phone and the BMS, I still have bluetooth drop outs, I think the BMS itself is not a fantastic bluetooth module. I've also moved the Rpi out of the solar cabinet as I suspected heat issues and the platform is now far more stable, it still disconnects bluetooth but I the automation to restart is now far more effective. |
I couldn't get the UART cable to work, but I guess that depends on which project you're using to try and implement it. Does this add-on work with UART? |
So even with the HA box outside of the cabinet and much cooler, I am still seeing this. ERROR [sampling.py:97] 14kWh_Lifpo4 error: Device 3C:A5:51:86:02:84 not discovered ({'37:86:B9:58:BC:83'}) |
YOu can try to find the BMS with a BLE scan from the command line: |
I had the same experience with Daly. If you turn on the HA Watchdog it'll restart batmon automatically. Thanks for your appreciation! |
I wanted to come back and update. I disabled on board wifi after learning wifi and Bluetooth share the antenna. I hard wired the Rpi4 and put it back in the solar cabinet, bkuetooth has not disconnected a single time in over a week now. I think the RPi4 hardware is not up to scratch personally. |
@UV-PWRD Thanks for your reply. I'll reference this in the readme. |
Adding to this, after 2 weeks of solid connection, it is now flakey again. I've recently switched the Pi4 to booting from USB SSD and from the moment I added that device the Bluetooth has gone back to behaving the same way it was previously, constantly disconnecting. I've ordered a USB BT dongle to test, I tend to feel that the combined onboard Wifi and BT are a bit of a joke as neither works well when the other is in use or the system is being asked to do anything else. It "could" be a power issue though, I have not connected a powered USB hub for the SSD, it's in a USB/M2 adaptor case directly connected to the Pi4. I've hard of lots of issues being power related. My Pi4 came with the power supply from Labists as a kit, it is not the "genuine" power pack, but appears to match the specs. |
Thank you for this add-on, it's great, though I'm having some issues with stability.
I'm using a 4GB Rpi4, running Debian 11, with HA on top in docker (running some other docker images also to help with off-grid inverter things) and I cannot get the BMS to stay connected for long periods.
The Host is located within half a meter of the BMS, which is a JK 150a device.
The BMS entities will become "unavailable" and I have an automation to restart the add-on after 5mins of this, sometimes it's still not able to reconnect and you must wait longer.
There's nothing else connecting to the BMS that I'm aware of, the log shows this. The reconnect on its own but other times it will not. It disconnects regularly.
Watchdog is on, keep_alive is on, sample period is set to 1.
It will time out 120s trying to reconnect and then must be restarted again.
I can automate around this but would like to know why it fails and how to prevent it.
INFO [sampling.py:100] JKBt(3C:A5:51:86:02:84) times: connect=0.00s fetch=0.29s
INFO [sampling.py:68] 14kWh_Lifpo4 result@2022-12-13T13:04:32.725557 BmsSample(U=53.9V,I=18.04A,P=973W,q=191.8Ah/277.0,mos=29.1°C)
INFO [sampling.py:75] 14kWh_Lifpo4 volt=3364,3358,3390,3373,3378,3369,3353,3389,3358,3358,3372,3391,3385,3358,3351,3356 temp=[23.6, 22.5]
INFO [sampling.py:100] JKBt(3C:A5:51:86:02:84) times: connect=0.00s fetch=0.28s
WARNING [bt.py:19] BMS JKBt(3C:A5:51:86:02:84) disconnected!
INFO [sampling.py:41] connecting bms JKBt(3C:A5:51:86:02:84)
INFO [sampling.py:47] connected bms JKBt(3C:A5:51:86:02:84)!
INFO [sampling.py:68] 14kWh_Lifpo4 result@2022-12-13T13:04:38.282262 BmsSample(U=53.9V,I=17.83A,P=961W,q=191.8Ah/277.0,mos=29.1°C)
INFO [sampling.py:75] 14kWh_Lifpo4 volt=3367,3357,3389,3380,3370,3372,3352,3386,3363,3354,3375,3391,3383,3360,3349,3357
When it fails it looks like this until my automation kicks in.
INFO [sampling.py:75] 14kWh_Lifpo4 volt=3360,3360,3377,3380,3370,3363,3354,3373,3362,3354,3367,3404,3377,3357,3351,3352 temp=[24.1, 23.1]
INFO [sampling.py:100] JKBt(3C:A5:51:86:02:84) times: connect=0.00s fetch=0.30s
WARNING [bt.py:19] BMS JKBt(3C:A5:51:86:02:84) disconnected!
INFO [sampling.py:41] connecting bms JKBt(3C:A5:51:86:02:84)
INFO [jikong.py:114] normal connect failed, connecting with scanner
INFO [jikong.py:114] normal connect failed, connecting with scanner
INFO [jikong.py:114] normal connect failed, connecting with scanner
INFO [jikong.py:114] normal connect failed, connecting with scanner
INFO [jikong.py:114] normal connect failed, connecting with scanner
INFO [jikong.py:114] normal connect failed, connecting with scanner
INFO [jikong.py:114] normal connect failed, connecting with scanner
INFO [jikong.py:114] normal connect failed, connecting with scanner
INFO [jikong.py:114] normal connect failed, connecting with scanner
INFO [jikong.py:114] normal connect failed, connecting with scanner
INFO [jikong.py:114] normal connect failed, connecting with scanner
INFO [jikong.py:114] normal connect failed, connecting with scanner
ERROR [main.py:110] MQTT message publish timeout (last 120s ago), exit
INFO [jikong.py:114] normal connect failed, connecting with scanner
INFO [jikong.py:114] normal connect failed, connecting with scanner
INFO [jikong.py:114] normal connect failed, connecting with scanner
INFO [jikong.py:114] normal connect failed, connecting with scanner
INFO [jikong.py:114] normal connect failed, connecting with scanner
s6-rc: info: service legacy-services successfully started
INFO [main.py:68] BT Discovery:
INFO [main.py:71] - no devices found -
INFO [bt.py:91] BMS JKBt(3C:A5:51:86:02:84) keep alive enabled
INFO [main.py:178] connecting mqtt XXXX@core-mosquitto
INFO [main.py:201] Fetching 1 BMS + 0 others serially, period=1.00s, keep_alive=True
INFO [sampling.py:41] connecting bms JKBt(3C:A5:51:86:02:84)
INFO [main.py:99] mqtt watchdog loop started with timeout 120.0s
INFO [sampling.py:47] connected bms JKBt(3C:A5:51:86:02:84)!
INFO [sampling.py:64] 14kWh_Lifpo4 subscribing for {'charge': True, 'discharge': True} switch change
INFO [mqtt_util.py:297] subscribe homeassistant/switch/14kWh_Lifpo4/charge/set
INFO [mqtt_util.py:297] subscribe homeassistant/switch/14kWh_Lifpo4/discharge/set
INFO [sampling.py:68] 14kWh_Lifpo4 result@2022-12-13T13:28:35.218390 BmsSample(U=54.0V,I=20.35A,P=1099W,q=195.6Ah/277.0,mos=28.6°C)
INFO [sampling.py:75] 14kWh_Lifpo4 volt=3368,3363,3396,3383,3384,3372,3357,3393,3365,3360,3377,3422,3388,3363,3354,3358
The text was updated successfully, but these errors were encountered: