123solar Not Able to Call 485solar

485solar-get protocol http://sourceforge.net/projects/solarget/
Olu
Posts: 15
Joined: Wed Mar 21, 2018 2:15 am

123solar Not Able to Call 485solar

Post by Olu » Wed Mar 21, 2018 7:06 am

Hello,

I have been trying to communicate with my SMA Inverter US Model from 123solar but cannot. Here is what I have narrowed it down to:

I can confirm 485solar works perfectly for me, I modified the script to handle the USA Model and output the data in the correct array fields.

When I click on "Test Communication" button, I get error message. I can confirm the correct command was issued but I get a NULL response. The "$CMD_RESPONSE" in 485solar-get.php returns empty. I tried replacing the command in "$CMD_POLLING" with just "ls" and it returned the last file in the config directory which tells me 123solar is able to issue commands to my shell. I reverted back to the 485solar command and ran "php 485solar-get.php" on my shell; this ran correctly with the expected response from the SMA inverter, but still cannot get 123solar to retrieve this data from the inverter. I have checked the permissions on 485solar-get and got results posted below:

-rwxr-xr-x 1 root root 30380 Mar 20 00:32 /usr/bin/485solar-get

Any one experienced and solved this before?

///// Output of Test Communication ////
/usr/bin/485solar-get -d -n0 return :

error : /

Thanks.

Olu
Posts: 15
Joined: Wed Mar 21, 2018 2:15 am

Re: 123solar Not Able to Call 485solar

Post by Olu » Wed Mar 21, 2018 2:50 pm

I just wanted to add the output of checking 123solar.service status, hopefully this can ring a bell.

$ sudo systemctl status 123solar
● 123solar.service - 123Solar
Loaded: loaded (/etc/systemd/system/123solar.service; enabled; vendor preset: enabled)
Active: inactive (dead)

Mar 21 06:34:10 raspberrypi systemd[1]: Starting 123Solar...
Mar 21 06:34:20 raspberrypi curl[14340]: % Total % Received % Xferd Average Speed Time Time Time Cur
Mar 21 06:34:20 raspberrypi curl[14340]: Dload Upload Total Spent Left Spe
Mar 21 06:34:20 raspberrypi curl[14340]: [158B blob data]
Mar 21 06:34:20 raspberrypi systemd[1]: Started 123Solar.
Mar 21 06:46:40 raspberrypi systemd[1]: Starting 123Solar...
Mar 21 06:46:50 raspberrypi curl[1905]: % Total % Received % Xferd Average Speed Time Time Time Curr
Mar 21 06:46:50 raspberrypi curl[1905]: Dload Upload Total Spent Left Spee
Mar 21 06:46:50 raspberrypi curl[1905]: [158B blob data]
Mar 21 06:46:50 raspberrypi systemd[1]: Started 123Solar.

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

Re: 123solar Not Able to Call 485solar

Post by jeanmarc » Wed Mar 21, 2018 7:57 pm

Hi,
I bet php don't have the rights for /usr/bin/.
You can create a symbolic link ?

Olu
Posts: 15
Joined: Wed Mar 21, 2018 2:15 am

Re: 123solar Not Able to Call 485solar

Post by Olu » Thu Mar 22, 2018 6:16 am

Hi jeanmarc,

I appreciate your quick reply and you are right that php did not have the right permissions. I gave the permissions but "test communication" still returns error as before. Here are the commands I executed before testing communication again

pi@raspberrypi:~ $ ls -ltr /usr/bin/485solar-get
-rwxr-xr-x 1 www-data www-data 30380 Mar 20 00:32 /usr/bin/485solar-get
pi@raspberrypi:~ $ sudo /etc/init.d/apache2 restart
[ ok ] Restarting apache2 (via systemctl): apache2.service.


Thanks.

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

Re: 123solar Not Able to Call 485solar

Post by jeanmarc » Thu Mar 22, 2018 6:40 pm

Try this test.php and request the page from your browser

Code: Select all

<?php
$RETURN = exec(485solar-get);
?>
Then look at you webserver log eg :
tail -f /var/log/nginx/error.log

Olu
Posts: 15
Joined: Wed Mar 21, 2018 2:15 am

Re: 123solar Not Able to Call 485solar

Post by Olu » Fri Mar 23, 2018 1:31 am

Thanks again @jeanmarc

I did just that and noticed the command was executed but did not display the help details; results below. The only observation is that it could not connect when i used options (async), but it connects and crashes when I use sync options. I then tried the command at the shell prompt and that connected fine and displayed results every single time.

command with no options
1) //-------------------------------------------------------------------------------------------//
ERROR: No options given, showning help


Then tried with options and got
2)//-------------------------------------------------------------------------------------------//
Detect daemon...
Trying to connect...
No daemon found
Selected Options:
debug :1 data :1 events :0
alarms :0 info :0 comments :0
help :0 initcommport :1 status :0
synchrone :0 DeviceNr :0 NumPvStrings :2 StartDaemon :0
DaemonState :0 RequestDaemon:0 monitor :0
Version :0 ExitDaemon :0
yasdiMasterInitialize /etc/yasdi.ini
yasdiMasterSetDriverOnline
DoStartDeviceDetection asyc ...
Wait for GetDeviceHandles 0
Wait for GetDeviceHandles 0

Then tried with options (with sync -S) and got
3)//-------------------------------------------------------------------------------------------//
yasdiMasterInitialize /etc/yasdi.ini
yasdiMasterSetDriverOnline
DoStartDeviceDetection syc ...
wait for GetDeviceHandles 0
Found device:485solar-get: /usr/local/src/yasdi-1.8.1build9-src/master/netdevice.c:148: TNetDevice_GetName: Assertion `me' failed.
Aborted


Thanks,
Olu

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

Re: 123solar Not Able to Call 485solar

Post by jeanmarc » Sat Mar 24, 2018 6:33 pm

The test won't show anything, it's just to see if your webserver can request the command.
Check on your webserver error logs for detail.

If you want the output :

Code: Select all

<?php
$RETURN = exec(485solar-get);
echo $RETURN;
?>

Olu
Posts: 15
Joined: Wed Mar 21, 2018 2:15 am

Re: 123solar Not Able to Call 485solar

Post by Olu » Sun Mar 25, 2018 4:09 pm

I ran and got the following results in the error.log. I must add that when I run the same test.php file directly from the shell, I got the expected results from the inverter with no "abort" errors.

Detect daemon...
Trying to connect...
No daemon found
Selected Options:
debug :1 data :1 events :0
alarms :0 info :0 comments :0
help :0 initcommport :1 status :0
synchrone :1 DeviceNr :0 NumPvStrings :2 StartDaemon :0
DaemonState :0 RequestDaemon:0 monitor :0
Version :0 ExitDaemon :0
yasdiMasterInitialize /etc/yasdi.ini
yasdiMasterSetDriverOnline
DoStartDeviceDetection syc ...
wait for GetDeviceHandles 0
Found device:485solar-get: /usr/local/src/yasdi-1.8.1build9-src/master/netdevice.c:148: TNetDevice_GetName: Assertion `me' failed.
Aborted

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

Re: 123solar Not Able to Call 485solar

Post by jeanmarc » Sun Mar 25, 2018 7:02 pm

yawn :roll: request from the browser (as http user) and report the webserver log

Olu
Posts: 15
Joined: Wed Mar 21, 2018 2:15 am

Re: 123solar Not Able to Call 485solar

Post by Olu » Mon Mar 26, 2018 3:43 pm

The output to log after requesting from browser is:

ERROR: No options given, showning help

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest