Status of the MNS COMBOX Project

Started by Wizbandit, December 22, 2023, 12:28:59 PM

Previous topic - Next topic

boB

K7IQ 🌛  He/She/Me

ClassicCrazy

Quote from: Barry Fields on May 23, 2024, 10:23:16 AMIn the simplest of terms that an elderly Tennessee Hillbilly can understand:

What is the issue the Combox is intended to resolve?

What is the issue that MQTT is intended to resolve?

I do appreciate y'alls patience.
Quote from: Barry Fields on May 23, 2024, 10:23:16 AMIn the simplest of terms that an elderly Tennessee Hillbilly can understand:

What is the issue the Combox is intended to resolve?

What is the issue that MQTT is intended to resolve?

I do appreciate y'alls patience.
This was software project that Graham created for the Classic. It is explained on page linked below. Basically the Classic had limitation of being able to only have one modbus link at a time. And that link had to be local or some kind of ip tunnel or whatever. The project linked made it so that something like a raspberry pi could connect to the Classic, and then publish the Classic data as MQTT . Those mqtt packets are easy to send out either locally via pi , or to external source. You don't need to open any ports on your router or do anything magic networking wise. Once the data is in mqtt form - as many clients as you want can get that data at the same time which got rid of the only one connection at a time limitation. Here is the link so you can see the graphic that Graham had made about it. https://github.com/ClassicDIY/ClassicMQTT
I use it via a raspberry pi with my classics and it is stable and never crashes.
 https://github.com/ClassicDIY/ClassicMQTT
Larry
system 1
Classic 150 , 5s3p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal for 24v pack , Outback 3524 inverter
system 2
 5s 135w Kyocero , 3s3p 270w Kyocera  to Classic 150 ,   8s Kyocera 225w to Hawkes Bay Jakiper 48v 15kwh LiFePO4 , Outback VFX 3648 inverter
system 3
KID / Brat portable

Barry Fields

#17
Quote from: ClassicCrazy on May 23, 2024, 03:47:39 PMThis was software project that Graham created for the Classic. It is explained on page linked below. Basically the Classic had limitation of being able to only have one modbus link at a time. And that link had to be local or some kind of ip tunnel or whatever. The project linked made it so that something like a raspberry pi could connect to the Classic, and then publish the Classic data as MQTT . Those mqtt packets are easy to send out either locally via pi , or to external source. You don't need to open any ports on your router or do anything magic networking wise. Once the data is in mqtt form - as many clients as you want can get that data at the same time which got rid of the only one connection at a time limitation. Here is the link so you can see the graphic that Graham had made about it. https://github.com/ClassicDIY/ClassicMQTT
I use it via a raspberry pi with my classics and it is stable and never crashes.
 https://github.com/ClassicDIY/ClassicMQTT
Larry
Your post was really appreciated and kept me out of the bar for a couple of hours.

I am really trying to understand the interconnections. I have attached a crude diagram of what I think I understand.

How does MQTT get to the cloud? Ethernet to the router?

"Basically the Classic had limitation of being able to only have one modbus link at a time." Explain please.

Feel free to edit my diagram iffn ya like.
20 years experience in Field Service and Engineering Support in life support equipment and the computer Industry.
I pride myself in diagnostic skills and NOT knowing everything. I do know how to ask the right questions of those who should know the answers. I can do this politely.

Wizbandit

#18
Quote from: Barry Fields on May 23, 2024, 10:23:16 AMIn the simplest of terms that an elderly Tennessee Hillbilly can understand:

What is the issue the Combox is intended to resolve?


The MNCOMBOX is a "data miner", it gathers data and allows the user to customize their "Dashboard" to display whatever they want or feel is important.  All I do is gather the data, store it in a data base and the user selects what data that want to see using Grafana.  The user can display the data many ways, as a dial, a graph, a bar code graph and many other "visualizations" too numerous to list.

It does not matter where the data is, MQQT Broker (server) somewhere, MODBUS, CANBUS Serial data, I can grab it and format it then write to a "Time Series Database", I use InfluxDB as Grafana interfaces with it well.

Here a screen shot of my dual Rosie Stack testing the new SELL to GRID code.  I have colored the WATTS green when ever "selling" and red when "using" from the grid.  My idea is have everything user customizable.


ClassicCrazy

#19
Quote from: Barry Fields on May 24, 2024, 12:17:10 AMYour post was really appreciated and kept me out of the bar for a couple of hours.

I am really trying to understand the interconnections. I have attached a crude diagram of what I think I understand.

How does MQTT get to the cloud? Ethernet to the router?

"Basically the Classic had limitation of being able to only have one modbus link at a time." Explain please.

Feel free to edit my diagram iffn ya like.

I can't explain to you exactly why the Classic can only connect to one IP modbus at a time - limitation of the hardware I suspect.
Basically the software Graham wrote sends modbus requests to the Classic, and then takes the data requested and converts it to MQTT which is a data that can be easily sent to what is called a broker . The broker can be living at your house on a raspberry pi ( that is how I do mine) or the mqtt data can be sent to a broker server out on the internet somewhere.
Anything that has the credentials ( password) can subscribe to the broker and request that mqtt data. And as it shows in the original diagram  - my raspberry pi program that graphs the data can subscribe, a program running Classic Monitoring app can subscribe, or Home Assistant program could subscribe , etc and they can all subscribe at the same time and gather the data independently to do whatever with it.
Grahams program is requesting the data regularly via modbus so that it is always fresh and timestamped. So that is how it works in a nutshell.
Canbus is different than modbus in that no request for the data has to be made, the canbus is just sending the data all the time .
The difference is that what Jim is making with the combox is that it can send modbus requests to Classic for data, but it also has the canbus hardware to connect to newer Hawkes Bay , Rosie , Barcelona etc and that software will be able to interpret the canbus data stream into something us mere mortals ( or the influx program) can understand as voltage, current, charge state , etc.
Larry
system 1
Classic 150 , 5s3p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal for 24v pack , Outback 3524 inverter
system 2
 5s 135w Kyocero , 3s3p 270w Kyocera  to Classic 150 ,   8s Kyocera 225w to Hawkes Bay Jakiper 48v 15kwh LiFePO4 , Outback VFX 3648 inverter
system 3
KID / Brat portable

Barry Fields

Quote from: ClassicCrazy on May 24, 2024, 09:23:20 AMThe broker can be living at your house on a raspberry pi ( that is how I do mine) or the mqtt data can be sent to a broker server out on the internet somewhere.

Could that broker be on your local PC? What would that connection look like?

Quote from: ClassicCrazy on May 24, 2024, 09:23:20 AMI can't explain to you exactly why the Classic can only connect to one IP modbus at a time - limitation of the hardware I suspect.
Larry

I think I understand. If we had three Classics in follow me and I wanted to tell them all to turn off (example only):
I would have to call the first one with my modbus phone and say"shut off"and hang up.
I would then have to call the second one and hang up.
Ditto for the third.

Is there a way to do a conference call to save on modbus time?
Can a Modbus unit respond to two unique addresses? (for writes only)

IE 1st unit addresses 10 & 11
   2nd unit           10 & 12
   3rd unit           10 & 13

all would respond to address 10 (conference call)
each would respond to 11 or 12 or 13 (private line)

I again want to thank you all for your patience.

   
20 years experience in Field Service and Engineering Support in life support equipment and the computer Industry.
I pride myself in diagnostic skills and NOT knowing everything. I do know how to ask the right questions of those who should know the answers. I can do this politely.

Wizbandit

The Classic's MODBUS registers can be accessed two ways, by Serial MODBUS aka MODBUS RTU or by MODBUS TCP/IP. RTU is available from the FOllow-Me jacks which are just serial data jacks.  Serial data devices generally are just two devices "talking" to each other.

MODBUS TCP/IP uses the Ethernet jack on each Classic which generally connects to a router with each Classic being assigned an IP address. The limit is only ONE TCP/IP connection at a time to a Classic.  If a device is connected then another device will not be allowed to connect, this limitation is unique to our Classic and has to do with resources in the Networking Code. A device, such as the COMBOX connects by opening a TCP/IP channel and grabbing data, then closing the channel, also known as ports.  Our LOCAL.APP Dashboard does this but it does not release the port until the software is closed down.  SO if the LOCAL.APP is running the COMBOX gets "connection refused" and no data.  Since I wrote the code in the COMBOX to open a port, get ONE or TWO registers then close the port, if I open the LOCAL.APP it jumps in between my data requests and LOCKS itself in so the COMBOX again gets refused a connection.  It would be nice if the LOCAL.APP would open/close but it's not being updated anymore.



boB


The Classic can actually talk to two things at once on the Ethernet jack.

But that second one is for My Midnite which is not another general purpose modbus over TCP/IP connection.  We restricted the network this way to reduce traffic on the Classic processor that has other important things to do like run the MPPT itself.  It's all resource restricted so as to not slow down the processor too much.

Also, the newer products with canbus can also be queried, not just sending out a data stream.  We don't want to overload the canbus traffic with data that is more rarely accessed.


boB
K7IQ 🌛  He/She/Me

Barry Fields

example; three Classics in "follow me"

Quote from: Barry Fields on May 24, 2024, 11:26:47 AMCan a Modbus unit respond to two unique addresses? (for writes only)

IE 1st unit addresses 10 & 11
   2nd unit           10 & 12
   3rd unit           10 & 13

all would respond to address 10 (conference call)
each would respond to 11 or 12 or 13 (private line)

Reason I ask

My new charge regime would want to be able to force FLOAT or ABSORB for all three classics.
20 years experience in Field Service and Engineering Support in life support equipment and the computer Industry.
I pride myself in diagnostic skills and NOT knowing everything. I do know how to ask the right questions of those who should know the answers. I can do this politely.

boB

