diy solar

diy solar

ENJ Power for Heltec/JK BMS

Yes

The laptop in the cabinet has been rebooted a number of times and the BMS was only just rebooted today as the Bluetooth was acting up after 65days up time
 
Any chance you can test with my code on a Linux system like a Raspberry Pi? I can't duplicate your issue here, but I also don't have the exact same converter you have...
 
@DIY-Dan in my case i decided not to go for the RS485 cable because I realised the RS485 was just going to be a tethered version of the built-in BLE.. if the phone app can do it why use a cable... I'm waiting for my new BT-BLE USB dongle to arrive which cost just as much as the RS485 anyway and I'll be connecting to my 3 BMS's via BLE instead. the protocol is the same just gotta add pairing.

@upnorthandpersonal would your script be able to work with a BLE device? it might show up as a hidraw or a com port device.. if not, how hard would it be to modify it to do the same?

Also JK's documented protocols are very light on the details.. there are tonnes more settings in the app that's not documented in the protocol spec... but it's not necessarily hard to guess them, they already documented a few commands like 0xF2, 0xF4 etc... that's why I was working with jblance to see if I could capture the BLE data packets to find out what each of the commands do - I got as far as a massive dump with hundreds of packets... Thanks for the heads up about the Grafana project too - i signed up but it's mostly a dashboard. what I'm really interested in, is being able to programmatically alter the parameters on the fly...
 
Last edited:
No software, I have only just wired it. JK said to use Serial Debug Assistant, but so far I'm unable to get any data out of it, it opens the port but nothing happens. Grafana was also mentioned and I'll take a look at "jblance" though it appears to be for talking to the inverter. I'm wanting to talk to the BMS.

For what it's worth, the RS232 cable I got appears to be shitty, I managed to get watch power to "see" the inverter once briefly and not since then, I have rebooted the machine and also the inverter without success - but the RS232 USB adapter is a cheapo, the RS485 cable for the BMS was a decent DSD-Tech one.

Full disclosure, I've done heaps of IT (20yrs+) but almost nothing with Com based devices beyond sending basic commands to dial up modems back in the day and accessing Cisco routers CLI which just "works" as far as the Com component goes.
Jblance seems to also have a bms module.
 
@upnorthandpersonal would your script be able to work with a BLE device? it might show up as a hidraw or a com port device.. if not, how hard would it be to modify it to do the same?

Not sure - I wanted to get away from BT since it seems to a) not be reliable at all times and b) I want to connect it together with my charge controllers and inverters in a way that allows me to control all of them (or rather, have the system make decisions based on events) and they are all RS-485 anyway.
For the latter one, maybe I'll throw in some statistical methods/neural network code to optimize where power needs to go to when (hot water, heating, cooling, etc. based on time of year/weather, temperatures, expected loads, etc. etc. - but I digress). The Grafana dashboard is just the first step to provide a pretty interface to the data.

I'll see if I can get the BT side of things going with the same code, but not sure when...
 
Any chance you can test with my code on a Linux system like a Raspberry Pi? I can't duplicate your issue here, but I also don't have the exact same converter you have...
Not without building myself a box, which honestly I CBF doing as time is precious here.
 
@DIY-Dan in my case i decided not to go for the RS485 cable because I realised the RS485 was just going to be a tethered version of the built-in BLE.. if the phone app can do it why use a cable... I'm waiting for my new BT-BLE USB dongle to arrive which cost just as much as the RS485 anyway and I'll be connecting to my 3 BMS's via BLE instead. the protocol is the same just gotta add pairing.

@upnorthandpersonal would your script be able to work with a BLE device? it might show up as a hidraw or a com port device.. if not, how hard would it be to modify it to do the same?

Also JK's documented protocols are very light on the details.. there are tonnes more settings in the app that's not documented in the protocol spec... but it's not necessarily hard to guess them, they already documented a few commands like 0xF2, 0xF4 etc... that's why I was working with jblance to see if I could capture the BLE data packets to find out what each of the commands do - I got as far as a massive dump with hundreds of packets... Thanks for the heads up about the Grafana project too - i signed up but it's mostly a dashboard. what I'm really interested in, is being able to programmatically alter the parameters on the fly...

The issue with the app is remote access from anywhere. I can put a phone/tablet in the cabinet and leave the app running and then remotely access the phone from a PC, but anytime you close/disconnect that session you have to re-authenticate on the phone end from what I've seen, unless you know off an app that allows remote access to a phone or tablet without prompting/requiring interaction on that end ever (sounds like a security issue to me). I just want the phone/tablet to be a headless slave device effectively.

So if I have to establish a connection and leave it running it means leaving a PC running at home remotely connected to the phone/tablet and then RDP'ing into that PC from out of the house so I can see what the BMS is doing - which is the main thing I want to see (as well as set up watch power properly so it can email on certain events which the software will do but I'm still fighting the RS232 adapter).

If there's an android app that allows remote access to a phone/tablet without any form of interaction on the device end, then I wouldn't need the 485 cable and could just hit the device from anywhere with some basic port forwarding.

I have a few smart plugs around the house (including hot water) which I would love to automate and down he track I would like to swap out my break over switch to interconnected contactors that I can drive remotely (my house has 2 systems, a grid connected solar system, and my completely separate off grid system + battery so I can break over at the house sub board and choose what I want, I can also direct power from the grid system into the off grid system battery as needed IF the house is running on the grid system - via another smart plug). Automating that based on what each system is doing and the battery level would be great (Mondo did give me the API for the smart meter, which shows me the grid systems energy flow) but no point looking at that until I can get useful data out of the inverter and battery into something workable.

