MQTT Setup for Windows

418 views
Skip to first unread message

Soggy Paws

unread,
Mar 3, 2021, 1:53:37 AMMar 3
to electrodacus
I need a little guidance making the final leap to connect the Electrodacus with wifi to an MQTT broker on my computer.

I have installed mosquitto 2.0.8 on Windows 7.  Connected to a local wifi access point.  Computer IP address is 192.168.8.114
Electrodacus (latest model with ESP32 Wifi module running Version: 0.3-dirty) is connected to the same access point. It's IP address is http://192.168.8.141/ and when I put in 
http://192.168.8.141/index.html in my browser window on the computer, I see the Electrodacus html file.

Have a mosquitto.conf file set up with a password file and 2 users.

Have used this tutorial to confirm that my broker is running and I can subscribe and publish something from both users.

(basically get 3 cmd windows running, one is the broker, one is the subs, and one is the pub)

Broker startup: 
c:\Program Files\mosquitto>mosquitto -c mosquitto.conf -v

Subscribe:
c:\Program Files\mosquitto>mosquitto_sub -h localhost -p 1883 -u XXXXX -P XXXXXXX -t temperature

Publish:
c:\Program Files\mosquitto>mosquitto_pub -h localhost -p 1883 -u XXXXX -P XXXXXXX -t temperature -m 45

I see the right things happening on the broker console when I start up, and when I subscribe.  When I publish, I see a "45" come up on the subscribe screen.  I have verified the electrodacus username and password is working/configured properly in the password file.

Here is my Electrodacus configuration screen.
Wifi Settings Screen with MQTT.jpg
Based on what I understand, I should be able to subcribe to "sbms" and see *something* coming from the sbms?  But I don't get anything.

When the broker starts up, it says this:
c:\Program Files\mosquitto>mosquitto -c mosquitto.conf -v
1614753834: mosquitto version 2.0.8 starting
1614753834: Config loaded from mosquitto.conf.
1614753834: Opening ipv6 listen socket on port 1883.
1614753834: Opening ipv4 listen socket on port 1883.
1614753834: mosquitto version 2.0.8 running
1614753884: New connection from ::1:62269 on port 1883.
1614753884: New client connected from ::1:62269 as auto-2017FC54-7D68-5B0B-E026-
E3FFF1B7DC43 (p2, c1, k60, u'sherry').
1614753884: No will message specified.
1614753884: Sending CONNACK to auto-2017FC54-7D68-5B0B-E026-E3FFF1B7DC43 (0, 0)
1614753884: Received SUBSCRIBE from auto-2017FC54-7D68-5B0B-E026-E3FFF1B7DC43
1614753884:     sbms (QoS 0)
1614753884: auto-2017FC54-7D68-5B0B-E026-E3FFF1B7DC43 0 sbms
1614753884: Sending SUBACK to auto-2017FC54-7D68-5B0B-E026-E3FFF1B7DC43
1614753944: Received PINGREQ from auto-2017FC54-7D68-5B0B-E026-E3FFF1B7DC43
1614753944: Sending PINGRESP to auto-2017FC54-7D68-5B0B-E026-E3FFF1B7DC43

When I finally got a listener set up in the configuration file
listener 1883
and restarted the broker, I got a query from Windows about letting it through the firewall.  I selected "on my local network only".

Still not receiving anything from the Electrodacus.
Do I need to update the firmware in the ESP32??  (OMG, please don't say yes.)

Thanks
Sherry

Robert Tagscherer

unread,
Mar 3, 2021, 2:36:28 AMMar 3
to electrodacus
Hi Sherry,

I'm not sure about the windows firewall, can you try connecting from another machine? It is strange that no connection attempt is logged.

I think the topic will be /sbms as the prefix is set to /

Kohala Jim

unread,
Mar 3, 2021, 12:37:05 PMMar 3
to electrodacus
you could also try wildcarding the broker output by using "#" and see if there's any traffic

Soggy Paws

unread,
Mar 3, 2021, 8:44:11 PMMar 3
to electrodacus
Robert, so it looks like my setup is correct?  Do I need to power cycle the wifi after saving the settings?  I will try from another computer, but I guess that means I need to install mosquitto on another computer.  Is there an Android app that would send MQTT stuff to test this?
Sherry

Kohala Jim,
Please explain your suggestion in a little more detail.  Do I put a # in the wifi setup?
Or some setting in the conf file?
Sorry I'm really a noob just wandering around in the dark at this point.  I'm amazed I've gotten this far.
Thanks for any suggestions!

Sherry

Soggy Paws

unread,
Mar 3, 2021, 9:53:58 PMMar 3
to electrodacus
OK, I installed MQTT Tester on my Android phone and connected to the boat network, and then the MQTT broker using the electrodacus credentials and I can see the connection on the broker screen, and publish something and see it reflected on the broker screen.  So it's not the firewall.
I finally figured out how to reset the Wifi (disable, then re-enable on the wifi screen on the Electrodacus) (my husband has been doing the hands on with the 'dacus, so not familiar with the menus there), that seemed to do the trick.  I now see something coming in to my broker from the electrodacus!  On to step 2 (hooking up Node Red to decode and display what's coming in).
Sherry

Kohala Jim

unread,
Mar 3, 2021, 10:56:41 PMMar 3
to electrodacus
You're halfway home now that your getting posts to your broker...

My "sandbox" Node-RED UI for the SBMS0 is posted below.
The 1 Hz MQTT update payload seemed to bog down my Pi 3B+ and dashboard, and I've added smoothing at Robert's suggestion. It's been running smooth and responsively ever since.
I also included the resulting "sandbox" dashboard view as well (in the green highlight)

My SBMS0 is powered up only with a simulated battery via a resistive voltage divider just for piloting and sandbox purposes.
There's no substitute for repeated build and deploy testing with lots of "debugging"
Enjoy the journey and the rich data visualizations that Node-RED can bring.
My next challenge is to begin abstracting data objects in Node- RED and setting up more customized automation.
Also having a blast with Tasmota Rules and other hacks I'm piecing together.




Soggy Paws

unread,
Mar 4, 2021, 12:23:38 AMMar 4
to electrodacus
That's really cool.  I've done one other node-red implementation, but still really a novice.  Would you mind sharing your node-red flows file with me? It would save me a lot of time figuring out how to parse things and do the smoothing.  I know I can't just plop your flows file and have it work, but I can fix what won't work.
Thanks!

Kohala Jim

unread,
Mar 4, 2021, 8:59:31 PMMar 4
to electrodacus
Tried attaching my SBMS Flow export as a text file and I'm foiled by the forum manager:



Here's the export content in the post body:

[{"id":"cac8f16b.f8fae","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"ebfd0e5c.ab454","type":"ui_chart","z":"cac8f16b.f8fae","name":"Voltage Trend","group":"5a69374f.fc8a28","order":6,"width":"6","height":"3","label":"Cells (mV)","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"12","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"x":1120,"y":240,"wires":[[]]},{"id":"c847da07.08ab38","type":"change","z":"cac8f16b.f8fae","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.soc","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":280,"wires":[["23683a26.487e26"]]},{"id":"aabe2316.7ac82","type":"json","z":"cac8f16b.f8fae","name":"","property":"payload","action":"","pretty":false,"x":210,"y":60,"wires":[["5efe273a.c1bc38","c847da07.08ab38","88687900.0bce38","ef7a3d8c.2538f","e620b550.9f2e98","208cadb3.a5c752","8fbbb982.c021b8","f033dffa.c133","dcf7fc37.dc78b","b4c18d92.d7a09","99929596.d07f08","ca526e00.989ff"]]},{"id":"9f8453ef.4d00b","type":"ui_level","z":"cac8f16b.f8fae","group":"5a69374f.fc8a28","order":7,"width":"6","height":"1","name":"SOC","label":"Battery SOC%","colorHi":"#49e600","colorWarn":"#ffee00","colorNormal":"#b3002d","colorOff":"#595959","min":0,"max":100,"segWarn":"","segHigh":"","unit":"","layout":"sh","channelA":"","channelB":"","decimals":0,"animations":"soft","shape":"2","colorschema":"rainbow","textoptions":"default","colorText":"#eeeeee","fontLabel":"","fontValue":"","fontSmall":"","colorFromTheme":true,"textAnimations":true,"hideValue":false,"tickmode":"auto","peakmode":false,"property":"payload","peaktime":3000,"x":829,"y":282,"wires":[]},{"id":"5efe273a.c1bc38","type":"change","z":"cac8f16b.f8fae","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.cellsMV[0]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":120,"wires":[["954401e0.dd22a"]]},{"id":"88687900.0bce38","type":"change","z":"cac8f16b.f8fae","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.cellsMV[1]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":160,"wires":[["71ccdb8e.2e7ee4"]]},{"id":"ef7a3d8c.2538f","type":"change","z":"cac8f16b.f8fae","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.cellsMV[6]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":200,"wires":[["ac9f08c6.1ba7e8"]]},{"id":"e620b550.9f2e98","type":"change","z":"cac8f16b.f8fae","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.cellsMV[7]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":240,"wires":[["9d42d91d.375ba8"]]},{"id":"8fbbb982.c021b8","type":"change","z":"cac8f16b.f8fae","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.flags.CFET","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":360,"wires":[["ec20a8fd.e10a68"]]},{"id":"f033dffa.c133","type":"change","z":"cac8f16b.f8fae","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.flags.DFET","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":400,"wires":[["d1ef7d18.f17a8"]]},{"id":"dcf7fc37.dc78b","type":"change","z":"cac8f16b.f8fae","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.flags.EOC","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":440,"wires":[["ec17bbbf.6a9638"]]},{"id":"b4c18d92.d7a09","type":"change","z":"cac8f16b.f8fae","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.flags.LVC","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":480,"wires":[["2cd35046.01f76"]]},{"id":"208cadb3.a5c752","type":"change","z":"cac8f16b.f8fae","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.tempInt","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":320,"wires":[["b1ae4e1f.58362"]]},{"id":"a9729d7f.1e425","type":"debug","z":"cac8f16b.f8fae","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1110,"y":320,"wires":[]},{"id":"99929596.d07f08","type":"change","z":"cac8f16b.f8fae","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.currentMA.battery","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":520,"wires":[["bd35f6fc.25c4d8"]]},{"id":"ca526e00.989ff","type":"change","z":"cac8f16b.f8fae","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.currentMA.extLoad","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":560,"wires":[["8bb65035.15c65"]]},{"id":"2b5f5c77.ae69b4","type":"mqtt in","z":"cac8f16b.f8fae","name":"SBMS0","topic":"solar/sbms","qos":"2","datatype":"auto","broker":"c9a5885a.133998","x":70,"y":60,"wires":[["aabe2316.7ac82"]]},{"id":"df40b7c5.682dc8","type":"change","z":"cac8f16b.f8fae","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"mV1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":849,"y":122,"wires":[["5272826e.98d5fc","ebfd0e5c.ab454"]]},{"id":"5ee48cf7.242444","type":"ui_text","z":"cac8f16b.f8fae","group":"5a69374f.fc8a28","order":1,"width":"3","height":"1","name":"Cell 1","label":"Cell 1","format":"{{msg.payload}} mV","layout":"col-center","x":809,"y":62,"wires":[]},{"id":"c88385f4.933e38","type":"change","z":"cac8f16b.f8fae","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"mV2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":849,"y":162,"wires":[["5272826e.98d5fc","ebfd0e5c.ab454"]]},{"id":"2c632546.bb73ca","type":"ui_text","z":"cac8f16b.f8fae","group":"5a69374f.fc8a28","order":2,"width":"3","height":"1","name":"Cell 2","label":"Cell 2","format":"{{msg.payload}} mV","layout":"col-center","x":929,"y":62,"wires":[]},{"id":"3e02d5a2.44397a","type":"change","z":"cac8f16b.f8fae","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"mV7","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":849,"y":202,"wires":[["5272826e.98d5fc","ebfd0e5c.ab454"]]},{"id":"a69f4c7f.6d5f5","type":"ui_text","z":"cac8f16b.f8fae","group":"5a69374f.fc8a28","order":3,"width":"3","height":"1","name":"Cell 7","label":"Cell 7","format":"{{msg.payload}} mV","layout":"col-center","x":1049,"y":62,"wires":[]},{"id":"cb6b9b39.270018","type":"change","z":"cac8f16b.f8fae","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"mV8","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":849,"y":242,"wires":[["5272826e.98d5fc","ebfd0e5c.ab454"]]},{"id":"c65fca99.816e18","type":"ui_text","z":"cac8f16b.f8fae","group":"5a69374f.fc8a28","order":4,"width":"3","height":"1","name":"Cell 8","label":"Cell 8","format":"{{msg.payload}} mV","layout":"col-center","x":1169,"y":62,"wires":[]},{"id":"bd08fa5c.4ab4c8","type":"ui_led","z":"cac8f16b.f8fae","order":9,"group":"5a69374f.fc8a28","width":"3","height":"1","label":"CFET","labelPlacement":"left","labelAlignment":"left","colorForValue":[{"color":"#8d8b8b","value":"false","valueType":"bool"},{"color":"#008000","value":"true","valueType":"bool"}],"allowColorForValueInMessage":false,"shape":"circle","showGlow":true,"name":"CFET","x":829,"y":362,"wires":[]},{"id":"1fd2a182.fbc8ae","type":"ui_led","z":"cac8f16b.f8fae","order":10,"group":"5a69374f.fc8a28","width":"3","height":"1","label":"DFET","labelPlacement":"right","labelAlignment":"right","colorForValue":[{"color":"#888686","value":"false","valueType":"bool"},{"color":"#008000","value":"true","valueType":"bool"}],"allowColorForValueInMessage":false,"shape":"circle","showGlow":true,"name":"DFET","x":829,"y":402,"wires":[]},{"id":"c287ef6.bab7a1","type":"ui_led","z":"cac8f16b.f8fae","order":11,"group":"5a69374f.fc8a28","width":"3","height":"1","label":"EOC","labelPlacement":"left","labelAlignment":"left","colorForValue":[{"color":"#8d8b8b","value":"false","valueType":"bool"},{"color":"#008000","value":"true","valueType":"bool"}],"allowColorForValueInMessage":false,"shape":"circle","showGlow":true,"name":"EOC","x":829,"y":442,"wires":[]},{"id":"f6e72a87.04ed88","type":"ui_led","z":"cac8f16b.f8fae","order":12,"group":"5a69374f.fc8a28","width":"3","height":"1","label":"LVC","labelPlacement":"right","labelAlignment":"right","colorForValue":[{"color":"#888686","value":"false","valueType":"bool"},{"color":"#008000","value":"true","valueType":"bool"}],"allowColorForValueInMessage":false,"shape":"circle","showGlow":true,"name":"LVC","x":829,"y":482,"wires":[]},{"id":"1c55ea12.059636","type":"ui_level","z":"cac8f16b.f8fae","group":"5a69374f.fc8a28","order":8,"width":"6","height":"1","name":"Int Temp","label":"SBMS Temp°C","colorHi":"#e60000","colorWarn":"#ffee00","colorNormal":"#27b300","colorOff":"#595959","min":"0","max":"50","segWarn":"","segHigh":"","unit":"","layout":"sh","channelA":"","channelB":"","decimals":0,"animations":"soft","shape":"2","colorschema":"rainbow","textoptions":"default","colorText":"#eeeeee","fontLabel":"","fontValue":"","fontSmall":"","colorFromTheme":true,"textAnimations":true,"hideValue":false,"tickmode":"auto","peakmode":false,"property":"payload","peaktime":3000,"x":839,"y":322,"wires":[]},{"id":"610398a5.840968","type":"ui_gauge","z":"cac8f16b.f8fae","name":"Battery","group":"5a69374f.fc8a28","order":13,"width":"3","height":"3","gtype":"donut","title":"Battery","label":"mA","format":"{{value}}","min":"-100","max":"100","colors":["#d21919","#e6e600","#06cb1d"],"seg1":"","seg2":"","x":839,"y":522,"wires":[]},{"id":"910cd66f.4b1628","type":"ui_gauge","z":"cac8f16b.f8fae","name":"Ext Load","group":"5a69374f.fc8a28","order":14,"width":"3","height":"3","gtype":"donut","title":"Ext Load","label":"mA","format":"{{value}}","min":"-100","max":"100","colors":["#d21919","#e6e600","#06cb1d"],"seg1":"","seg2":"","x":839,"y":562,"wires":[]},{"id":"5272826e.98d5fc","type":"ui_chart","z":"cac8f16b.f8fae","name":"Voltage Bars","group":"5a69374f.fc8a28","order":5,"width":"6","height":"3","label":"Cells (mV)","chartType":"horizontalBar","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"x":1109,"y":162,"wires":[[]]},{"id":"954401e0.dd22a","type":"smooth","z":"cac8f16b.f8fae","name":"","property":"payload","action":"mean","count":"60","round":"0","mult":"multi","reduce":true,"x":580,"y":120,"wires":[["5ee48cf7.242444","df40b7c5.682dc8"]]},{"id":"71ccdb8e.2e7ee4","type":"smooth","z":"cac8f16b.f8fae","name":"","property":"payload","action":"mean","count":"60","round":"0","mult":"multi","reduce":true,"x":580,"y":160,"wires":[["2c632546.bb73ca","c88385f4.933e38"]]},{"id":"ac9f08c6.1ba7e8","type":"smooth","z":"cac8f16b.f8fae","name":"","property":"payload","action":"mean","count":"60","round":"0","mult":"multi","reduce":true,"x":580,"y":200,"wires":[["a69f4c7f.6d5f5","3e02d5a2.44397a"]]},{"id":"9d42d91d.375ba8","type":"smooth","z":"cac8f16b.f8fae","name":"","property":"payload","action":"mean","count":"60","round":"0","mult":"multi","reduce":true,"x":580,"y":240,"wires":[["c65fca99.816e18","cb6b9b39.270018"]]},{"id":"23683a26.487e26","type":"smooth","z":"cac8f16b.f8fae","name":"","property":"payload","action":"mean","count":"60","round":"0","mult":"multi","reduce":true,"x":580,"y":280,"wires":[["9f8453ef.4d00b"]]},{"id":"b1ae4e1f.58362","type":"smooth","z":"cac8f16b.f8fae","name":"","property":"payload","action":"mean","count":"60","round":"0","mult":"multi","reduce":true,"x":580,"y":320,"wires":[["1c55ea12.059636"]]},{"id":"ec20a8fd.e10a68","type":"smooth","z":"cac8f16b.f8fae","name":"","property":"payload","action":"max","count":"60","round":"0","mult":"multi","reduce":true,"x":580,"y":360,"wires":[["bd08fa5c.4ab4c8"]]},{"id":"d1ef7d18.f17a8","type":"smooth","z":"cac8f16b.f8fae","name":"","property":"payload","action":"max","count":"60","round":"0","mult":"multi","reduce":true,"x":580,"y":400,"wires":[["1fd2a182.fbc8ae"]]},{"id":"ec17bbbf.6a9638","type":"smooth","z":"cac8f16b.f8fae","name":"","property":"payload","action":"max","count":"60","round":"0","mult":"multi","reduce":true,"x":580,"y":440,"wires":[["c287ef6.bab7a1"]]},{"id":"2cd35046.01f76","type":"smooth","z":"cac8f16b.f8fae","name":"","property":"payload","action":"max","count":"60","round":"0","mult":"multi","reduce":true,"x":580,"y":480,"wires":[["f6e72a87.04ed88"]]},{"id":"bd35f6fc.25c4d8","type":"smooth","z":"cac8f16b.f8fae","name":"","property":"payload","action":"mean","count":"60","round":"0","mult":"multi","reduce":true,"x":580,"y":520,"wires":[["610398a5.840968"]]},{"id":"8bb65035.15c65","type":"smooth","z":"cac8f16b.f8fae","name":"","property":"payload","action":"mean","count":"60","round":"0","mult":"multi","reduce":true,"x":580,"y":560,"wires":[["910cd66f.4b1628"]]},{"id":"5a69374f.fc8a28","type":"ui_group","name":"Off-Grid Power Monitor","tab":"342ae5e1.a2feca","order":1,"disp":true,"width":"6","collapse":false},{"id":"c9a5885a.133998","type":"mqtt-broker","name":"MQTT Broker","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"342ae5e1.a2feca","type":"ui_tab","name":"Node-RED Dashboard","icon":"tv","order":1,"disabled":false,"hidden":false}]


Soggy Paws

unread,
Mar 5, 2021, 7:39:35 PMMar 5
to electrodacus
Great, that should be very helpful!  I did make a little progress yesterday--I got the SOC displayed!  But this should speed things up a bit.  Thanks a lot!
Sherry

Kohala Jim

unread,
Mar 5, 2021, 9:02:20 PMMar 5
to electrodacus
Single message dashboard widgets are easy once you parse the underlying payloads with JSON
The multi-input dashboard widgets had me stumped until I finally saw the "topic:payload" dependency, then everything clicked using the change node topic injection.
Would love to see where you land and if you're considering data storage into Influx where you can extract history via Grafana.

Soggy Paws

unread,
Mar 7, 2021, 9:48:03 PMMar 7
to electrodacus
Just so everyone can see what's possible with MQTT (output from the latest Wifi module code), and node-red (a non-programming visual "language" and real data... I'm still massaging this display, and trying to figure out how to save the data in a database (maybe Influxdb) on Windows.  But it is very revealing to see the individual cells in a graphical format just after the end of charge.  In the graph, you can see the blue line being depressed (the Electrodacus is balancing cell #2, which is our perpetually high cell).  With changing one setting on a configuration for the graphing "node", you can set the timeline for the graph to 12 hrs, 6 hrs, or X hrs, and it auto-ranges the data.  Right now it's set for 3 hrs so we could blow up the end of charge curves.  Tomorrow we'll do one with balancing turned off, just to get an accurate picture of the true cell curve for each cell.
node-red early shot.jpg

A few things that aren't on the dashboard yet
- Battery temp sensor (we just got ours hooked up last night, and I haven't had a chance to add it in)
- Battery total voltage
- More of the Flags showing
- Some kind of historical data (either a CSV type log that can be pulled into Excel, or searched, or something fancier like a database)

I am working on a "how-to" document for getting this set up on Windows, which I'll make available soon.  I'll also likely have some info on setting up on Raspberry Pi, as I've done this for my RPi also on a different project. But there are tons of how-to's for RPi, not so much for Windows.  If anyone is interested in a not-quite-finished version of how to set this up now, let me know.

Kohala Jim

unread,
Mar 7, 2021, 11:07:40 PMMar 7
to electrodacus
Looking good!
Where did you land with your smoothing interval?

T McNamara

unread,
Mar 8, 2021, 7:32:47 AMMar 8
to electrodacus
Great Work
I would be interested -what do you need to send me the doc as I am new to google-groups
Terry

Soggy Paws

unread,
Mar 8, 2021, 7:38:54 AMMar 8
to electrodacus
I have different intervals... the cells and battery and amps are at 10.  The SOC and temps are at 30.  The LED's don't work right if you have any interval, because they come in at true/false and end up at 1/0 in the smoothing algorithm, but the LED wants them at true/false.
I added some functions instead of change nodes to do some math... including summing the cells to get a battery voltage, and turning the mV and mA into V and A, etc.  I'll send you my flows file when I get a little more done, so you can see what I've done.  My layout is different because I'm not trying to push all my electrical stuff onto one page.  I've got a tab for Port Alternator, one for Stbd Alternator, and one for the Battery.

Matt Baker Design

unread,
Mar 10, 2021, 8:51:48 AMMar 10
to electrodacus
All of this How-To Mqtt is much appreciated! Thanks for detailed setup instructions. I have the wifi working, but just getting a broker setup for mqtt is someone mystifying.  

John Gibson

unread,
Jun 7, 2021, 9:20:52 AMJun 7
to electrodacus
Soggy,

Spent some time on your website, exceptionally great information and I learned a lot.  I just received my SBMS0 and am building a system for a home made overland rig with node red at the core of controls.  I was wondering if you would be willing to share your NR flow with me as a jump start to my development.  Thank you in advance.

Jhon

unread,
Jun 10, 2021, 9:39:27 AMJun 10
to electrodacus
I want to try and do something similar this coming fall, looking forward to the howto's especially for the Pi.  Project plans have changed, wife wants a (summer) "garden office" (Glorified garden shed with solar and insulation) Will be building over this summer.

Soggy Paws

unread,
Jun 10, 2021, 9:00:23 PMJun 10
to electrodacus
John, I did email you a zipped copy of my latest Flows file.  Happy to share with anyone else.
Sherry

PeterBC

unread,
Jul 25, 2021, 2:33:45 AMJul 25
to electrodacus
Thanks so much to all , and especially Sherry from Soggy Paws for such detailed info on their website about this http://svsoggypaws.com/electrodacus.htm .  Even with that I was somewhat overwhelmed having not programmed since the late 80's with Turbo Pascal and the many steps to setup can be finicky.. I was stuck for a while nothing progressing when I realised I'd 'selected' some text in the CMD prompt Broker window, which feezes the app !  I've finally managed to get this going on my 'test' rig and test batteries (just 6AH set of cells). On a windows desktop for now.. 

The Node-Red flow stuff had me bluffed for a while but without inordinate effort I think I've customised Sheery's Json she kindly provided , to allow for 8 cells.  Even converted back to Celsius. But I've a factor of 10 issue with Ah reading .. its -2.28 Ah. No drama.. 

Sherry is  there any reason you'd prefer not for me to attach my modified version of your json here for anyone else to use as a starting point ?  Trying to copy the json text from your PDF was a bridge too far for me ! Or best perhaps you attach your zip  on this forum with the couple of other items you included or put on your website ? 




Capture.PNG

The Node-Red flow looks like this !  somewhat daunting to a non programmer who's never touched something like this ! 
Capture2.PNG

This might also be the ugliest battery build you've ever seen ..  my test rig . .. 

TestRig.png

Soggy Paws

unread,
Jul 25, 2021, 8:52:25 PMJul 25
to electrodacus
Great! Glad you got it working.  It is a bit of a learning curve, but the results justify the time spent.
Sure, go ahead and post your json file.  I should also post what I emailed out to you as a download from our Electrodacus page.  Thanks for the suggestion.

Sherry

PeterBC

unread,
Aug 1, 2021, 6:14:26 PMAug 1
to electrodacus
Attached is my Json flows file, modified from Sherry's to include 8 Cells, and report in Celsius not Farenheit. 

I've even now managed to get this reporting to an AWS LightSail Cloud server running node-js.  My first ever AWS host, and I'm no unix nerd, but managed to get this going without too much issue. The instance costs US$5.mon after 3 months free.  Created the instance using node-js 'application'. Attached a public IP, downloaded my SSH keys (.pem file). Using FileZilla configured to that to extract my electrodacus.log files and dailystats.logs for other analysis.
https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-connecting-to-linux-unix-instance-using-sftp

Currently viewable by http://fhdacus.trackright.com.au:1880/ui but I'll pwd protect that soon (I hope !). 

For me monitoring my boat remotely this removes dependancies on the onboard PC which has proven tricky. I just point the SBMS0 to the public IP of my AWS instance and am logging all info etc there. Of course your boat needs an internet connection which I use via  4G mifi device. 
PCflows.json

PeterBC

unread,
Aug 1, 2021, 6:16:08 PMAug 1
to electrodacus
I forgot to mention I also had to add firewall rules on AWS to allow ports 1880 and 1883 tcp and udp.

PeterBC

unread,
Aug 2, 2021, 2:57:21 PMAug 2
to electrodacus
Saw the power of this graphing today. Since Im yet to rewire my PV shunt correctly, my SOC % is way off after 4 days on battery. Most of this evening (4pm to midnight) all looked stable. up to 6pm some heavy loads then calm, and flat 3.2 v on cells, Delta just 8mv.  Starting my midnight the volts began dropping, loosing the 200mv to 3.0v in 4 hrs, even with a lowish 100W base draw only on the battery (816AH).  Delta also rose peaking at 80mv near LVD. 

I saw this an hr ago, and alerted my captain who was off the boat to get the gen on or connect to shorepower, which they did just as LVD was about to kick in (currently at 2.85v). From the slope I could accurately predict they only had an hr or so left till 3.0 V breached which is my new LVD point. 

The rate of drop and delta rise were much easier to see here than on the live SBMS0 graphs. An interesting example of LiFEPO4 behaviour at this end of the voltage profile, and why its so dangerous to manually try to manage these end points. Things can move relatively quickly.

Capture.PNG

Dacian Todea

unread,
Aug 3, 2021, 1:37:55 AMAug 3
to electrodacus
Yes voltage will change very fast both when close to full charge and also when close to full discharge.
I usually show this graph of voltage vs SOC.  There is no voltage graph on the SBMS as that is not very useful. Once you have the current shunt properly installed and set the SOC will be fairly accurate so you will know even easier than looking at a voltage graph how much energy you have left in the battery.

LFP.gif

Message has been deleted

GLASHINC Developments

unread,
Aug 4, 2021, 7:25:21 PMAug 4
to electrodacus
Just thought I would post an example of how cell voltages change at end of charge.  This is how my system gets to 100% SOC.  OV triggers at the default 3.55V after 6s.
EOC 1a 20210717.PNG

PeterBC

unread,
Aug 4, 2021, 7:39:03 PMAug 4
to electrodacus
Yes , colourful graphs !  Interesting 'cris cross' behaviour of the lower cells. about a 4mv hysterisis on a 4sec cycle. . Is that from an excel graph ? I note the node-red stuff from Sherry does 10sec smoothing of readings to remove some of that behaviour. I'm expecting that might be system effects rather than real volts on the cells jumping up and down 4mv on a 4 sec cycle.

And here is my system hitting HVD, 3 times in 20mins or so. I'd forgotten to set the Max SOC down to 90% so that it doesnt just start charging from shorepower again when all cells drop below 3.4v setting.  This was charging at 95amps (0.12C for my 816AH pack). There was a 250W load too so it quickly dropped below 3.4v. 

I then was worried as it started again a few hrs later well before it had dropped to 90% SOC.. but that was because of midnight tick over and so it charges once on a new day to 100% again. (The times are local to me , not where the boat is). 

Clipboard01.jpg

Dacian Todea

unread,
Aug 4, 2021, 9:33:44 PMAug 4
to electrodacus
The cell balancing is 3 second ON and 3 seconds off and that is what you see in that graph. Some cells see a large fluctuation due to cell balancing current applied on only one of the two sense wires maybe from the balancing neighboring cell.
Looks like cell 1 was the lowest cell voltage so that did not required cell balancing but since the neighboring cell 2 required cell balancing the common wire cell 1 and cell 2 share had a voltage drop and that was subtracted from cell 2 but added to cell 1 due to the current flow direction in that sense wire.
The only other cell that sees large fluctuation is cell 8 because is at the end of the pack so it has a common sense wire with cell 7 that is also being balanced but it also has a wire not shared with any other cell and that wire will have a cell voltage drop that will subtract from cell 8 real voltage during those 3 seconds interval when cell balancing is active.
The other cells are in between other cells that are also being balanced so cell balancing current is both added and subtracted thus result is about zero so you do not see almost any effect on read voltage when cell balancing is active.

So to summarize cells 2 to 8 all required cell balancing  and the cells on the sides the 2 and 8 show a voltage lower by the amount of voltage drop on once of the sense wires and cell 1 is not balanced but due to proximity to cell 2 they have a common wire and that voltage drop adds to the real voltage of cell 1 when cell 2 balance current is ON.

PeterBC

unread,
Aug 4, 2021, 9:46:23 PMAug 4
to electrodacus
Thanks Daican for a comprehensive explanation as usual ! 

When my cells were balancing I had much more significant voltage swings (up to 100mv). I'm using a Heltec  2amp active balancer now so I turned off SBMS0 balancing. You can see the effect before and after disabling. The Heltec has its own wires to each cell. 

Balancing Swings.PNG

Dacian Todea

unread,
Aug 4, 2021, 10:06:04 PMAug 4
to electrodacus
You can not have 100mV swing unless you have one cell that is not balancing and two cells on each side that need balancing then that non balancing cell will have both sense wire drop added to that one cell same for a cell that is balancing but none of the neighboring cell need that.
In any case that cell voltage delta is not real is just measurement error due to cell balancing current the real cell voltages are those seen in those 3 seconds when cell balancing is OFF.
SBMS0 knows to ignore that cell delta and I prefer to display that for user. I can cheat and correct that voltage drop to always show the real cell voltage but then it will be hard to diagnose a cell balancing issue as you will not know for sure if cell balancing works by just looking at the SBMS0 screen.
You can do that correction yourself and display a clean graph by just checking what cells have balancing active and adjust the displayed voltages. Or an even simpler method take the lowest cell voltage reading in an interval higher than 4 seconds that way since cell balancing is on for only 3 seconds you will always have the real cell voltage by using the lowest cell voltage during an interval higher than 4 seconds.
So you can generate the exact same graph as the one where cell balancing is disabled without disabling the cell balancing. The active balancer can likely not work down to just 10mV delta like the SBMS0 and on top of that active cell balancer has no idea if battery is charged or discharged and so it will do counterproductive work.

Typical the weakest cells (lower capacity higher internal resistance) will be those with highest voltage during charge but during high current discharge the same cells will now have the lowest voltage and SBMS0 knows to balance only during charging but a separate balancer that has no idea what the battery current direction is will try to balance during discharge and that will be the opposite of balancing your pack it will imbalance it.
While you may not notice that there will be some unnecessarily wasted energy to imbalance and then balance the pack. 

PeterBC

unread,
Aug 4, 2021, 11:14:34 PMAug 4
to electrodacus
Thanks again Daican, for yet more education. I am not certain I'll keep the Heltec long term. I was just nervous relying on SBMS0 (we just call it the 'dacus' now) resistive balancing for my large 816AH pack.  https://heltec-bms.com/project/5a-capacitive-active-equalization-active-balancer/  is the product (8S version of course). Only US$26.  They claim  up to 5mv 'precision' but usual inadequate documentation on exactly what they do !  Low voltage protection claimed to sleep if V < 3.0 and just use 0.1ma in that mode.   

But I understand now your description of a weak cell being high while charged and low while discharged (usually take a few repititions of such ideas to get thru my thick skull).   This device will work hard to pull down and push up during the 2 phases.  I'll see how it pans out and probably try just SBMS0 balancing for a period as well .  I know not to get fussed about the graphs and cell readings while balancing is happening and trust its working as designed to my advantage. 

Early days for me still in 'production' mode (albeit from 12,000 kms away). Learning all the time.  My obsession with monitoring is compensating for not being on the boat with the battery. 

Cheers..Pete

Dacian Todea

unread,
Aug 5, 2021, 12:38:24 PMAug 5
to electrodacus
Pete,

Many years ago when I had the 8s 100Ah GBS battery I did a long therm test where I disabled the cell balancing after cells where perfectly top balanced and run my house for about 4 months with no cell balancing.
Those GBS cells where probably the worse cells compared to any other brand and the type of cells you can find now as there was quite some difference between cells both in therms of capacity but more important internal resistance.
With all that at the end of the 4 months I fully charged the battery (normal charging from solar) and then I manually charged all cells that where bellow the fully charged cell and the cell with highest difference required around 2Ah to be full.
That means there was an average imbalance of around 0.5Ah same as 0.5% since it was a 100Ah battery.
Now since SBMS can balance at around 120 to 200mA say 120mA typical for LiFePO4 due to lower voltage it will have required only a few hours in a month to keep that GBS battery balanced so in a day of solar charging all imbalanced produced in a month could have been corrected thus a battery up to 30x larger capacity can still be keep in balance and maybe even a larger battery if is not as bad as the GBS.  And it will not be practical anyway to have more than a 3000Ah battery.


Also you can check my current LiFePO4 battery 8s 180Ah made with A123 system cells and the degradation over the past 3 years (is 4 years old now but I will not test this year probably next year when it has 5 years).
https://groups.google.com/g/electrodacus/c/nKWp_6tjMNM/m/1f66fW6-BwAJ  the battery is controlled and balanced by the SBMS120 but is basically the same as SBMS0 + some DSSR20 build in.
And I use my battery fairly heavy duty considering the capacity as I also use the DMPPT450 with a large PV array so I can charge the battery fully even in cloudy days.

  
Reply all
Reply to author
Forward
0 new messages