Midnite Classic Modbus RS-232 communication

Started by Lubos_H, October 12, 2020, 07:53:51 AM

Previous topic - Next topic

Lubos_H

Good day,
first I have to apologize for my bad English (google translator). I have this problem. I run 1 x Midnite Solar Classic 150 and 1 x Midnite Solar Classic Lite 150 in one place.
Both controllers only in SOLAR mode
I try to read data from the operation of the controllers from these two controllers via the Mudbus - RS232 protocol. I have controller number 1 set to Modbus ID 10, I have controller number 2 set to Modbus ID 11. The controllers are connected by an RS 232 cable to the Arduino Mega 2560 device. The Arduino Mega 2560 with the appropriate software reads data from the controller. If I connect the Arduino Mega to controller number 1, I set the Modbus 10 ID in the arduino software, I read the data from this controller correctly. If I connect the Arduino Mega to controller number 2, I set the Modbus 11 ID in the arduina software, it reads the data from the other controller correctly.


Next, I will connect the RS232 bus to the TX data of controller number 1, I will connect the data of TX controller number 2 and the RX data of controller number 1 will be connected to the data of RX controller number 2. After connecting, the communication will stop working.  In the Midnite Solar Classic 150 controller I use the middle RJ11 port, in the Midnite Solar Classic LITE 150 controller I use the lower RJ11 port. I assume that my consideration of RS232 bus interconnection is correct. However, I am not sure if I need to make any other settings in the Midnite Solar Classic 150 controller or the Midnite Solar Classic LITE150 controller.
I've been worried about this problem for about a week now and I can't find a solution to the problem.
Please ask for your information whether my assumptions are correct, or for a proposed solution on how to read data from both controllers via the RS-232 bus using the Modbus protocol. Thank you for your feedback.


ClassicCrazy

There was a recent post that you need to set the Classic ID using the MNGP and not the Local Status App - not sure if this is  your issue or not.
Take a look in the Open Source section of the forums here because there is more info on connecting via rs-232 and modbus.
http://midniteftp.com/forum/index.php?board=34.0
Also look in the Raspberry Pi section because there is already a project that can get the data from two Classics and make it into MQTT data which you can then do with whatever you want. Also there is a project using ESP32 to do the same thing. They are in Open Source section of forums and on here
https://github.com/ClassicDIY
which also has tools to test the modbus.

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

ClassicCrazy

Also look through this post - there was a lot of discussion on how to use the RS232 converter like you have and the ports to Classic to monitor data .
Graham was discussing various tools on how to test things .
http://midniteftp.com/forum/index.php?topic=4880.0

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

Graham

Quote from: Lubos_H on October 12, 2020, 07:53:51 AM
Good day,
first I have to apologize for my bad English (google translator). I have this problem. I run 1 x Midnite Solar Classic 150 and 1 x Midnite Solar Classic Lite 150 in one place.
Both controllers only in SOLAR mode
I try to read data from the operation of the controllers from these two controllers via the Mudbus - RS232 protocol. I have controller number 1 set to Modbus ID 10, I have controller number 2 set to Modbus ID 11. The controllers are connected by an RS 232 cable to the Arduino Mega 2560 device. The Arduino Mega 2560 with the appropriate software reads data from the controller. If I connect the Arduino Mega to controller number 1, I set the Modbus 10 ID in the arduino software, I read the data from this controller correctly. If I connect the Arduino Mega to controller number 2, I set the Modbus 11 ID in the arduina software, it reads the data from the other controller correctly.


Next, I will connect the RS232 bus to the TX data of controller number 1, I will connect the data of TX controller number 2 and the RX data of controller number 1 will be connected to the data of RX controller number 2. After connecting, the communication will stop working.  In the Midnite Solar Classic 150 controller I use the middle RJ11 port, in the Midnite Solar Classic LITE 150 controller I use the lower RJ11 port. I assume that my consideration of RS232 bus interconnection is correct. However, I am not sure if I need to make any other settings in the Midnite Solar Classic 150 controller or the Midnite Solar Classic LITE150 controller.
I've been worried about this problem for about a week now and I can't find a solution to the problem.
Please ask for your information whether my assumptions are correct, or for a proposed solution on how to read data from both controllers via the RS-232 bus using the Modbus protocol. Thank you for your feedback.

I don't think you can connect both ports in parallel as you have it in your schematic, RS232 is meant to connect the DTE (terminal) to the DCE (computer) see https://en.wikipedia.org/wiki/RS-232, you would need to convert it to RS485 or use a separate serial port on the Arduino for each classic + you would have to modify the arduino code to use both ports

You could have a look at my Modbus Adapter project https://github.com/ClassicDIY/ModbusAdapter that converts modbus RTU to modbus TCP over wifi. I use this to access my Tri-Star TS-45 with my Android app. Each classic would need it's own ESP32 dev board.

Graham
Off-Grid Island cottage, Lac Simon QC Canada
370 Ahrs @ 24V (4 8L16 batteries)
4 x 250watt panels on dual axis trackers http://tinyurl.com/hfpkgr5
Classic 150, Whizbang Jr.
Android Monitor: http://tinyurl.com/lomzq3s