30 maggio 2015

aurora: ERROR: Received bad return code (-1 0)

Hi,
I will explain my experience.
This morning my raspberry, where I installed 123Solar, it didn't communicate with my Power One inverter .
So I tried with putty to run the command:
aurora -a 2 -c -T -Y4 -d0 -e /dev/ttyUSB0
and I have received the error:
aurora: ERROR: Received bad return code (-1 0) 

After that I tested the communication with the command:
 aurora -a 2 -b -e /dev/ttyUSB0
and it returned:
aurora -a 2 -b -e /dev/ttyUSB0

szttyDevice: /dev/ttyUSB0
yDelay:     1
yTimeout    0 mS
yMaxRunTime ~
devLCKfile:
devLCKfileNew:
Got Params

RunTime     20150530-10:50:52 v1.8.8
Endian    : Little
tm_gmtoff : no
PID       : 23089

Attempting to get lock on Serial Port /dev/ttyUSB0...
Checking for lock

Checking process 23089 for lock
rPID: 23089 SubStrPos: aurora command: aurora = me
Appears we got the lock.

Opening Serial Port /dev/ttyUSB0...  Serial Port /dev/ttyUSB0 successfully opene                                                                                        d.
Configuring serial device... Flushing unread data first...  Success!
Flushing serial device buffer... Success!

Comm Check: Let's see if the Aurora is listening...
Elapsed time since last comm 0 us
Attempt 1
Clearing read buffer Success!
szSerBufferSave OK! 02 3a 00 00 00 00 00 00 00 00
command: 02 3a 00 00 00 00 00 00 01 b7
Flushing serial device buffer... Success!
Sending command... sent 10 characters
Draining serial device buffer... Success!
Cleared data buffer: 00 00 00 00 00 00 00 00 00 00
Read char #1 RC=0 (00) waited/max    99272/1000000  uS
answer:  Got -1 characters
Comm Check: Failure, aborting...

Restoring Serial Port settings /dev/ttyUSB0... Success!
Flushing serial device buffer... Success!
Closing Serial Port /dev/ttyUSB0... Success!

devLCKfile:
devLCKfileNew:
Clearing Serial Port Lock (23089)... done.

20150530-10:50:53: aurora: ERROR: Received bad return code (-1 0)

Complete 20150530-10:50:53

So I googled to looking for someone met the same error and I find out a post in a forum where someone have suggested to change the parameter Y from -Y4 to -Y10. 

The parameter Y means:
-Y , --retries=      Retry failed communications with inverter up to   times (1-100)

After the changing it looked works but after a while it stopped.

At the end I discovered that a wire was disconnected in the converter RS-485 to USB! I fixed it and now it works!

Bye
Francesco