News:

To visit MidNite Solar click this link www.midnitesolar.com

Main Menu

Modbus over USB?

Started by 2twisty, March 04, 2017, 02:11:33 PM

Previous topic - Next topic

2twisty

Since my classic has a fried ethernet port... Long story.

Is it possible to do full modbus read and write over the USB connection?

I've been toying with writing some Python stuff on a Pi to integrate my Classic and my FX3648 with a rules engine for actions and notifications

boB


The USB port is not set up for modbus unfortunately.  Wish it were.

HOWEVER, those three (3)  RS-232 jacks are.  I use a USB to RS232 serial adapter
and then a little dongle to change the DB-9 connector to telephone jack.
I have also used haphazard wiring to change the connection.

There is a pinout of thtose jacks at the end of the Classic modbus document.

boB
K7IQ 🌛  He/She/Me

dRdoS7

Hi,

Quote from: boB on March 05, 2017, 04:06:03 PM

The USB port is not set up for modbus unfortunately.  Wish it were.

HOWEVER, those three (3)  RS-232 jacks are.  I use a USB to RS232 serial adapter
and then a little dongle to change the DB-9 connector to telephone jack.
I have also used haphazard wiring to change the connection.

There is a pinout of those jacks at the end of the Classic modbus document.

boB

Does that mean I could read values from the Classic with a PC?

Thanks,

dRdoS7

TomW

Quote from: dRdoS7 on March 08, 2017, 04:01:30 PM
Hi,

Does that mean I could read values from the Classic with a PC?

Thanks,

dRdoS7

I did this for many months before I started using newmodbus over ethernet.

It is a one way data stream out on the USB port.

Dumps a string of data with register # and it's value in pairs.

It is a setting on the MNGP. Unless they changed that.

Tom
Do NOT mistake me for any kind of "expert".

( ͡° ͜ʖ ͡°)


24 Trina 310 watt modules, SMA SunnyBoy 7.7 KW Grid Tie inverter.

I thought that they were angels, but much to my surprise, We climbed aboard their starship and headed for the skies

dRdoS7

Hi,

Quote from: TomW on March 08, 2017, 05:08:39 PMI did this for many months before I started using newmodbus over ethernet.

It is a one way data stream out on the USB port.

Dumps a string of data with register # and it's value in pairs.

It is a setting on the MNGP. Unless they changed that.

Tom

I can leave LA running on the PC, and then use one of the 3 RJ11 sockets to read data via Serial cable adaptor to a USB port?

I think my mobo actually has a serial port connector onboard, I could connect to that direct (if I can find the correct cable/plug). Probably been tossed out in a clean up! Used have heaps of backplates with RS232 sockets lying around.

Were you using Windows?

Thanks,

dRdoS7

TomW

I am talking about the USB port!

Sends out this string of data every X seconds:



07:27:01 24/06/2013 u=1871&ID=SOLAR&4115=25.1&4116=86.5&4117=3.7&4118=0.0&4119=87&4120=4&4121=0.7&4122=101.5&4125=2&4132=23.0&4133=40.8&4134=49.0&4275=5&4130=0x3004&4131=0x3200&4341=0x0012&4342=0xe380&4343=0xf000&4344=0xe121


Date, Time, unit ID and The Classic's name
For example "4115=25.1" was probably battery volts. 4115 being the register number and 25.1 the voltage. There is a document listing the registers and their identity someplace.

Add a bit of command line massaging and you can create pretty graphs / charts or whatever. All done on  a Raspberry PI (early version) embedded system running Linux. Doesn't take much computing power to grab the data.

Tom
Do NOT mistake me for any kind of "expert".

( ͡° ͜ʖ ͡°)


24 Trina 310 watt modules, SMA SunnyBoy 7.7 KW Grid Tie inverter.

I thought that they were angels, but much to my surprise, We climbed aboard their starship and headed for the skies

dRdoS7

Hi,

Quote from: TomW on March 09, 2017, 09:25:20 AM
I am talking about the USB port!

Quote from: boB on March 05, 2017, 04:06:03 PM

The USB port is not set up for modbus unfortunately.  Wish it were.

HOWEVER, those three (3)  RS-232 jacks are.  I use a USB to RS232 serial adapter
and then a little dongle to change the DB-9 connector to telephone jack.

boB

I must be missing something in our conversation.

Are you talking about the USB connection to the Classic sending data?

How would I read the data with a Win PC?

i thought we were talking about the 3 RJ11 ports.

dRdoS7

dgd

#7
The three rj11 ports are rs232. So to connect one of them to a USB port on a PC you need a USB to rs232 cable, usually the rs232 end of that cable will be a DB9 connector.
Into that you put a DB9 to RJ11 dongle then use a 6wire phone cable to go from the dongle to the Classic RJ11 port
You can then use the PC to read modbus values from the Classic.
Of course you will need a program on the PC to read modbus registers over the serial connection. You can find all sorts of little ModbusRT utilities via google. These often just get the raw register values and its up to you how you use them in a display page (or whatever)
I have a Win program that reads some Modbus registers via a serial port then makes data available via web server meter/text and graph pages.
I sorta gave up with it as I didn't want a 24/7 running PC just to gather data when an Arduino/BBB does the job using miniscule power (or small carbon footprint as all the energy experts in NZ take every opportunity to mention to measure energy usage efficiency)

dgd
Classic 250, 150,  20 140w, 6 250w PVs, 2Kw turbine, MN ac Clipper, Epanel/MNdc, Trace SW3024E (1997), Century 1050Ah 24V FLA (1999). Arduino power monitoring and web server.  Off grid since 4/2000
West Auckland, New Zealand

boB

#8
Yes, Dr....

The 3 phone jacks to PC USB with USB to RS-232 adapter...
Here is a picture  of what I use.  The dongle is a just a DB-9 to RJ-11
female.  I get them from Ebay.  Would be nice if they came pre-connected
but you have to stick the 3 wires into the proper holes of the DB-9 part and
all of these dongles aren't necessarily using the same colored wires going
to the same RJ-11 pins, so it's not 100% accurate to just say that the red wire
goes into DB-9 pin 5 or whatever.  I've seen more than one style of this.

The dongles I found on Ebay were the same though, from the same
vendor.   Just  search for...

Lot10 DB9pin Female~RJ12/RJ11

I got 20 of them from   partsparadiseinc

Couldn't find the whole cable pic yet but here's one trying to
document wiring it up...

Looks like RED is pin 2, GREEN pin 3, YELLOW pin 5 (gnd)

At least from the ones I got from  partsparadiseinc

And also using the normal, reversing RJ-11 to RJ-11
cable we ship with the Classics.

If not the same, then you will have to ring it out which
is kind of a pain.  I would just buy a package of 10 from
partsparadiseinc...  Pretty cheap.

boB
K7IQ 🌛  He/She/Me

TomW

Somehow I posted this in the wrong thread. I am reposting it here where it makes sense. Sort of. :o

OK, to whomever;

Just for clarity  and accuracy.

I may have suffered a "Senior Moment" when I wrote that post about data over USB.

Reading it today, I am Pretty sure it was an Outback inverter I was pulling data from over USB.

Listen to boB, he probably doesn't have Alshiemers' ?SP?.

Sorry for the confusion. Off to sit on my typing hand awhile.

I apologize for any confusion on this.

Tom
Do NOT mistake me for any kind of "expert".

( ͡° ͜ʖ ͡°)


24 Trina 310 watt modules, SMA SunnyBoy 7.7 KW Grid Tie inverter.

I thought that they were angels, but much to my surprise, We climbed aboard their starship and headed for the skies

dRdoS7