On top of that I have a Sensibo which allows remote control of one of my aircons (working on getting a wifi module for the big ducted unit as it's a commercial system). So some level of automation on that would be nice too - it has built in automation via air temp sensors, but has no regard for what power source the house is using or what battery level we're at.
 
Same. The app without remote control is quite limiting. My battery bank is in a concrete-enclosed garage which means BLE literally doesnt penetrate beyond the door.. so every time i need to check my batteries I need to walk INTO the garage to connect... But i do have a mini bot (jetson nano on ubuntu) that I could use for connecting to my inverters over USB, and to the BMS over BT BLE... so the plan is to turn that box into a mini grafana server first so i can at least read the data... @jblance 's code includes my inverter (MPPSolar) as well as JKBMS (kinda beta tho), and the great thing is, it's CLI and includes JSON as one of its output formats, which means I can treat it like a mini RESTful web service... I have an API that connects to my power company which gives me realtime tariff details. So at some point I can theoretically program my inverter to take power from the grid when prices are really low.. and sell stored energy to the grid when prices are sufficiently high... and additional automation like the smart plugs and google home integration etc that's all been talked about already.. for example automatically starting climate at home as I'm driving towards home etc.. lots of cool stuff...
 
I'm annoyed there's no Wifi module in the BMS, even my cheapo mpp7248 has a half decent app, just shits me you cannot configure push alerts/emails on some things which the desktop app can do.
 
Awesome, cheers - going above and beyond for sure.

Hopefully over the weekend I can fiddle more. I'd like to know what happens inside the box midway along the cable as I couldn't get a successful continuity test through it, BUT I appeared to be having issues with my probs and my good meter (Fluke 325) was down in the other shed, I'll grab it over the weekend and test again as the wires on the BMS cable are very thin and I always break some when I strip the shielding.
 
Didn't get a chance to fiddle with the cables, but as we had 3 over cast days I did get to see the behaviour of the pack in the low end of the cycle.

With this in mind, and having to go through the process again of restarting the BMS, pre-charging caps etc, thoughts on the following.

Cold starting BMS.
1) Wire a 9v battery between the battery main pos and the output side of the BMS (which is on the neg side) with a moment switch in-line so I can push button restart the BMS (given we need to see a solid 5v+ on the output side of the BMS this should give me 60v+). I don't think the BMS needs to see current on the output side to start, just voltage so there should be no draw across the 9v battery as far as I understand it. Can this be done or is this is a recipe to blow up the 9v?

Pre-charging inverter caps.
2) Wire a 25w 50 Ohm resistor between the battery main neg and the output side of the BMS with a moment switch inline so I can push button pre-charge the caps in the inverter to stop the BMS seeing the inverter boot as a dead short.

This is the current wiring and so far I have used a 30v DC power supply and a boost convertor with some alligator clips to allow me to reboot the BMs or pre-charge inverter caps as needed, which is a bit fiddly getting it all out.

I could just as easily not wire any of this in and just have it all setup in a jiffy box with the push buttons mounted on it and some alligator clamps hanging out of it to use as needed as there are some logistical issues with terminal sizes etc given these 2 little add on systems wouldn't use heavy gauge wire or large lugs and the output side of the BMS is all heavier gauge stuff.

1620608387292.png
 
Cold starting BMS.
1) Wire a 9v battery between the battery main pos and the output side of the BMS (which is on the neg side) with a moment switch in-line so I can push button restart the BMS (given we need to see a solid 5v+ on the output side of the BMS this should give me 60v+). I don't think the BMS needs to see current on the output side to start, just voltage so there should be no draw across the 9v battery as far as I understand it. Can this be done or is this is a recipe to blow up the 9v?
that's what gave me the nasty jolt https://diysolarforum.com/threads/heltec-jk-200a-smart-bms-with-2a-active-balance.17831/post-263586.... but no actual damage. my 12V is only a tiny one and it's still working fine, BMS was fine, pack is fine, inverter was fine...

In hindsight I think my jolt was because the inverter caps were not charged, so the moment I introduced the 12V to it and "woke" the BMS, a lot of current got sent to the inverter to precharge the caps - even if it were milliseconds worth... The 12V's internal BMS probably protected itself very quickly but nonetheless resulted in a spark. The spark probably wouldn't happen if I used a proper switch or contactor though. YMMV
 
that's what gave me the nasty jolt https://diysolarforum.com/threads/heltec-jk-200a-smart-bms-with-2a-active-balance.17831/post-263586.... but no actual damage. my 12V is only a tiny one and it's still working fine, BMS was fine, pack is fine, inverter was fine...

In hindsight I think my jolt was because the inverter caps were not charged, so the moment I introduced the 12V to it and "woke" the BMS, a lot of current got sent to the inverter to precharge the caps - even if it were milliseconds worth... The 12V's internal BMS probably protected itself very quickly but nonetheless resulted in a spark. The spark probably wouldn't happen if I used a proper switch or contactor though. YMMV
I thought the correct connection of the 9V battery was as follows:
Connect the positive side of the 9 volt to the negative end of the cells, the B- lead of the BMS. Then connect the negative side of the 9 volt battery to the P- lead of the BMS.
Is that not correct?
 
Yes you are correct, I was wrong because I was thinking about what I currently do - which is fundamentally different.

I use a 60v DC power supply from the main batt pos terminal to the P- lead of the BMS, and start adding some voltage and current - in parallel which allows me to start the BMS and also pre-charge caps.

When you are just adding some voltage in series to wake the BMS up, you should do it as mentioned above.

Connect the positive side of the 9 volt to the negative end of the cells, the B- lead of the BMS. Then connect the negative side of the 9 volt battery to the P- lead of the BMS.

This will wake it up.

Pre-charging is another matter but I have that under control also.

This is why forums exist :)
 
Back
Top