Replies: 12 comments
-
You can't split the commandline...
|
Beta Was this translation helpful? Give feedback.
-
I change the daydata script code into:
When cron executes the daydata script I get an error in the ~/smadata/cron.log file. |
Beta Was this translation helpful? Give feedback.
-
You don't need it if SBFspot.cfg is in the same directory as SBFspot What is the output if you execute |
Beta Was this translation helpful? Give feedback.
-
Now the update process works and I get no error message in the ~/smadata/cron.log file. |
Beta Was this translation helpful? Give feedback.
-
A code solution for the problem would be: ` launch script for daydata (every 5 minutes)
launch script for monthdata (once a day)
` Is this acceptable for you? |
Beta Was this translation helpful? Give feedback.
-
No, because your solution only works if the .cfg file is in the same directory as the SBFspot executable. |
Beta Was this translation helpful? Give feedback.
-
O.k. I added the -cfg part, so the user is free to have a config file in a different directory. ` launch script for daydata (every 5 minutes)
launch script for monthdata (once a day)
` |
Beta Was this translation helpful? Give feedback.
-
I think I pinned down the problem. To tackle the problem I come-up with the following code: daydata batch-file contents could look like:
monthdata batch-file contents could look like:
The only problem I see at the moment is the 'pi:pi' construction. p.s.: The Positional parameters $1, $2, $3, $4, $5 are always empty when the daydata and monthdata batchfiles are executed, so why did you add them? |
Beta Was this translation helpful? Give feedback.
-
Sorry, but I really don't get your problem.... this script has been run hundreds of times by several users without issues...
My guess is the permission on /var/log/sbfspot.3 directory. Owner should be pi:pi and daydata/monthdata is running as pi via cron
This is to run daydata/monthdata with extra arguments |
Beta Was this translation helpful? Give feedback.
-
I am just trying to show you where the problems accur that I encounter in the hope that you can correct them in your future version. Ofcourse I also wishes that I don't have to spend so much time on the subject to get it up and running. My /var/log/sbfspot.3 dir is owend by root and not by pi. |
Beta Was this translation helpful? Give feedback.
-
Do you see
Line 916? |
Beta Was this translation helpful? Give feedback.
-
Yes, I can see the user pi in your picture. I understand that the solution is the changing of the owner ship of the dir /var/log/sbfspot.3 to user pi. |
Beta Was this translation helpful? Give feedback.
-
I am using your script file sbfspot-config-master for communicating with my SMA converter.
But I get no daily or monthly updates from the converter.
The Bluetooth connection works.
The log file keeps track on what is going on.
After viewing your code I think there are 2 little erros in your script file 'sbfspot-config-master.1.3.5', monthdata and daydata.
You find the same code lines in 'sbfspot-config-master.1.0.15', monthdata and daydata.
'sbfspot-config-master.1.3.5', daydata, line 1348:
your code, 'echo "$dir_program/SBFspot $p_daydata$mqtt_arg -cfg$dir_config/$sbfspotcfg $1 $2 $3 $4 $5 &>>$log"'
if I change it to:
echo "$dir_program/SBFspot $p_daydata$mqtt_arg -cfg"
echo "$dir_config/$sbfspotcfg $1 $2 $3 $4 $5 &>>$log"
or
echo -e "$dir_program/SBFspot $p_daydata$mqtt_arg -cfg\n$dir_config/$sbfspotcfg $1 $2 $3 $4 $5 &>>$log"
'sbfspot-config-master.1.3.5', monthdata, line 1359:
your code, 'echo "$dir_program/SBFspot $p_monthdata -cfg$dir_config/$sbfspotcfg $1 $2 $3 $4 $5 &>>$log"'
change it to:
echo "$dir_program/SBFspot $p_monthdata -cfg"
echo "$dir_config/$sbfspotcfg $1 $2 $3 $4 $5 &>>$log"
or
echo -e "$dir_program/SBFspot $p_monthdata -cfg\n$dir_config/$sbfspotcfg $1 $2 $3 $4 $5 &>>$log"
Then the scripts files monthdata and daydata update works.
But I get an error when the line '/$sbfspotcfg $1 $2 $3 $4 $5 &>>$log' is executed.
It produces an error line in the /var/log/sbfspot.3/PV1666_20240118.log file called '/usr/local/bin/sbfspot.3/daydata: line 8: /usr/local/bin/sbfspot.3/SBFspot.cfg: Permission denied'
There seems to be something wrong with the file permission.
I tryed changing the file rights to 664, but that doesn't solve the error.
I also change the owner of the sbfspot.3 directory and all its file to root:root, but that also doesn't solve the error.
Maybe you could solve the problem.
Please let me now if you can agree with my conclusion and changing the errors.
Regards.
Aussems Jean
Beta Was this translation helpful? Give feedback.
All reactions