Access the AXS Port using a Python Program

Access the AXS Port using a Python Program

Postby rdk45 on Tue Mar 19, 2019 6:44 am

Has anyone developed a simple program to access (read) the Outback Charge controller data? We have Magnum MS4448PAE inverter, ME-ARC, and the ME-BMK units , and the Outback Flexmax 80 MPPT charge controller with a ASX-Port.

I would like to have or develop a Python program to "read" the Charge Controller data via the AXS Port. The program would run on a Raspberry Pi running Debian Stretch OS. The Pi will be local to the AXS Port. I'm aware that the AXS uses SunSpec Modbus protocols which are detailed in one the Outback AXS documents. However, right now I have no idea where to begin to access the unit via a Python program.

Thanks in advance to some help for this newbie to Outback and Modbus programming....RDK45
rdk45
Forum Member
 
Posts: 6
Joined: Tue Mar 19, 2019 6:20 am

Re: Access the AXS Port using a Python Program

Postby adamtwatson on Tue Mar 19, 2019 12:34 pm

Sun spec has a python library located here, https://sunspec.org/sunspec-python-library/
Documentation for the library here, https://pysunspec.readthedocs.io/en/latest/ github is here https://github.com/sunspec/pysunspec
Not 100 percent sure how you would connect the GPIO of the raspberry pi or ethernet to the AXS Port for communication however.
adamtwatson
Forum Junior Member
 
Posts: 3
Joined: Fri Mar 01, 2019 8:19 pm
My RE system: 8.3kw Solar World Panels, Radian 8048a, 2x FM-100

Re: Access the AXS Port using a Python Program

Postby rdk45 on Tue Mar 19, 2019 10:42 pm

Adam...Thanks for the references. Since other folks are able to communicate with the AXS unit with a Pi and C or JAVA based programming, I assume that there is a way, probably via the AXS's web interface? Maybe someone else can enlighten me?

Thanks again.....RDK
rdk45
Forum Member
 
Posts: 6
Joined: Tue Mar 19, 2019 6:20 am

Re: Access the AXS Port using a Python Program

Postby Jeff Bosch on Wed Mar 20, 2019 12:17 pm

The AXS Port uses the standard Port 502 to handle Modbus-TCP/IP communication. So, your Pi would have to have an Ethernet connection to the AXS Port (on the same subnet would be best at least for development and testing, and even deployment, for security reasons). Once you connect over port 502, you should be able to read "SunS" from the first two holding registers. If you can, you're connected to a SunSpec device. I highly recommend using Wireshark to verify that your connection request and Modbus comms are correct.

I hope this info helps. I'll answer a few questions if I can but I won't have the time to help review code, etc.
Jeff Bosch
Senior Software Engineer
OutBack Power Technologies
User avatar
Jeff Bosch
OutBack Engineering
 
Posts: 57
Joined: Tue Sep 18, 2018 12:06 pm
Location: Arlington, WA USA

Re: Access the AXS Port using a Python Program

Postby rdk45 on Wed Mar 20, 2019 10:24 pm

Jeff....Thanks for the reply. I'm busy right now searching the web for mobbus related Python projects and code. This is also not a high priority project, so I will be moving a my pace, with other obligations and yard work interfering. If I any further questions I will let you know....RDK
rdk45
Forum Member
 
Posts: 6
Joined: Tue Mar 19, 2019 6:20 am

Re: Access the AXS Port using a Python Program

Postby Jeff Bosch on Wed Mar 20, 2019 10:45 pm

One tip: Think SunSpec, code Modbus. In other words, the underlying protocol is Modbus, but the register layout follows SunSpec models.
Jeff Bosch
Senior Software Engineer
OutBack Power Technologies
User avatar
Jeff Bosch
OutBack Engineering
 
Posts: 57
Joined: Tue Sep 18, 2018 12:06 pm
Location: Arlington, WA USA

Re: Access the AXS Port using a Python Program

Postby rdk45 on Fri Mar 22, 2019 7:28 am

Jeff.....I've installed the
pysunspec
from the GIT site. It installed and tested ok. However, I'm confused as it also required
pyserial
first. My intentions are to use the TCP interface in this project and not a serial interface.

Is this a problem?....RDK?
rdk45
Forum Member
 
Posts: 6
Joined: Tue Mar 19, 2019 6:20 am

Re: Access the AXS Port using a Python Program

Postby Jeff Bosch on Fri Mar 22, 2019 10:58 am

I'm not a Python programmer, so I can't offer advice. If Python requires a serial library to communicate over a TCP/IP connection, then sure, it could be required, but that would be an odd architecture (to me). Do they have a TCP/IP library? If so, then you'd open a client connection on port 502.
Jeff Bosch
Senior Software Engineer
OutBack Power Technologies
User avatar
Jeff Bosch
OutBack Engineering
 
Posts: 57
Joined: Tue Sep 18, 2018 12:06 pm
Location: Arlington, WA USA

Re: Access the AXS Port using a Python Program

Postby rdk45 on Sat Apr 20, 2019 9:56 am

Jeff....Ok, I got my Python program to work and have extracted item values as per the table 1 in the Outback_AXS_APP_NOTE.pdf. It is working fine, but I'm doing all of the register and format bit diddling.

i have found the suns.py script on the SunSpec pysunspec GIT site and it also runs fine and displays ALL of the items along with the field names. I'm curious if the field names included in the above table 1 have been hard coded into the SunSpec pysunspec library or are they also buried somewhere in the date that I'm pulling from the AXS?

I'm not an experienced programmer (Python or other wise), so please excuse me if there is an obvious answer. Thanks...Rob
rdk45
Forum Member
 
Posts: 6
Joined: Tue Mar 19, 2019 6:20 am

Re: Access the AXS Port using a Python Program

Postby rdk45 on Tue Apr 23, 2019 10:16 am

Jeff...OK, I think I have figured it out, the label names/Info are buried in the SunSpec library in a static XML file. What happens when we update our firmware? If you add new items? What is the current level of the Outback information in the SunSpec library?...Rob
rdk45
Forum Member
 
Posts: 6
Joined: Tue Mar 19, 2019 6:20 am


Return to AXS Port

Who is online

Users browsing this forum: No registered users and 1 guest