Quote from: Barry Fields on May 24, 2024, 03:36:03 PMexample; three Classics in "follow me"

Quote from: Barry Fields on May 24, 2024, 11:26:47 AMCan a Modbus unit respond to two unique addresses? (for writes only)

IE 1st unit addresses 10 & 11
   2nd unit           10 & 12
   3rd unit           10 & 13

all would respond to address 10 (conference call)
each would respond to 11 or 12 or 13 (private line)

Reason I ask

My new charge regime would want to be able to force FLOAT or ABSORB for all three classics.

If you have Follow-Me cables connected and enabled, you just have to tell ONE Classic go to Float or Bulk (Absorb) and the others will follow.

Otherwise, you can access each Classic over TCP/IP at the same time by using the 3 IP addresses. One per Classic.  I mean, one computer could have all 3 Classics open on 3 IP connections at the same time.  A computer can only do one thing of a time so they would communicate so many milliseconds apart from each other over their connections to your computer or R-Pi or whatever.
K7IQ 🌛  He/She/Me

ClassicCrazy

Quote from: Barry Fields on May 24, 2024, 11:26:47 AM
Quote from: ClassicCrazy on May 24, 2024, 09:23:20 AMThe broker can be living at your house on a raspberry pi ( that is how I do mine) or the mqtt data can be sent to a broker server out on the internet somewhere.

Could that broker be on your local PC? What would that connection look like?


The mqtt broker I use is called Mosquitto and it runs on my raspberry pi , which is also running Telegraf, InfluxDB, and Grafana . The raspberry pi I am using only has a wifi connection to my router , the same router that has cat 5 cables that go to my two midnites . (I actually have three routers all configured as one network so doesn't matter which router the Classics plug in to. )
I should mention that Graham also has a project that an esp32 can make one of the serial ports on Classic into an IP port . I haven't tried that one but others have gotten it working.
These days there doesn't seem to be value running three Classics when you can run one Hawkes Bay instead ( that is if buying new).
Larry
system 1
Classic 150 , 5s3p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal for 24v pack , Outback 3524 inverter
system 2
 5s 135w Kyocero , 3s3p 270w Kyocera  to Classic 150 ,   8s Kyocera 225w to Hawkes Bay Jakiper 48v 15kwh LiFePO4 , Outback VFX 3648 inverter
system 3
KID / Brat portable

Barry Fields

For MQTT, in order to display a time related graph, is is necessary to have some history date stored somewhere.

Is that done in the BROKER? What kinda memory size is required?

Same question for MNGP & MNGP2?

20 years experience in Field Service and Engineering Support in life support equipment and the computer Industry.
I pride myself in diagnostic skills and NOT knowing everything. I do know how to ask the right questions of those who should know the answers. I can do this politely.

ClassicCrazy

Quote from: Barry Fields on May 25, 2024, 01:44:25 PMFor MQTT, in order to display a time related graph, is is necessary to have some history date stored somewhere.

Is that done in the BROKER? What kinda memory size is required?

Same question for MNGP & MNGP2?


The data is all stored by InfluxDB I believe. Then Grafana uses that to make graphs. You can set things up to purge old data but I haven't done anything other than defaults and it has been running fine on my raspberry pi 3B+ . The only thing I have done is replace the SD card with a newer one that is supposed to be able to do more read writes . I put in the new micro SD as a preventative maintenance. This pi runs the Mosquitto broker, Telegraf, InfluxDB , and Grafana in containers set up via IOTStack . Maybe that doesn't mean much to you, I can just say that the IotStack makes installing and updating anything very easy. Besides getting data from my 3 Classics , it is also gathering the mqtt data from various esp32 boards running Tasmota connected to various energy monitors, temp sensors, and my four batteries bms . The pi just sits on the edge of my desk with only power via micro usb plug. The Tasmota devices have their own web pages , but I made my own graphs in Grafana that display everything that I want to show. I connect to the Pi's IP address for the Grafana or other programs running on it.
So I guess to answer you question it is all stored and running on the Raspberry Pi sd card and I think I have either a 64 or 128 GB sd card in it. Once in awhile I do also shut it down and make backup copy of the SD card. I know there are ways to back it up while running but I only get to a minor level with the linux raspberry pi stuff - if it was easier to do I would do it that way.
There is a newer way to run everything on a new mini pc or used mini pc where you can run Proxmox which will allow you to run multiple operating systems like Linux, Windows, Home Assistant, etc.
I refer you to Andreas Spies videos on the details of how all this works.
https://youtu.be/xVq_5f0aFlw?si=5fBjYTVLSl0GdvmL
Larry
system 1
Classic 150 , 5s3p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal for 24v pack , Outback 3524 inverter
system 2
 5s 135w Kyocero , 3s3p 270w Kyocera  to Classic 150 ,   8s Kyocera 225w to Hawkes Bay Jakiper 48v 15kwh LiFePO4 , Outback VFX 3648 inverter
system 3
KID / Brat portable