question

shayner avatar image
shayner asked

Midnite classic modbus support

Just wondering if anyone is working or has a venus os driver to integrate a midnite solar classic data into the page overview screen? Just like the tristar one

Modbus TCPcommunication protocol
1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Ole Saether avatar image Ole Saether commented ·

I wrote a venus driver for the Morningstar Tristar MPPT a few years ago. Running for over two years now without errors. You can probably reuse som of my code. Here is the link to the repository:

https://github.com/osaether/dbus-tsmppt

0 Likes 0 ·
11 Answers
ostrovni-elektrarny avatar image
ostrovni-elektrarny answered ·

I am looking for it too. User jbakuwel has written one, but I do not have link.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

jbakuwel avatar image
jbakuwel answered ·

@Shayner @Ostrovni-elektrarny sorry folks, I've been super busy and haven't gotten to it yet. Just ported the software to the latest version of VenusOS with Python3 and am testing it now. Once I'm happy with it, I'll upload it to github.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

seamaster avatar image
seamaster answered ·

@jbakuwel did you manage to get Midnite solar working with Venus OS?


2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

jbakuwel avatar image
jbakuwel answered ·

@Seamaster Thanks for the prompt.

@Shayner @Ostrovni-elektrarny Here it is finally :-)

https://github.com/jbakuwel/venus-midnite

Enjoy!

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

seamaster avatar image
seamaster answered ·

@jbakuwel thank you for the driver! It is awesome and

I have followed your instructions and got it working!

There are some small discrepancies. There is data, but some data is missing. Let me explain:

Notice the 0 on battery monitor 1677266331616.png

when I drill down the menu I see this below, which I presume is the battery monitor not reporting possibly battery current and something else?

1677266401061.png

The Charger menu appears to be OK except there is sometime rounding not happening for the power settings and sometimes it looks like this:

1677266621373.png


and some times is proper like this:

1677266672395.png


Total yield does not display anything "--", neither does daily history:

1677266760658.png

In the pages I get thee animation going out of the PV Charger, but for some reason not going into the battery, but all is going to the house loads, which is not quite the case.

1677266963975.png

when I click on the battery i get this:

1677267214655.png

Is it possible to address some of these?

Most important one is why don't I get battery current flowing to the battery, but rather going to the house loads?

Thank you again for the awesome job! You brought Midnite Solar into the 21st century!



1677266331616.png (87.6 KiB)
1677266401061.png (82.0 KiB)
1677266621373.png (30.9 KiB)
1677266672395.png (31.2 KiB)
1677266760658.png (38.6 KiB)
1677266963975.png (87.8 KiB)
1677267214655.png (76.7 KiB)
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

jbakuwel avatar image
jbakuwel answered ·

Hi @seamaster,

It seems to me that your batteries are full, in other words, the current = 0 A and the power is also 0 W. The PV charger is supplying the loads. Note that the units are missing - I don't know how to add those. If someone knows, please submit a Pull Request (PR).

Regarding the long floating point numbers, that's a matter of rounding. I've updated the software on github.

Historical data is not kept in the driver (that would not make much sense unless it would use persistent storage). It might be kept in the Midnite Classic (I haven't looked at that), if that's the case then you need to find the register holding that information, retrieve and interpret it.

Then submit a PR to improve the driver ;-)


8 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

seamaster avatar image seamaster commented ·
It seems to me that your batteries are full, in other words, the current = 0 A and the power is also 0 W. The PV charger is supplying the loads. Note that the units are missing - I don't know how to add those. If someone knows, please submit a Pull Request (PR).

The batteries actually were not full.There was a split load and about 10A going to the house and the rest going to the batteries. For some reason it never shows the current on the battery


0 Likes 0 ·
jbakuwel avatar image jbakuwel seamaster commented ·
Well... the driver is just showing what the Midnite is telling it so you'd need to look into that. I trust you have a "Whizbang Jr" (shunt) installed? Needless to say it's working fine here. To run the driver interactively, do this:


  • rm /service/charger; rm /service/battery
  • ps w | grep classic
  • kill the 2 processes for the battery you see running with kill <pid> <pid>
  • cd /data/classic/battery
  • ./battery.sh

Maybe uncomment the line (81) saying #logger.info first so you can see some output on the screen, print the contents of registers etc.

Once done, reboot and /data/rcS.local will restore the symlinks in /service.

Good luck!

0 Likes 0 ·
seamaster avatar image seamaster jbakuwel commented ·
@jbakuwel I followed your instructions above, but I lost the services. I can start them manually and it works the battery shows in the UI, but when I reboot I have no services called charger or battery listed in /service. Nothing shows in the UI either. I have still the lines in data/ rcS.local. Any suggestions?


