problem building aurora-1.8.8 on arch linux 32bit

aurora protocol http://www.curtronics.com/Solar/
Post Reply
machiavellino
Posts: 3
Joined: Tue Jul 28, 2015 11:28 am

problem building aurora-1.8.8 on arch linux 32bit

Post by machiavellino » Tue Jul 28, 2015 11:50 am

hello everyone. I set up a virtual machine with arch linux to install 123solar.
version: Linux 4.1.2-2-ARCH #1 SMP PREEMPT i686 GNU/Linux

I followed the instructions on http://123solar.org/guide.html, the website seems to work fine, 123solar service starts at boot, but i have problem with aurora communication.

While running "make", i got the following output:

Code: Select all

comm.c: In function âszCvrtFloat.constpropâ:
comm.c:1851:11: warning: function returns address of local variable [-Wreturn-local-addr]
     return(value);
           ^
comm.c:1833:19: note: declared here
     unsigned char cValue[4];
When running some commands such as

Code: Select all

 aurora -a 2 -t /dev/ttyEZL0

Current Inverter date/time: 28-Jul-2015 12:44:31

Everything is fine,
but with some others no.

Code: Select all

[root@solar ~]# aurora -b -a 2 -c -T -Y6 -d0 -e /dev/ttyEZL0
I got the following output:

Code: Select all

aurora -b -a 2 -c -T -Y6 -d0 -e /dev/ttyEZL0

szttyDevice: /dev/ttyEZL0
yDelay:     1
yTimeout    0 mS
yMaxRunTime ~
devLCKfile: </var/lock/LCK..ttyEZL0>
devLCKfileNew: </var/lock/LCK..ttyEZL0.23071>
Got Params

RunTime     20150728-12:33:30 v1.8.8
Endian    : Little
tm_gmtoff : yes
PID       : 23071

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

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

Opening Serial Port /dev/ttyEZL0...  Serial Port /dev/ttyEZL0 successfully opened.
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    98656/1000000  uS
answer:  Got -1 characters

Elapsed time since last comm 0 us
Attempt 2
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=1 (00) waited/max    24806/1000000  uS
Read char #2 RC=1 (06) waited/max       18/1000000  uS
Read char #3 RC=1 (36) waited/max       13/1000000  uS
Read char #4 RC=1 (49) waited/max       14/1000000  uS
Read char #5 RC=1 (4e) waited/max       16/1000000  uS
Read char #6 RC=1 (4e) waited/max       10/1000000  uS
Read char #7 RC=1 (1b) waited/max       14/1000000  uS
Read char #8 RC=1 (26) waited/max       12/1000000  uS
answer:  00 06 36 49 4e 4e 1b 26
received 8 characters
CRC receive OK 261b
Transmission State Check: 0
Model ID "6" qMultiplier -1.0000000 -- PVI-6000-OUTD --
Comm Check: OK

Elapsed time since last comm 9708 us
Attempt 1
Clearing read buffer Success!
szSerBufferSave OK! 02 3b 04 00 00 00 00 00 00 00
command: 02 3b 04 00 00 00 00 00 78 38
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=1 (00) waited/max    43247/1000000  uS
Read char #2 RC=1 (06) waited/max       12/1000000  uS
Read char #3 RC=1 (42) waited/max        9/1000000  uS
Read char #4 RC=1 (47) waited/max      214/1000000  uS
Read char #5 RC=1 (df) waited/max       16/1000000  uS
Read char #6 RC=1 (41) waited/max       15/1000000  uS
Read char #7 RC=1 (db) waited/max       17/1000000  uS
Read char #8 RC=1 (e6) waited/max       14/1000000  uS
answer:  00 06 42 47 df 41 db e6
received 8 characters
CRC receive OK e6db
Transmission State Check: 0
szCvrtFloat    49.968021 0x4247df41
Segmentation fault (core dumped)
it looks like aurora has problem interpreting something from the invevrter output. But from lubuntu everything is fine.

And i often got a"unable to lock serial device" error, with two sequential PIDs , even if nothing is using the device (service is stopped, ps -A shows nothing).

