DIYBMS v4

You can use Node-Red to ‘echo’ the data, initially passed on a diybms base topic, onto an emon base topic so EmonCMS will pick it up automatically.

Thanks Brian and Stuart,

decided to do it with simple line in cron
by using mosquitto_sub and mosquitto_pub commands

Stable for 3 days :slight_smile:

2 Likes

Hi Stuart,

I checked the data sheet of the Victron Multiplus-II inverter/charger which I am going to buy for my DIY Powerwall. It has has 2 Aux channels for relay inputs.

Channel 1 signal: Individual cell over voltage and/or over temperature
→ this feature is already in your rule settings (#2 and #3).

Channel 2 signal: Individual cell under voltage.
→ this is missing currently

I think this is a very important feature. If one packs drops for whatever reason (bad soldering, bad cells, fuses issue, too low cut off setting, unequal packs, etc.), the total pack voltage might be still ok and thus the systems keeps beeing active. Maybe the temperature will rise and thus the temp. rule (#3) will get active but maybe not.

So I would love to see a new rule.

Thanks,
Sebastian

I’ve been reading and trying to learn this Platformio stuff. I’m stuck on this error. For others trying to learn how to program the boards, I will post what I have found as I try to figure out how to do it. First you will have to install a lot more than Visual studio. You will also need to install GIT client and the Platformio package. Now that I have all that installed, I’m getting an access error. I searched the error and others said to un-install and re-install. I have tried that. I have rebooted and still get this when I try to compile the ini. I’m assuming it has to do with GIT not having access to my drive but I can’t figure out how to grant access. Has anyone else gotten this and figured out how to resolve?

Cloning into ‘c:\Users\Rick\Downloads\diyBMSv4-master\diyBMSv4-master\ESPController.pio\libdeps\nodemcuv2_tmp_installing-pz7875mf-package’…
[WinError 5] Access is denied: ‘c:\Users\Rick\Downloads\diyBMSv4-master\diyBMSv4-master\ESPController\.pio\libdeps\nodemcuv2\_tmp_installing-pz7875mf-package’
Please manually remove the file c:\Users\Rick\Downloads\diyBMSv4-master\diyBMSv4-master\ESPController\.pio\libdeps\nodemcuv2\_tmp_installing-pz7875mf-package
PermissionError: [WinError 5] Access is denied: ‘c:\Users\Rick\Downloads\diyBMSv4-master\diyBMSv4-master\ESPController\.pio\libdeps\nodemcuv2\_tmp_installing-pz7875mf-package\.git\objects\09\8049adbb2aff62040641cd597884ad09c46ea3’:

Making some progress. I manually removed the file like the error suggested but I would still get the permission error. So I decided to close VS and try again. It made it past those errors finally!. Now I’m getting a missing declared variable strftime. Is this a library I’m missing. I thought they were all included in the build?

Compiling .pio\build\nodemcuv2\libd8e\ESP Async WebServer\WebServer.cpp.o
.pio\libdeps\nodemcuv2\ESP Async WebServer\src\WebHandlers.cpp: In member function ‘AsyncStaticWebHandler& AsyncStaticWebHandler::setLastModified(tm*)’:
.pio\libdeps\nodemcuv2\ESP Async WebServer\src\WebHandlers.cpp:67:64: error: ‘strftime’ was not declared in this scope
strftime (result,30,"%a, %d %b %Y %H:%M:%S %Z", last_modified);
^
.pio\libdeps\nodemcuv2\ESP Async WebServer\src\WebHandlers.cpp: In member function ‘AsyncStaticWebHandler& AsyncStaticWebHandler::setLastModified(time_t)’:
.pio\libdeps\nodemcuv2\ESP Async WebServer\src\WebHandlers.cpp:73:60: error: ‘gmtime’ was not declared in this scope
return setLastModified((struct tm *)gmtime(&last_modified));
^
.pio\libdeps\nodemcuv2\ESP Async WebServer\src\WebHandlers.cpp: In member function ‘AsyncStaticWebHandler& AsyncStaticWebHandler::setLastModified()’:
.pio\libdeps\nodemcuv2\ESP Async WebServer\src\WebHandlers.cpp:78:25: error: ‘time’ was not declared in this scope
if(time(&last_modified) == 0) //time is not yet set
^
.pio\libdeps\nodemcuv2\ESP Async WebServer\src\WebHandlers.cpp: In member function ‘AsyncStaticWebHandler& AsyncStaticWebHandler::setLastModified(time_t)’:
.pio\libdeps\nodemcuv2\ESP Async WebServer\src\WebHandlers.cpp:74:1: warning: control reaches end of non-void function [-Wreturn-type]
}

The time issue is known to me, I had a similar problem, it’s one of the libraries that the code uses.

Platformio should download the correct version although it looks like it didn’t.

The clash (from memory) is between

and

PlatformIO should be using version #6b4841f of NTPCLIENT.

If you read the comments at the top of main.cpp you will notice

/*
*** NOTE IF YOU GET ISSUES WHEN COMPILING IN PLATFORM.IO ***

ERROR: “ESP Async WebServer\src\WebHandlers.cpp:67:64: error: ‘strftime’ was not declared in this scope”

Delete the file \diyBMSv4\ESPController.pio\libdeps\nodemcuv2\Time\Time.h

The time.h file in this library conflicts with the time.h file in the ESP core platform code
*/

1 Like

Can you raise a feature request on GITHUB for this please?

Ordered the parts and boards too, was just about to finally get parts for v3 since I ordered boards long ago but then saw that there’s v4 just released :slight_smile: Thanks stuart for all the work!

Just too bad that for some life reasons stuart has been diverted into platformio’s complicated messy workflow that makes everyone else cry :smiley: Should be rather simple arduino ide sketch with ide being loaded with required libraries… maybe we can convince stuart to just export an arduino ide sketch for the peasants? Or is there some particular benefit or feature why it should be done in platformio?

Watching adam welch messing around with it a lot before getting it to run was already saddening, i’m sorry! :smiley:

1 Like

I don’t use platformio with VSCODE - I use the ATOM IDE. I think Microsoft VSCODE is the problem most folks have in setup and configuration!

The key point of platformio is its library management - the existing Arduino library manager is terrible!

However its a fair point on the learning curve. I may look at doing pre-compiled binary files that can be uploaded directly into WeMos/ATTINY and what that would need to save any compilation.

Yeah that would be quite helpful I believe. Also the managment might be terrible for power users like you, but maybe when you already know what is needed then listing required libraries for amateurs for arduino IDE isnt too difficult? :slight_smile:
But yeah, binaries for wemos and attinys would make the project a lot more approachable for many i’m sure.

I uploaded the 3D print solder stencil for v4.

Check out thingiverse thing no 3521803 “diyBMS stencil (v3 and v4)”
(Currently I cannot send you a link as the system thinks it is spam…) fixed Mod.

Have fun.

3 Likes

Thanks Stuart, that worked perfect! I got the ESP programmed. I am documenting the steps it takes to program the boards. I will try to make a video once I have it all sorted out.

1 Like

hi
im currently building v4 at the moment, wonder if someone can tell me what programmer is needed to program the chips, i have several programmers that i have been using for aduino so one of them might work?
thanks

You will need to use PlatformIO to compile the code - the WeMos is programmed from a USB cable, the ATTINY will need to be programmed using in system programming (ISP) - use another Arduino to do this.

Loads of instructions on the internet about this.

Thanks think i have sorted the compiler out
Thanks

Hi Stuart, Thanks for the awesome project, unfortunetly the
SDNT2012X473F4150FTF thermistor is no longer available at LCSC.com, and has been discontinued, would the
NTC Thermistors 1/5W 47KOhms ±5% 4050K 0805 RoHS
be a drop in replacement?

Yes, I am using that same one, it works

If people are having issues with compiling the code, I’ve created a pre-compiled version, basic instructions are here. I’d only use this if you are happy with the command line!

2 Likes

Hi Stuart, about the PCF8574AT/3 SO-16-W, is this compatible?
https://www.mouser.it/ProductDetail/NXP-Semiconductors/PCF8574AT-3518?qs=%2Fha2pyFaduh53QM8HfphYR4blmhc4IT5Vi4RCWKyooqe4Z1cH0BkWg%3D%3D
Thanks

Yes that looks like the correct part @cipel