Page 1 of 1

123solar errors when connecting

Posted: Tue Feb 24, 2015 4:30 am
by jatz76
Hi,

I seem to have a very similar problem to the previous post by Peter_11.

I while back my rPi SD card died and I've only now got the setup going again. I have followed my previous notes and predominately Walter62's config (http://walter62.altervista.org/joomla/r ... datalogger).

The logger itself looks to be working correctly. I have data coming in, being sent to pvoutput.org and the different dials/live data is coming through ok.
Note, I'm using a RS485 to USB adapter (RAlink 3070).

Everything seems to work however I get 'Communication error' in the Events Log (/123solar/data/invt1/infos/events.txt). These are not continuous but do occur and depend on the comms settings I use (see below).

I have read many forums including this form for help. I initially was using the Communication options -Y5 -l5 but it did not help. I then tried various combinations of the -Y -l -R -P switches. Using -Y7 -l10 -R1000 significantly reduced the comms errors but the live data stopped working.
I then started using the -Y and -w combinations. I currently have it set to -Y10 -w5 and haven't been getting any comms errors in the event log. That looks good so far.

However when I turn the debug on (I wanted to see if all comms were good) I get comms errors again in the event log, and the /errors directory starts to fill with files about every 5 seconds (logs available here: https://www.sugarsync.com/pf/D6071553_94691054_734964).
Opening these files I see that the tests/commands return Success! except for the last line which returns an ERROR code like the next two examples:

Code: Select all

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

devLCKfile: </var/lock/LCK..ttyUSB0>
devLCKfileNew: </var/lock/LCK..ttyUSB0.16451>
Clearing Serial Port Lock (16451)... done.

20150224-12:13:20: aurora: ERROR: Received bad return code (-1 78)

Code: Select all

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

devLCKfile: </var/lock/LCK..ttyUSB0>
devLCKfileNew: </var/lock/LCK..ttyUSB0.16514>
Clearing Serial Port Lock (16514)... done.

20150224-12:13:22: aurora: ERROR: Received bad return code (-1 59 26)
Does this actually mean that there are comms errors/issues?
Am I missing something here?
Should I be concerned?

Thanks,

Jacek

Re: 123solar errors when connecting

Posted: Tue Feb 24, 2015 7:57 am
by jeanmarc
Hi,

Well, mind that 'Communication error' happens and getting once in a while is normal. If you are bothered by those errors, you may set the 'Log com. errors' to no.
If aurora don't return sucessfully, you'll get a 'Communication error' in 123solar. If the data are too old, the live pooling will drop to zero.

That say: tweaking the communication parameters depend on each system. You need first to read carefully the aurora's README. Then, stop 123solar and in the command line request continuously aurora while playing with the options.

Good luck

BTW, i have played with a rPi B+ few weeks ago, the USB serial stack were disappointing IMHO. :?

Re: 123solar errors when connecting

Posted: Tue Feb 24, 2015 9:34 am
by jatz76
Thanks Jean.

I did read the help files (as you suggested to Peter_11) and did play around with settings.

The errors in the Error Log (errors.txt) do not show any comms errors with the -Y10 -w5 options. This is good.

My concern is that if I turn on the debug mode I do get errors.
I guess I'm asking whether this is something to be worried about (that debug produced errors) as it is the only time with the -Y10 -w5 option that I get comms errors which seems strange.

USB: yes, I have read in several places that the USB implementation on the Pi is not very good.

Re: 123solar errors when connecting

Posted: Tue Feb 24, 2015 11:01 am
by jeanmarc
I can't access your logs errors files here at work but if aurora end up with a ERROR: Received bad return code, it is indeed a com error.

I believe noone reads carefully README :oops: make sure you read the part "X - reading from inverter more aggresively and patiently" of aurora.
You should play with the -l option first, if not the -R. -w will only wait and -Y is for retrying (ain't tweaking).
As i said above, the Rpi b+ reasonable pooling rate i was able to achieve was 2-3sec without too much errors. It is much much more reliable and faster on my Pogos. I have yet to try on my odroid.

Re: 123solar errors when connecting

Posted: Tue Feb 24, 2015 11:23 pm
by jatz76
Hi Jean,

I have re-read the readme again. Have tried many different combinations.
I turned off the logger and repeatedly ran "aurora -b -a2 -e -y <options> /dev/ttyUSB0"

These are the results:
  • - Using -l4 or under by itself still produced errors.
    - Using -l5 by itself seemed to be the fastest without producing many errors
    - Using the -R option by itself still produced occasional errors and was very slow
    - Combining -l5 and -R## still produced some errors and was slow
    - Adding -Y helped a lot. At first I started of with Y5 and ended up setting it to Y20. The reason for Y20 is that most of the time it took 2 to 4 retries but sometimes it went to 12 so I thought 20 was a good buffer.
So using -Y20 -l5 seemed to produce good results though I guess that since it takes more than 1 retry it still means that the comms are not right.

Next I added the options to the logger and started it in debug mode. I get no errors which is good, however the live data takes forever to come through. After playing around I just left it at -Y20 and it seems to be the best option. I get no comms errors in the error log or from the debug and the live data comes through about every 3-5 seconds. This will have to do for now. I don't think its really resolved anything apart from masking the errors but thats ok.

Thanks for your help,

Jacek