The same aurora versione, built on Lubuntu 32 bit works like a charm.

Does anybody knows how to fix that?

machiavellino
Posts: 3
Joined: Tue Jul 28, 2015 11:28 am

Re: problem building aurora-1.8.8 on arch linux 32bit

Post by machiavellino » Tue Jul 28, 2015 2:45 pm

Changing the function szCvrtFloat() to the following version in comm.c (and recompiling: make/make install) solved the problem;

Code: Select all

float szCvrtFloat(char *Buffer)
{
    unsigned char cValue[4];
    float *value;

    if (! bSwapEndian) {
        cValue[0] = Buffer[aParam4];
        cValue[1] = Buffer[aParam3];
        cValue[2] = Buffer[aParam2];
        cValue[3] = Buffer[aParam1];
    } else {
        cValue[0] = Buffer[aParam1];
        cValue[1] = Buffer[aParam2];
        cValue[2] = Buffer[aParam3];
        cValue[3] = Buffer[aParam4];
    }

    value = (float *)cValue;
    if (bVerbose) fprintf(stderr, "szCvrtFloat %12.6f 0x%02x%02x%02x%02x\n",*value,cValue[3],cValue[2],cValue[1],cValue[0]);

    float valF = *value;
    return(valF);
}
I changed the return type from float* to float, and changed any reference from *szCvrtFloat to szCvrtFloat, and added a local variable float valF to return instead of *value.

seems strange to me that was compiling and working on lubuntu, and not on arch linux.. but if it happens to you, now you know what to do!

jeanmarc
Posts: 1767
Joined: Thu Aug 29, 2013 7:16 am

Re: problem building aurora-1.8.8 on arch linux 32bit

Post by jeanmarc » Tue Jul 28, 2015 2:52 pm

Hi,
Thanks, you might also contact Curt (the guy behind aurora program).

jeanmarc
Posts: 1767
Joined: Thu Aug 29, 2013 7:16 am

Re: problem building aurora-1.8.8 on arch linux 32bit

Post by jeanmarc » Mon Aug 17, 2015 12:57 pm

Hi,
Just had the same issue building aurora on a fresh install. thanks for the tips :)
Did you drop a line to Curt ?

curt
Posts: 2
Joined: Sat Sep 26, 2015 7:14 pm

Re: problem building aurora-1.8.8 on arch linux 32bit

Post by curt » Sat Sep 26, 2015 7:18 pm

No he hasn't contacted Curt...

jeanmarc
Posts: 1767
Joined: Thu Aug 29, 2013 7:16 am

Re: problem building aurora-1.8.8 on arch linux 32bit

Post by jeanmarc » Sat Sep 26, 2015 7:29 pm

Shame on him(/us) ;)
:arrow: Mind that aurora is the work and it's maintained by Curt :geek:

curt
Posts: 2
Joined: Sat Sep 26, 2015 7:14 pm

Re: problem building aurora-1.8.8 on arch linux 32bit

Post by curt » Sun Sep 27, 2015 4:19 pm

aurora version 1.9.0 has been released that corrects this issue that started showing up in the current version of Arch Linux for Pi's. No reports of it occurring on any other architecture. I didn't have the issue on my 64bit AMD Phenom II.

See. Once someone told me, thanks Gary, I had it fix in 24 hours.

jeanmarc
Posts: 1767
Joined: Thu Aug 29, 2013 7:16 am

Re: problem building aurora-1.8.8 on arch linux 32bit

Post by jeanmarc » Sun Sep 27, 2015 4:38 pm

Work like a charm on my Rpi2 and my Odroid, thanks Curt !

machiavellino
Posts: 3
Joined: Tue Jul 28, 2015 11:28 am

Re: problem building aurora-1.8.8 on arch linux 32bit

Post by machiavellino » Thu Oct 01, 2015 3:13 pm

Sorry for not contacting Curt pronto, but i was on vacation and then i forgot about it.
Still i cant' understand why it was working on lubuntu etc. Anyway i'm glad everything is solved now.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests