DIYBMS v4

Only almost done: external temperature is not working. Used a spare R19 and read 0°/-40.

Hello Stuart,
beautiful V4 project, thanks for your work !

While i’m waiting for the boards and parts from allpcb/lcsc i’ve made one prototype module by using an arduino prototype shield.
So good so far (communication, voltage, temperature, balancing) except one issue with esp controller - for some reason i cant save settings (Failed to save settings line in red)

I am using wemos d1 r1 and i see no difference between mini and d1 in terms of esp module used.

Any thoughts or ideas regarding “Failed to save issue”?
Thank You

1 Like

@Antel There is XSS protection in the esp-code. When you have the page opened and reset the esp, everything work except saving settings. Simply do a hard reload and it works again.

Regards,
Mario

Have you plugged it into the correct pins on the header?

Soldering wires onto 0805 sized chips is difficult, see if there is a solder bridge or missing connection.

thanks Mario,

almost desperately started looking into the code, but
realised the same by reopening browser :slight_smile:

Why not use the ESP module in “station mode” - and then just connect to it using Wifi?

Adding an LCD display is easy enough, I2C and SPI are both available on the ESP devices.

I have no Wifi infrastructure in my Van. Another option would be ap-mode on the ESP but that consumes around 70mA and would drop the Internet connection on my phone. Access to a tethering client and/or fixed ip is not supported on Android. I thought about using a HM-10 in addition to the ESP8266, but that is even more expensive than an ESP32.

Hello Stuart,

i am planning to use diybms v4 in conjunction with my emoncms (emonpi) , and,
since v4 use different approach to post data (i mean mqtt method) i am a little stuck there

bmsmqtt

So, my question is - can emonhub be configured to read values from diybms topic and post to emon as inputs?

Maybe there is a working config example for v4?

Or, maybe i need a totally different solution like custom os script to read and post data?

Thanks

Take a look at this…

Think the DIYBMS code needs to be changed to push out on the “emon” channel/topic.

An option for those of you with large power packs. 2X5W resistors fit nicely in without any modification.
Resistors slightly proud of the PCB should keep the MOSFET happily within its SOA.

Very clever!

Just so you are aware, the MOSFET is PWM controlled based on the board temperature. The board should not be going over 70 or 80 degrees C.

That tiny MOSFET can handle 32Amp pulsed current and over 5Amp at 70 degrees C.

As designed, the board uses less than 1Amp on the specified resistors.

1 Like

Does anyone have any recommend tutorials on programming the boards with platformio? I am use to arduino development, but this is all new for me. Do you still use the uno for programming? Do you still burn the bootloader? Any pointers would help!

1 Like

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