Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getInfoData() function not returning info for Tracer Model A, here's the fix. #4

Open
aaronrryan opened this issue Aug 17, 2016 · 40 comments

Comments

@aaronrryan
Copy link

I was able to fix it by editing the getInfoData() function in PhpEpsolarTracer.php
and changing line number 263:
from: $string = preg_replace('/[\f\r]/u', ' - ', $result);
to: $string = preg_replace('/[\f\r\v]/', ' - ', $result);

And now it'll work with Tracer Model A, specifically Tracer2210A.

-= Tracer Info =-
Manufacturer EPsolar Tech co., Ltd
Model Tracer2210A
Version V01.12+V02.11C

@jimlynnjulian
Copy link

jimlynnjulian commented Aug 22, 2016

Hello,

Working with a 3210A and get "Timeout on reading from serial port" from the getInfoData function.
Made your modifications to no avail. Also changed '/dev/ttyUSB0' to '/dev/ttyACM0' , in 'example_cli.php, after doing an 'ls /dev/tty* ' listing'.
Am using with a Raspberry Pi 3B and Debian/Raspbian/Jessie. Any ideas?

@aaronrryan
Copy link
Author

Yes, I had to compile the xr_usb_serial_common-1a kernel module in order to enable the RS-485 protocol, I got it from https://github.com/kasbert/epsolar-tracer.git

I had to get the kernel-header files installed before it would compile.
https://www.niksula.hut.fi/~mhiienka/Rpi/linux-headers-rpi/

I also has to remove the cdc_acm module before adding the kernel module,
I just added the folowing to /etc/rc.local, so it works after reboot.
rmmod cdc_acm
insmod /root/xr_usb_serial_common-1a/xr_usb_serial_common.ko

Good luck
-Aaron

@jimlynnjulian
Copy link

Hello,

Took your advice. Had a problem with the header part and found the cause and solution ini a program called rpi-source. After running the program, I, compiled and installed the driver easily.
The header error problem was due to a 'quirk' in the production method used by RPi.
Thanks again

@aaronrryan
Copy link
Author

I edited using "sudo vi /etc/rc.local" and added the rm/insmod. There is
probably a way to add to the /etc/modprobe.d/ dir or /etc/modules file, I
just didnt look into it, since the rc.local was working for me.

On Wed, Aug 24, 2016 at 8:49 AM, jimlynnjulian [email protected]
wrote:

Hello,
A minor problem with your instructions, probably due to my newness to the
Raspberry Pi and Linux.
I have to do the remove/insert every time I turn the RPi off. Is there a
way to make the change permanent? I'm already using 'sudo'.
Thank you


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#4 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AKEReH1HmdYFCmqKE7kR1ZiBvLlR6vzSks5qjGgSgaJpZM4Jl-Lx
.

@pufferbatterie
Copy link

Hello,

let me thank you for your simple library at first.
I have a connection Problem with my serial adapter.
I use the EPIPC-COM Charge controller which is the same and even comes with a maual for EPIPDB-COM, EPIC-COM and EPSolar Chargers.
The charger has 15V from a power supply.
I use the provided RJ45->USB-Serial Adapter with the Exar chip.
Rasperry Pi 3 4.4.13-v7+
I tried the included /dev/ttyACM0 and compiled the x_usb_serial module to use /dev/ttyXRUSB0.
I can open the port and write to it but i get a read timeout.
Any ideas?

@brynnneilson
Copy link

I have a 3210A as well and when I run example_cli.php I get this:

Info Data
----------------------------------
00 Manufacturer: - ++
01 Model: p

Cannot get Rated Data
Cannot get RealTime Data
Cannot get Statistical Data
Cannot get Settings Data
Cannot get Coil Data
Cannot get Discrete Data

Any ideas?

I compiled the driver on an Asustor AS1002T Arm based NAS

brynn :-)

@toggio
Copy link
Owner

toggio commented Nov 7, 2016

Hi brynn, the other parts are working?

2016-11-07 3:04 GMT+01:00 Brynn Neilson [email protected]:

I have a 3210A as well and when I run example_cli.php I get this:

Info Data

00 Manufacturer: - ++
01 Model: p

Cannot get Rated Data
Cannot get RealTime Data
Cannot get Statistical Data
Cannot get Settings Data
Cannot get Coil Data
Cannot get Discrete Data

Any ideas?

I compiled the driver on an Asustor AS1002T Arm based NAS

brynn :-)


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#4 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADkXmGUJN1klVZIRCAb_dINGoGNfdwbSks5q7odHgaJpZM4Jl-Lx
.

@jimlynnjulian
Copy link

