Microcontrollers > Microcontrollers/General

Any interest in XanBus protocol ?

(1/4) > >>

Yyrkoon:
I am currently in the process of reverse engineering part of the XanBus protocol, and was wondering if anyone else here had interest. XanBus, at least on our inverters, is on the physical layer, CANBus -> ethernet connector. The software layer seems to be NEMA 2000 fast packet, using custom / proprietary PGN values for various aspects of inverter instrumentation. Or, if it is not, it would be very surprising to me. As currently I am able to track various fields related to AC_OUTPUT_STATUS -> RMS voltage, current, and AC frequency. There are also a few unknown fields( to me ), but also there are power related fields which I do not bother with. Since power = v * i . . . and I'd rather deal with that on the remote end.

Anyway, I've written an application in C, that uses the socketCAN API, POSIX IPC Shared memory, and libmongoose to perform hhtp + websocket duties.

The interesting part of this application, at least for me was the POSIX shared memory aspect. In effect, the application is two processes. The IPC server, which reads directly from the CANBus, constructs fast packets out of 8-byte socketCAN frames(varied frame count ), decodes the meaning of the fast packet, and writes this information into the Shared memory file - In the form of a JSON object.

The IPC client, which also acts as an http + websocket server, Just reads the data from the file, and sends it out over websocket to any connected clients. Essentially, just the "man in the middle".

The reason I chose this model(two processes ), is that when initially experimenting with libmongoose, my socketCAN wrapper code stopped working. So instead of trying to figure out what was going on, and reading through *tons* of code. I figured I'd chose this model. Since libmongoose uses a callback to "poll" it's various features. I just figured it was stepping all over the stack.

Anyway, my code is still a work in progress, but is working well enough to output AC_OUTPUT_STATUS fields to a web browser client. A buddy of mine, and myself have reversed the various PGN values well enough to at least track battery status, AC power related status, MPPT controller status etc. *And* we also have a Schneider electric MPPT charge controller. So I can verify that my code works for that. As well as a commbox . . .

The hardware that is reading directly from the inverters is a beaglebone black, using a CANbus cape. Running Debian wheezy.

This project for me is definitely a huge learning experience. Being that this is probably the first major application I've written for / on Linux. I do have many years programming / Linux usage experience - dating back to the early to mid '90's. But have always written code on Windows, for windows, using various languages. This is very exciting for me anyway, but probably less so for others heh.

Would love to hear comments and / or questions if anyone has any.

OperaHouse:
I bought a Prosine 3000 more than a year ago and was asking if anyone knew an easy way to read the Xanbus.  Haven't en tried turning it on since then.

Yyrkoon:

--- Quote from: OperaHouse on July 28, 2015, 01:51:38 PM ---I bought a Prosine 3000 more than a year ago and was asking if anyone knew an easy way to read the Xanbus.  Haven't en tried turning it on since then.

--- End quote ---

I wouldn't say easy, but it is doable. It took my buddy and I . . . I do not know, a month and a half to figure out the various PGN values. Then, we only figured out some of the values. For instance, with the one and only PGN that I'm tracking currently, there are like 3-4 bit fields I'm unable to figure out. But the majority of the important values, I'm able to read.

We also have a commbox, so if I get stuck indefinitely, I may take a gander at the javascript code . . . but man, it's 20,000 lines +. I did glance at it and I started feeling myself devolve immediately . . . it's that bad.

dgd:
Interesting to read what you are doing with Xanbus.
I am looking at this from a different hardware and software approach.
From the info I have gathered about Schneider's Xanbus it appears to be nothing more complicated than an
rs485 network at the hardware communications layer and a MODBUS stack at the data layer.
These documents from Xantrex show the modbus register map

http://www2.schneider-electric.com/resources/sites/SCHNEIDER_ELECTRIC/content/live/FAQS/229000/FA229511/en_US/ConextXWModbusMap.pdf
and

http://www2.schneider-electric.com/resources/sites/SCHNEIDER_ELECTRIC/content/live/FAQS/229000/FA229511/en_US/ConextSWModbusMap.pdf

Rather than use a Linux system (Cubie2 in my case) I decided to go with a more embedded type processor
and will be using the Arduino DUE, or possibly Mega2560.  The hardware interface to the Schneider inverter will use a low cost rs485 to serial adapter (a few $ on ebay). Reading the relevant modbus registers will use the SimpleModbusMaster lib for Arduino.
Since there are relatively few registers to get a nice dataset of how the inverter is performing I will simply store registers in ram memory refreshing values about every second.
The Arduino can be a simple web server and with 1 second data rate from the inverter (or whatever the inverter can do) then data can be made available via AJAX to a web client. I would leave the page processing to javascript code to format and display using live gauge displays or perhaps highchart or rchart live graphs.

What I would really like to achieve is integrate the inverter data into web pages I already generate to show live and historical data from my Midnite Classic controllers.
Between the Classics, a WBjr on Deltec battery shunt and inverter data its a goal to produce detailed running data on PV and wind turbine power generation, battery status, load power usage, diversion load power availability/consumption and exception events reporting.

Slightly further down the track when I get my Oztules 6Kw inverter built and tested then a simple ARduino based data monitor with running data connected via i2C (or whatever) to the DUE web server. I might consider making a modbus stack for this inverter but thats probably unlikely.

Is your code available? I would be interested in looking at it.
All my C++ DUE/Mega web server code for Midnite Classic is freely available on the Midnite web forum.

dgd

ve3aam:
Hello to you all.

I came across this site yesterday by accident, but a good one! Maybe I can be of help, with the Zantrex XanBus protocol.

I have three MPPT60-150 charge controllers and two Conext ComBox. Well as luck would have it, one failed during the night...So I started to think about getting back onto my version of an interface.
A couple of years ago, I did just that. Built a CANBus monitor using a PIC18 processor with a monochrome 3x5 display. I was able to monitor the traffic and to display the results onto the screen.
Built an other CANBUS monitor to allow me to send commands and receive packets via CAN to USB interface to function in a windows environment. Just wrote a simple program using Visual Studio 6. (VB) . I do have the PGN's and would like to pick up on this once again. As far as I'm concerned, it is time that WE the community, engineers and hobbyist,  (I'm both) reverse engineer this darn XanBus protocol and make it public... Enough is enough.

My current setup consist of just using the Conex Combox as a bridge/slave (MODBUS rs485) to extrapolate the data in real time and display it on an 3x5 monochrome LCD. Processor is a pic18f4685.
It displays the battery voltage, temperature, input voltages, current, etc and also the load to the battery and other equipment.. Also power in whrs, kwhrs, mwhrs, daily, monthly, yearly, and total.
My second monitor device is a modified laptop dual core processor running winxp64 or vista 64. The device communicates with the Combox being a TCP/MODBUS bridge slave, displaying the data on screen, IN COLOR lol!

So in response to the primary post "Any interest in XanBus protocol?" here I am, and lets get to it!!!

I do like the charge controllers, as they do work very well, but the Combox MODBUS protocol, doesn't allow or provide more data and control the the SCC, that is available on its TI 32-bit processor. Fact is, all past data and faults are save in FLASH, but are not available. The combox does the data login when you plug the units together....etc.

By the way, Microchip also has for sale a couple of CANBUS tools and monitors. The schematics and firmware/software are available for free and download. I did just that, built my own boards, using their stuff as a base. Thought you'd like to know this. And besides, they will ship FREE samples!!! You've got to love that, and Microchip!!!

I should also mention that I've been off-grid for over 8 years. Located on a 100 acres in the middle of a forest. apx 9kw of solar panels, two sets of Panasonic MSE Modular AGM batteries,
(48 - 2v batteries 7.5 tons)  48volt system. Using believe it or not, APC Smart UPS for power conversion. CHEEP and reliable!! 3000w and 5000w units, so 120v and 208 and 240 single phase.
Sure is nice to have all this power to run an air-conditioner and hot water !!

I will help those that request tips and tricks or info...Pictures and other stuff is available...

Cheers
Dale

Navigation

[0] Message Index

[#] Next page

Go to full version