0 Likes 0 ·
jbakuwel avatar image jbakuwel seamaster commented ·
0 Likes 0 ·
seamaster avatar image seamaster jbakuwel commented ·

@jbakuwel the entries are as per your recomendations:

#!/bin/bash

# SetupHelper reinstall all Venus mods
if [ -f /data/SetupHelper/reinstallMods ]; then
        nohup /data/SetupHelper/reinstallMods > /dev/null &
fi

cd /service
ln -s /data/classic/battery/service battery
ln -s /data/classic/charger/service charger
0 Likes 0 ·
jbakuwel avatar image jbakuwel seamaster commented ·

Are the processes running after a reboot?

How familiar are you with VenusOS / command line use?


0 Likes 0 ·
seamaster avatar image seamaster jbakuwel commented ·

@jbakuwel thats for the reply. I'm not an expert, but I can make my way around with little guidance...

considering that this work before, i dont understand what are the services not starting automatically. As far as I understand the contents of the rc.local and res.local execute services startup when system reboots. I have tried placing the

cd /service
ln -s /data/classic/battery/service battery
ln -s /data/classic/charger/service charger

in the rcS.local and when rebooted did not see the services working, then I tried placing the lines in the rc.local and rebooted again, but no success. Finally I removed the lines from rc.local and let put them back in rcS.local as per your instructions to bring it to as it suppose to be. Unfortunately I guess something else is happening and i can not figure out why the services wouldn't start automatically. Yet, when i do a command line start of the script:

1679590698633.png

1679590955645.png

the services appear to start OK, but battery appears to be attempting to reconnect for some reason, despite that appears to be running OK.

1679591101961.png

Do you know what could I do to get it going properly automatic at start up of the system again?


0 Likes 0 ·
1679590698633.png (487.0 KiB)
1679590955645.png (789.8 KiB)
1679591101961.png (195.2 KiB)
jbakuwel avatar image jbakuwel seamaster commented ·

@Seamaster

Can you see if a delay in start up by adding a "sleep 30" to the script that starts the battery monitor and charger helps?

Like this:

# cat /data/classic/battery/battery.sh
#!/bin/bash
sleep 30
/usr/bin/python /data/classic/battery/battery.py


# cat /data/classic/charger/charger.sh
#!/bin/bash
sleep 30
/usr/bin/python /data/classic/charger/charger.py


It doesn't necessarily have to be 30 seconds, you can experiment with other values.

0 Likes 0 ·
jbakuwel avatar image
jbakuwel answered ·

@tomhoover @Kantarus here it finally is.


2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

mcsarge avatar image
mcsarge answered ·

Hi, I am having some trouble getting the logs to be recorded for this particular driver. I can get them to show when I run the .sh files directory, but not when I use the rcS.local. I am a newbie, but can follow directions. Can anyone give me some pointers?

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

mcsarge avatar image
mcsarge answered ·

@Seamaster In your above comment you see that the driver is writing that is can't connect to the Modbus IP, that is incorrect. If you look at the code, the log entry is written when you have the MQTT posting turned off. In addition, when the MQTT is off, it sets the connected to false. This may have an impact on what you are seeing. I have fixed both of these issues, but I now have a problem where the driver for the battery just stops working after awhile and I cannot get it back unless I kill and restart the process. I also can not get the driver to write the log files, I am not sure what I need to do but maybe if I had those I could figure out what is happening.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

fs152 avatar image
fs152 answered ·

@jbakuwel Hi, I have a new Cerbo GX and want to connect it to a Mitnite Classic Solar Charger. (charger only no BMS or shunt) Did your driver work with a Cerbo GX? Is it possible to limit the charging current? can i add another Midnite Classic to the System?

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

kodl69 avatar image
kodl69 answered ·

Hello, i have problem to run drivers. automatic not started. If i run manualy, output is:

root@einstein:/data/classic/battery# sh battery.sh
INFO:logger:Loglevel set to INFO
INFO:vedbus:registered ourselves on D-Bus as com.victronenergy.battery.net
INFO:battery:Initialised Midnite thread: IP=192.168.1.224, Freq=10
INFO:battery:Connected to dbus, and switching over to gobject.MainLoop() (= event based)

Battery monitor on remote console working, not displayed on main screen and. Console not respond, i must endclosed this manualy, CTRL+C. "charger" have this same problem.

I have cerbo gx 3.01 . I dont have file /data/rcS.local - it is my problem?

eddit: I crate rcS.local and restart cerbogx - without changes...

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

jimmy-larouche avatar image jimmy-larouche commented ·

Hi Kodl69,

Please check if your a good access right on the files /data/rcS.local ? the execution right are important. If you are not a expert in linux you can use winscp for change the access on this files.righaccessfilerc-local.png

0 Likes 0 ·

Related Resources

Additional resources still need to be added for this topic

Modbus TCP Basics