jimlynnjulian commented Nov 7, 2016

Brynn,
I compiled on a Raspberry Pi 3B running Raspbian Jessie Linux. The action I outlined in an earlier post should work for any Debian based Linux. If you're not using a variant of Linux, I can't help you.
I got the same errors. The driver was not compiled correctly. The driver may not be loading, too. I had to right a script to replace the existing driver with the newer one.
Additionally, I never did get the driver to compile with Windows. I didn't know how to change from Linux USB port protocol to Windows COM port protocol.

@brynnneilson
Copy link

Thanks guys. I found my issue. I thought the device was at /dev/ttyS1 but it was at /dev/ttyXRUSB0 - doh! Here's the output:

`Info Data

00 Manufacturer: EPsolar Tech co., Ltd
01 Model: Tracer3210A
02 Version: V01.12+V02.11V

Rated Data

00 PV array rated voltage: 100V
01 PV array rated current: 30A
02 PV array rated power: 780W
03 Battery rated voltage: 24V
04 Rated charging current: 30A
05 Rated charging power: 780W
06 Charging Mode: 2
07 Rated load current: 30A

RealTime Data

00 PV array voltage: 13.88V
01 PV array current: 0.16A
02 PV array power: 2.31W
03 Battery voltage: 12.87V
04 Battery charging current: 0.18A
05 Battery charging power: 2.31W
06 Load voltage: 12.87V
07 Load current: 0.09A
08 Load power: 1.15W
09 Battery temperature: 17.44°C
10 Charger temperature: 18.89°C
11 Heat sink temperature: 18.89°C
12 Battery SOC: 31%
13 Remote battery temperature: 17.44°C
14 System rated voltage: 12V
15 Battery status: 0
16 Equipment status: 11

Statistical Data

00 Max input voltage today: 14.79V
01 Min input voltage today: 0V
02 Max battery voltage today: 12.9V
03 Min battery voltage today: 12.75V
04 Consumed energy today: 0.01KWH
05 Consumed energy this month: 0.21KWH
06 Consumed energy this year: 0.26KWH
07 Total consumed energy: 0.26KWH
08 Generated energy today: 0KWH
09 Generated energy this moth: 0.48KWH
10 Generated energy this year: 0.72KWH
11 Total generated energy: 4.7KWH
12 Carbon dioxide reduction: 0T
13 Net battery current: 0.09A
14 Battery temperature: 17.44°C
15 Ambient temperature: 17.44°C

Settings Data

00 Battery type: 1
01 Battery capacity: 200Ah
02 Temperature compensation coeff.: 3mV/°C/2V
03 High voltage disconnect: 16V
04 Charging limit voltage: 15V
05 Over voltage reconnect: 15V
06 Equalization voltage: 14.6V
07 Boost voltage: 14.4V
08 Float voltage: 13.8V
09 Boost reconnect voltage: 13.2V
10 Low voltage reconnect: 12.6V
11 Under voltage recover: 12.2V
12 Under voltage warning: 12V
13 Low voltage disconnect: 11.1V
14 Discharging limit voltage: 10.6V
15 Realtime clock (sec): 17
16 Realtime clock (min): 11
17 Realtime clock (hour): 8
18 Realtime clock (day): 8
19 Realtime clock (month): 11
20 Realtime clock (year): 16
21 Equalization charging cycle: 30 day
22 Battery temp. warning hi limit: 65°C
23 Battery temp. warning low limit: -39.99°C
24 Controller temp. hi limit: 85°C
25 Controller temp. hi limit rec.: 75°C
26 Components temp. hi limit: 85°C
27 Components temp. hi limit rec.: 75°C
28 Line impedance: 0mOhm
29 Night Time Threshold Volt: 5V
30 Light signal on delay time: 10 min.
31 Day Time Threshold Volt: 6V
32 Light signal off delay time: 10 min.
33 Load controlling mode: 0
34 Working time length1 min.: 0
35 Working time length1 hour: 15
36 Working time length2 min.: 0
37 Working time length2 hour: 0
38 Turn on timing1 sec: 0
39 Turn on timing1 min: 0
40 Turn on timing1 hour: 19
41 Turn off timing1 sec: 0
42 Turn off timing1 min: 0
43 Turn off timing1 hour: 6
44 Turn on timing2 sec: 0
45 Turn on timing2 min: 0
46 Turn on timing2 hour: 19
47 Turn off timing2 sec: 0
48 Turn off timing2 min: 0
49 Turn off timing2 hour: 6
50 Length of night min.: 16
51 Length of night hour: 12
52 Battery rated voltage code: 0
53 Load timing control selection: 0
54 Default Load On/Off: 1
55 Equalize duration: 120 min.
56 Boost duration: 120 min.
57 Dischargning percentage: 80%
58 Charging percentage: 100%
59 Management mode: 0

Coils Data

00 Manual control the load: 1
01 Enable load test mode: 0
02 Force the load on/off: 0

Discrete Data

00 Over temperature inside device: 0
01 Day/Night: 0
`

