Skip to content
View in the app

A better way to browse. Learn more.

Power Forum - Renewable Energy Discussion

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Axpert USB

Featured Replies

Ok, so I seem to have it working now in Python 3.

After Gnome mentioned the encoding and I skimmed the articles above I looked at the encoding and changed my original code, which was based on nikitto's post from June 4, 2017 in same topic:

### code above removed, see nikitto's post from Posted June 4, 2017 in same topic ###

calc_crc(comando)
print('Command='), comando
print('CRC='),crc

crc1=crc[0:4]
crc2=crc[0:2]+crc[4:6]

crc1=int(crc1, base=16)
crc2=int(crc2, base=16)

scomm = comando+chr(crc1)+chr(crc2)+'\r'
bcomm = sCommand.encode('ISO-8859-1')

fd = open('/dev/hidraw0', 'rb+')
fd.write(bcomm)
r = fd.read(nbytes)

j = r.decode('ISO-8859-1')
s = j.split("\\")
print s

i = s[0][1:].split(" ")
print i

fd.close() 

So I open the connection to read/write bytes (not strings) and encode the string before passing it to the write and decode when reading (and removed the .encode('string-escape') from the original code).

This seems much more reliable and I didn't see any errors when running this code. I hope this helps others that are trying to get it working in Python 3.

Thanks again Gnome.

 

  • Replies 83
  • Views 29.7k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • Although the chip is made by Cypress and it is indeed one of their RS232 -> USB converters, it has multiple operating modes. Mode of operation is determined by how they configured it during ma

  • Hi all, this is my first post in this forum. Thanks Gnome for your effort. I got your code (Python) and I begun to work with it.   I installed crcmod library for python (https://pypi.py

  • Lindsay
    Lindsay

    Ok, so I seem to have it working now in Python 3. After Gnome mentioned the encoding and I skimmed the articles above I looked at the encoding and changed my original code, which was based on nik

Posted Images

  • Author
22 hours ago, Lindsay said:

This seems much more reliable and I didn't see any errors when running this code. I hope this helps others that are trying to get it working in Python 3.

Nicely done :)

Attached is my full code for Python3 which will try to read from the inverter every 5 seconds and timeout if the read takes longer than 12 seconds (I've only tested the QPIGS, but you should be able to change the commando variable if you want to read other data).

Enjoy!

inv.py

Thank-you Lindsay.

I have written my own crc function to take into account the Axpert's idiosyncrasies and have fewer dependencies. After spending some time fiddling with Node Red  and node.js I have developed an aversion of libraries and dependencies unless they are well written and documented. It appears Voltronic use a chipset that masquerades as a Cypress Semiconductor chip. From a little saunter on the web Cypress seem to disown VID 0665 PID 5161 which leaves most of us fumbling in the dark. The Python 2/3 changes how strings are handled does not help either. I prefer how Python3 handles strings with text and bytes being discrete but does give one a headache when you trying to get an  officially undocumented chipset to work.

Thank-you Lindsay for rolling several large boulders out my way. In the mean time I have dusted off my 30 year old programming skills. I hear a cacophony of laughter coming down the ether. I cut my teeth on Basic, Cobol and eventually a little bit of Pascal and DOS doesn't stand for Dark Outer Space.😆  

Since I am so rusty I usually write 2 lines of comments for every line of code. I cannot abide not understanding code I have written/copied and end up dissecting github code. This I suppose defeats the object of repositories but too many folk (myself included)  borrow code from a different source with scant  regard to its robustness. This is in no way a slight on Lindsay's contribution for which I am most grateful.

Edited by Chris Hobson

17 hours ago, nikitto said:

Hey everyone.

We've worked a lot with this code, so in this moment we're able to send large commands, over 8 bytes. Tested in Axpert and Infini.

You can checkout the code here: https://sourceforge.net/p/pvcontrol/code/ci/master/tree/hibrido.py

This looks very cool. I see it exposes the values on MQTT and builds graphs/meters. Are the graphs and data exposed on the local webserver on the Raspberry PI?

Are there any English instructions for getting this running?

Thanks.

1 hour ago, Lindsay said:

Are the graphs and data exposed on the local webserver on the Raspberry PI?

Are there any English instructions for getting this running?

Yes, we're using MariaDB (mySQL). Everything is in local, although it's ready to publish data to pvoutput.org

We've got a page in FB if you want to know more things about this project:  PVControl+     https://www.facebook.com/pvcontrolplus

photo_2020-05-12_13-05-59.thumb.jpg.0025fdf9f2dfcb7edbbc572eb222a768.jpg

 

You can checkout the system, for example, in this web:  http://jordi.ddns.net/

Or in my personal web: http://asako.sytes.net/

There is an image of the system here: https://adnsolar.eu/viewtopic.php?f=20&t=445

Allways look for the last update. If you've any doubt or question, please do not hesitate

to contact us (in English, of course).

We're interesting to have an English version. So, you can help us to get it.

Greetings.

 

P.S.: Now, it's ready to work with SONOFF relays with Tasmota, too.

 

Edited by nikitto

21 hours ago, nikitto said:

Yes, we're using MariaDB (mySQL). Everything is in local, although it's ready to publish data to pvoutput.org

We've got a page in FB if you want to know more things about this project:  PVControl+     https://www.facebook.com/pvcontrolplus

photo_2020-05-12_13-05-59.thumb.jpg.0025fdf9f2dfcb7edbbc572eb222a768.jpg

 

You can checkout the system, for example, in this web:  http://jordi.ddns.net/

Or in my personal web: http://asako.sytes.net/

There is an image of the system here: https://adnsolar.eu/viewtopic.php?f=20&t=445

Allways look for the last update. If you've any doubt or question, please do not hesitate

to contact us (in English, of course).

We're interesting to have an English version. So, you can help us to get it.

Greetings.

 

P.S.: Now, it's ready to work with SONOFF relays with Tasmota, too.



 

Well, nowadays we have  incorporated on-grid inverters:

Huawei -> Modbus TCP

Fronius-> API

SMA-> Modbus TCP

All cases are available to divert and avoid feed in the grid.

 

 

 

 

 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.