yogawenno
Posts: 19
Joined: Tue Jul 30, 2019 9:03 am

problem connect epsolar-tracer to raspberry pi

Thu Aug 01, 2019 3:39 pm

hey guys, please help me to solve this problem
i have code

Code: Select all

from pymodbus.client.sync import ModbusSerialClient as ModbusClient

from pymodbus.client.sync import ModbusSerialClient as ModbusClient

client = ModbusClient(method = 'rtu', port = '/dev/ttyACM0', baudrate = 115200)
client.connect()
result = client.read_input_registers(0x3100,1,unit=1)
print("result = ")
print (result)

solarVoltage = float(result.registers[0] /100.0)
solarCurrent = float(result.registers[1] /100.0)
batteryVoltage = float(result.registers[4] /100.0)
chargeCurrent = float(result.registers[5] /100.0)

print("solar voltage : ",solarVoltage)
print("solar current : ",solarCurrent)
print("battery volatage : ",batteryVoltage)
print("charge current : ",chargeCurrent)
client.close()
when i run this code, i get error like this

result =
Modbus Error: [Input/Output] Modbus Error: [Invalid Message] Incomplete message received, expected at least 2 bytes (0 received)
Traceback (most recent call last):
File "yutub.py", line 9, in
solarVoltage = float(result.registers[0] /100.0)
AttributeError: 'ModbusIOException' object has no attribute 'registers'

i use rasberry pi 3 model b and epever tracer1210A

can anybody can help me to fix this problem?
thanks !

ghp
Posts: 1408
Joined: Wed Jun 12, 2013 12:41 pm
Location: Stuttgart Germany
Contact: Website

Re: problem connect epsolar-tracer to raspberry pi

Thu Aug 01, 2019 5:26 pm

There are various options listed how to connect this device. How do you connect ?
Found https://www.epsolarpv.com/upload/cert/f ... L-V1.0.pdf, page 22. Or is there a better documentation available ?

yogawenno
Posts: 19
Joined: Tue Jul 30, 2019 9:03 am

Re: problem connect epsolar-tracer to raspberry pi

Fri Aug 02, 2019 2:34 pm

ghp wrote:
Thu Aug 01, 2019 5:26 pm
There are various options listed how to connect this device. How do you connect ?
Found https://www.epsolarpv.com/upload/cert/f ... L-V1.0.pdf, page 22. Or is there a better documentation available ?
i use this cable https://www.tokopedia.com/snapshot_prod ... =537423544 to connect mppt to raspberry pi
I've tried it on software called "solar station monitor" on windows, and it works fine. all data from mppt is displayed there correctly.
now i want to try it on raspberry pi and get that problem

ghp
Posts: 1408
Joined: Wed Jun 12, 2013 12:41 pm
Location: Stuttgart Germany
Contact: Website

Re: problem connect epsolar-tracer to raspberry pi

Fri Aug 02, 2019 3:20 pm

Can't access this link, there seems to be a password needed.
If you can connect to windows, then it is most possibly USB based.

The USB serial adapter in Linux usually are named /dev/ttyUSB0. Connect the device and in a terminal, check command

Code: Select all

ls /dev/ttyUSB*
. Then in your code change /dev/ttyACM0 into /dev/ttyUSB0

yogawenno
Posts: 19
Joined: Tue Jul 30, 2019 9:03 am

Re: problem connect epsolar-tracer to raspberry pi

Fri Aug 02, 2019 4:24 pm

ghp wrote:
Fri Aug 02, 2019 3:20 pm
Can't access this link, there seems to be a password needed.
If you can connect to windows, then it is most possibly USB based.

The USB serial adapter in Linux usually are named /dev/ttyUSB0. Connect the device and in a terminal, check command

Code: Select all

ls /dev/ttyUSB*
. Then in your code change /dev/ttyACM0 into /dev/ttyUSB0
on raspberry pi has not detected /dev/ttyUSB0 directory. there is only /dev/ttyACM0. is that a problem?
Attachments
rs485 to usb converter.png
this is my rs485 to usb converter
rs485 to usb converter.png (214.29 KiB) Viewed 490 times

ghp
Posts: 1408
Joined: Wed Jun 12, 2013 12:41 pm
Location: Stuttgart Germany
Contact: Website

Re: problem connect epsolar-tracer to raspberry pi

Fri Aug 02, 2019 5:01 pm

Hmm, nice looking cable. Assume in windows device manager, Serial connections, there is a 'COM'-device visible.
On pi, unplug cable, wait a few secs, then do a " ls /dev/tty* ". Plug in cable, wait few secs, and do again " ls /dev/tty* ". Differences ?
If no differences, the cable has no appropriate driver in linux.
If a new device shows up: this is the name to use.

yogawenno
Posts: 19
Joined: Tue Jul 30, 2019 9:03 am

Re: problem connect epsolar-tracer to raspberry pi

Fri Aug 02, 2019 11:32 pm

when i plug the cabble it looks /dev/ttyACM0 that didn't exist before. When I try on Windows, there is a driver(xr21v1410) that must be installed to read the 'COM' port that is already connected with mppt
Is that also needed when use raspberry Pi?

ghp
Posts: 1408
Joined: Wed Jun 12, 2013 12:41 pm
Location: Stuttgart Germany
Contact: Website

Re: problem connect epsolar-tracer to raspberry pi

Sat Aug 03, 2019 7:01 am

Hello, the /dev/ttyACM0 is available on my system too.
With 'lsusb', you find out some more details about vendorid, productid of usb devices. Here the partial output on a system with an arduino uno and a common FTDI chip

Bus 001 Device 006: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Bus 001 Device 005: ID 2341:0043 Arduino SA Uno R3 (CDC ACM)

With vendorID, productID you can check if drivers are available.

yogawenno
Posts: 19
Joined: Tue Jul 30, 2019 9:03 am

Re: problem connect epsolar-tracer to raspberry pi

Sun Aug 04, 2019 3:06 pm

this is a vendorid list from my raspi

Bus 001 Device 005: ID 1a2c:407e China Resource Semico Co., Ltd
Bus 001 Device 004: ID 10c4:8108 Cygnal Integrated Products, Inc.
Bus 001 Device 006: ID 04e2:1411 Exar Corp.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


Bus 001 Device 006: ID 04e2:1411 Exar Corp. is vendor of my tracer

yogawenno
Posts: 19
Joined: Tue Jul 30, 2019 9:03 am

Re: problem connect epsolar-tracer to raspberry pi

Sun Aug 04, 2019 4:30 pm

this is a address list from my tracer "solar-elektro.cz/data/dokumenty/1733_modbus_protocol.pdf" . or maybe there a mistake in entering the address?

ghp
Posts: 1408
Joined: Wed Jun 12, 2013 12:41 pm
Location: Stuttgart Germany
Contact: Website

Re: problem connect epsolar-tracer to raspberry pi

Sun Aug 04, 2019 5:33 pm

The cable has an USB device build in, but unfortunately I can't find more information for this vendor-product.
Found a page which provides a driver for this sort of devices https://github.com/kasbert/epsolar-trac ... _common-1a
And someone who wired the device directly. https://community.blynk.cc/t/epsolar-tr ... itor/10596

Perhaps a question better asked in https://www.raspberrypi.org/forums/viewforum.php?f=44

yogawenno
Posts: 19
Joined: Tue Jul 30, 2019 9:03 am

Re: problem connect epsolar-tracer to raspberry pi

Mon Aug 05, 2019 8:04 am

my problem has been solved. thank you for helping me in solving my problem :)

User avatar
rpdom
Posts: 15177
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: problem connect epsolar-tracer to raspberry pi

Mon Aug 05, 2019 8:26 am

yogawenno wrote:
Mon Aug 05, 2019 8:04 am
my problem has been solved. thank you for helping me in solving my problem :)
Please could you post details or a link to the solution of your problem, just in case someone else has a similar problem and is seeking a solution.

yogawenno
Posts: 19
Joined: Tue Jul 30, 2019 9:03 am

Re: problem connect epsolar-tracer to raspberry pi

Mon Aug 05, 2019 11:10 am

Problems with my device with drivers that are not installed (exar kernel driver)
I followed these instructions https://github.com/buba447/solartracer- ... /README.md to install the drivers that I need

User avatar
rpdom
Posts: 15177
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: problem connect epsolar-tracer to raspberry pi [SOLVED]

Mon Aug 05, 2019 11:48 am

yogawenno wrote:
Mon Aug 05, 2019 11:10 am
Problems with my device with drivers that are not installed (exar kernel driver)
I followed these instructions https://github.com/buba447/solartracer- ... /README.md to install the drivers that I need
Thank you :-)
Now you can edit your first post on this subject and add "[SOLVED]" to the subject line like I have for this reply. :-)


Return to “Python”