@bonkas
Copy link

bonkas commented Jan 18, 2017

I am having trouble getting the cable supplied by EPSolar to be recognised. After following all these instructions and also giving this alternative a go: http://indilib.org/forum/general/1085-baader-diamond-steeldrive-not-working.html?start=12

The only device I have is /dev/ttyAMA0

I can see the USB device being detected when plugged in as "Exar Device"

Not sure where to go from here...

@jimlynnjulian
Copy link

What are you plugging into, a Raspberry Pi? If so, you should have '/dev/ttyXRUSB0'.

@jimlynnjulian
Copy link

For the RPi, the linux headers have to be re-compiled before the driver can be compiled. If you're not using a RPi, then I can't help you. If the Exar UART is being recognized, the cable is probably fine unless there is a reason why you think not.

@bonkas
Copy link

bonkas commented Jan 18, 2017

Yeah I am using RPi, The driver compiled fine. Cable being recognised but not showing as '/dev/ttyXRUSB0' which is also what I was expecting. I must be doing something wrong but cant figure out what...

@jimlynnjulian
Copy link

jimlynnjulian commented Jan 18, 2017 via email

@jimlynnjulian
Copy link

jimlynnjulian commented Jan 18, 2017 via email

@bonkas
Copy link

bonkas commented Jan 18, 2017

Yeah I used the rpi-source application before I built the driver.
It is being recognised...
/dev/bus/usb/001/006 - Exar_Corp._XR21B1411_H7180876441
Just not showing as '/dev/ttyXRUSB0'...

I am rebuilding the file now, will check for typos in /etc/rc.local as explained above and see what happens.

@jimlynnjulian
Copy link

jimlynnjulian commented Jan 18, 2017 via email

@bonkas
Copy link

bonkas commented Jan 19, 2017

Hmmm have noticed the raspberry pi reboots upon inserting the cable after loading this driver.
I have tried wiping the SD and starting over 3 times now but no luck. You seem very knowledaible in the RPi and Linux in general which is where my knowledge is sorely lacking, dont mean to hijack this thread but are you able to offer any more assistance or point me to a guide which may get this working?

@bonkas
Copy link

bonkas commented Jan 19, 2017

I have made progress here... The USB device is now showing correctly!
Although to get this to happen I have to run these commands in sequence - admittedly I am not 100% on thier full function:

rmmod cdc-acm
modprobe -r usbserial
modprobe usbserial
insmod ./xr_usb_serial_common.ko

Is there any way to make this changer permanent?

@jimlynnjulian
Copy link

jimlynnjulian commented Jan 19, 2017 via email

@jimlynnjulian
Copy link

I recently ran update and upgrade on my RPi. Afterward, the Epever service I wrote would not run. The driver would not load. I recompiled the headers and driver and the driver ran for a day. Currently, attempts to manually load the driver result in a 'file exists' message and a list of running modules includes the Exar driver. However, when I list the TTY, the Exar driver is not on the list. The upgrade is the first time since the current installation of Raspbian. I'm thinking that has something to do with the problem. Anyone have any ideas?
Thanks

@brynnneilson
Copy link

I'm having exactly the same issue. Did you move from kernel 3.x to 4.x?

@jimlynnjulian
Copy link

Linux raspberrypi 4.4.38-v7+ #938 SMP Thu Dec 15 15:22:21 GMT 2016 armv7l GNU/Linux

@jimlynnjulian
Copy link

If the Rpi-Source script is no longer useful, I'll use a copy of Raspbian I put on DVD a few months ago, and not make any upgrades. Hopefully, updates will have no effect. My next step will, if I don't run across another option, be to re-record my SD card and start over. I'm going to keep searching though, that seems draconian for the moment.

@jimlynnjulian
Copy link

jimlynnjulian commented Jan 19, 2017

But wait! I just rebooted the RPi and, while the driver was not loaded, a manual load succeeded and the data's being recorded. I ran Rpi-Source again an got a message stating the kernel was fine. One thing I did do differently was to remove all of the driver related files created in the first compile (several months ago). Then I recompiled. The reboot must have reset something because the driver is working now.

@bonkas
Copy link

bonkas commented Jan 20, 2017

