DIYBMS v4

Finally I finished my v4. Everything is working directly - wow.

But:
Grafana/InfluxDB only give me 2 decimals for the voltage “v”. Do you get 3 ore more?
With the BMS v3 I got 3 actually…

Is this on purpose?

Hello @Sebastian_Nobody the influx post from diybmsv4 is in hex which converts to 3 places. Maybe it is database related? I’m currently trying to get data into my RaspberryPI InfluxDB after giving up on MQTT and raspberryPI.

Take a look above, the mqtt messages that @Tiger_One posted show 3 decimal places

Thanks for that @Marko_Kranjcic the requests going to the modules don’t appear to be requesting bank 1. Is the number of banks set to 2 in the settings page?

Unfortunately - yes.
I have to add one more thing to this.
Yesterday, when I have captured this log - after capturing, I have connected charger to batteries, and started charging. Than I have noticed "look, two times are flashing bank0, and than 2 times bank1, and so on (I think it was 2 times).
Later - it again switched to flashing just bank0…

Hello Sebastian,

Referring to Stuart’s comment about Tiger_One’s post:

the mqtt messages that @Tiger_One posted show 3 decimal places

perhaps it’s a Grafana setting that needs changing.

Here’s a screenshot of the Visualization section of the graphics configuration screen in Grafana 6.5.1

I’ve entered the text “SET DECIMAL PLACES HERE” to show where the number of displayed
decimal places is configured. It has a red box around it because of the text.
You would put the number 3 in that box then save your dashboard.
It’ll take at least one screen update interval before the the display reflects the change.

Thanks for your comments/suggestions. But it is not a Grafana issue. I am using Grafana for years now and with diyBMS v3 I got 3 decimals.
Any suggestions else?

Later today I will look to the raw data with chronograph. But I am pretty sure it also will be with two decimals only.

I’m a noob on the InfluxDB and Grafana, just got it running last night late. I struggled with the integration setup on DIYBMSv4. At this point I agree with @Sebastian_Nobody. I did find some discussion online about keeping precision with std:: c++.

I have tried to calibrate the individual cells with a 4 digit (ie. 4.105) and DIYBMSv4 will not accept this, last digit must be zero.

See the legend on left, nothing will show on 3rd place digit.

The code that transmits the HTTP request to Influx is in ESPController/src/main.cpp - around line 510.

Its just using the standard String library to format a float value, which seems to default to 2 decimal places.

I think this line

+ " v=" + String((float)cmi[bank][i].voltagemV/1000.0)

needs changing to

+ " v=" + String((float)cmi[bank][i].voltagemV/1000.0 ,3)

Okay, will try. But as of now I can’t communicate with my DIYBMSv4 via browser console to IP, not sure what happened, looking at debug output now.

Debug output is running extremely slow, like stuck in a loop someplace. I’m checking InfluxDB password for user.

The change you suggested compiled ok and uploaded.

debug (sorry took so long, I changed out some resistors I stole from an old motherboard and replaced with new. no change however)
Looks like it is blowing up when connecting to InfluxDB.

Built another controller board but using same Wemos D1, still no joy? Will order another Wemos.

Thanks Stuart. I see that you already made the changes in the code.
I also saw that the internal temperature “inttemp” comes out with no decimals (20, 21, 22 etc). I think 1 decimal would be nicer.

The modules don’t report the temperature using decimal places - only whole integer values. You don’t really need decimal places for the monitoring, you are just looking for high temperature, so it doesn’t matter is a temp is 50 or 50.6 either way its hot!

Not all wemos D1 units are created equal, I’ve got a few that just about work as well.

Since I added a 3 second delay on power up of the WeMos I’ve also noticed strange WIFI related issues where it won’t connect or only connects randomly on a reboot of the controller.

You still shouldn’t be seeing the “difficulty communicating with the cell monitoring modules” messages though.

Looking at the debug output there are no replies from the modules - so I’d suggest there may be an issue on the optoisolators - check the pins are not shorted out they are quite difficult to solder.

The debug messages should look like your earlier picture with the “R:” message replies being seen.

1 Like

ok, makes sense. From the v3 I was used to decimals also for the temp.
But as discussed and posted as issue on github I would be nice to have a decimals for the external temperature probe.

Thanks @stuart, I have a spare esp32, looking at the pinouts, wonder how hard it would be to connect?

Whoopeeee!!! I’m back up. It was indeed the optoisolator. I started over and walked through connecting each module one at a time in order of my pack. Found the bad module, (solder ball shorted between two legs of the optoisolator). Two modules were bad solder joints.
Thanks for the support @stuart, much appreciated.

1 Like

You are lucky it didn’t go bang!

Looks like I need to take the delay out? Is it in the main? I was up, but when I made a change to influxdb settings, it saved and after reboot I couldn’t get the modules back up. I can see the device connected from my router, as ESP_E67C5E.

@stuart
Hi, i updated every moduls and the controller with your latest fix. Now i cant get config on the modul first in the list. I have tryed 2 wemos but i have the same problem. Config works on every module but not the first module. Dos not mater if i change plase on module.

What can it be?
Thanx!

The delay is in the main file in setup function

This looks like an known existing bug similar to this.

Try putting this line as the first line of setup()

WiFi.mode(WIFI_OFF);

https://github.com/esp8266/Arduino/issues/2702

Think I had a similar wifi problem in my esp32 solar tracker program, will check that code, thanks.