I got mine reading the data now.. Except it is not reading the manufacturer for some reason.

This way of reading the data gives me the manufacturer but no other data... https://github.com/kasbert/epsolar-tracer

EDIT: Doh re-read the thread title and the first post...

@bonkas
Copy link

bonkas commented Jan 22, 2017

This is how I resolved having to manually insert the driver in each boot...

Copy my kernel module to the drivers directory.

$ sudo cp mymodule.ko /lib/modules/$(uname -r)/kernel/drivers/

Add the simple name of my module to the file /etc/modules. You can edit the file or just append to it as shown here.

$ echo 'mymodule' | sudo tee -a /etc/modules

Update the list of module dependencies.

$ sudo depmod

Reboot the computer and voila, it worked.

@jimlynnjulian
Copy link

Hello toggio,
I've been running PHPEpsolarTracer for nine months without issue. Thanks again for the software and the help.
Jim J.

@phuse
Copy link

phuse commented Sep 30, 2019

Hello,

let me thank you for your simple library at first.
I have a connection Problem with my serial adapter.
I use the EPIPC-COM Charge controller which is the same and even comes with a maual for EPIPDB-COM, EPIC-COM and EPSolar Chargers.
The charger has 15V from a power supply.
I use the provided RJ45->USB-Serial Adapter with the Exar chip.
Rasperry Pi 3 4.4.13-v7+
I tried the included /dev/ttyACM0 and compiled the x_usb_serial module to use /dev/ttyXRUSB0.
I can open the port and write to it but i get a read timeout.
Any ideas?

Hi, Did you get this to work? I'm trying to figure out if the EPIPC-COM is actually using modbus as it's MPPT Tracer-siblings

Regards,
Daniel

@audunbrekke
Copy link

EPIPC-COM

Hi. Did You manage to communicate with the EPIPC-COM ? I am trying now, but get broken data.

@jimlynnjulian
Copy link

jimlynnjulian commented Apr 6, 2020 via email

@audunbrekke
Copy link

Ok. I have been trying with baud rate 9600. Is'nt it the right baud rate ? Or do you mean delay in write / read commands in the software ?

@jimlynnjulian
Copy link

jimlynnjulian commented Apr 6, 2020 via email

@dtabone
Copy link

dtabone commented Apr 24, 2021

Confirming this fix in the first post works on a raspi3b - connected via socat to an ebox-wifi-01 in STA mode to my home wifi.

Info Data

00 Manufacturer: EPsolar Tech co., Ltd
01 Model: TriRon3210
02 Version: V01.56+V01.22j

I was able to fix it by editing the getInfoData() function in PhpEpsolarTracer.php
and changing line number 263:
from: $string = preg_replace('/[\f\r]/u', ' - ', $result);
to: $string = preg_replace('/[\f\r\v]/', ' - ', $result);

And now it'll work with Tracer Model A, specifically Tracer2210A.

-= Tracer Info =-
Manufacturer EPsolar Tech co., Ltd
Model Tracer2210A
Version V01.12+V02.11C

@isipisi89
Copy link

isipisi89 commented Oct 9, 2022

@aaronrryan

i have a TriRon 3210N and tracer 1210AN.
Installed drivers and they are showing as /dev/ttyXRUSB0

when i enable debug php gives me this on example_web.php:

DEBUG [query sent]: \x01\x2b\x0e\x01\x00\x70\x77 DEBUG [response received]: \x DEBUG [query sent]: \x01\x43\x31\x00\x00\x76\xcb\x1f DEBUG [response received]: \x DEBUG [no response]

the usb device i have is Bus 001 Device 003: ID 04e2:1411 Exar Corp. XR21B1411

Both 3210N and tracer 1210AN are not working :/

Mybe someone could help me?

@TerryFrench
Copy link

TerryFrench commented Oct 9, 2022 via email

@isipisi89
Copy link

isipisi89 commented Oct 10, 2022

@TerryFrench

yes the cable works fine, i used the cable with windows 11 and the epever software to configure the devices, they show up properly on windows. but i cant get it work on the pi.
i compiled the driver on the pi and the usb device is showing correctly /dev/ttyXRUSB0.
but using the software on the pi gives me DEBUG [response received]: \x

there musst be something i am missing out, mybe it dosent work with the pi 4?

@TerryFrench
Copy link

TerryFrench commented Oct 10, 2022 via email

@jimlynnjulian
Copy link

jimlynnjulian commented Oct 11, 2022

Just for the record, the Epever Triron 4210 is a plugin replacement for the Tracer 3210 when using this software. (aaronrryan variant).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests