This page last changed on Jul 12, 2013 by masas.

I'm using OpenRemote to launch my own shell script, with arguments which then tell what should happen. To this end I have created a few commands in the Desgner, where the executable is always the same, just the arguments differ. I then assign these commands to buttons with the Designer. It seemed to work for a while. For whatever reason, occasionally my panel gets totally messed up, in the sense that the buttons I have do not invoke the script with the correct arguments, but instead they use the arguments in the other commands, or even in commands I have tried to remove alltogether with the designer.

What would be the proper way to debug the shell execution protocol? What are the log files I should look into? What documentation exists? What source code should I read?

Somehow this could be related to caching, since rebooting the host (Mac OS) seems to fix the problem. Also, one error I get is "Failed to reload configuration and clear cache!" when I try to "reload configuration and clear the cache" with my controller main page. Any debugging info would be great. There is nothing obvious in logs/boot.log.

--Matti

You could add more logging into the /webapps/controller/WEB-INF/classes/log4j.properties files. Add the following entries to the end of the file:

log4j.logger.OpenRemote.Controller.protocol.SHELLEXE = ALL, shell-file

log4j.appender.shell-file = org.apache.log4j.RollingFileAppender
log4j.appender.shell-file.File = ../logs/shell.log
log4j.appender.shell-file.Threshold = DEBUG
log4j.appender.shell-file.MaxFileSize = 500KB
log4j.appender.shell-file.MaxBackupIndex = 1
log4j.appender.shell-file.layout = org.apache.log4j.PatternLayout
log4j.appender.shell-file.layout.ConversionPattern = %p %d (Shell): %m%n

This should create a /log/shell.log file with debug output – it may give you additional information of what's happening. Try that first. If it doesn't seem to reveal anything, then we need to look at the code to add more detailed logs and/or review the implementation.

HTH,

– Juha

Posted by juha at Jul 13, 2013 00:30

Hi Juha.

I am trying to finilize the Modbus integration but the sensors refuse to work.
As seen in the Modbus post, all shell commands work fine under terminal. I can set coils, read status.
Under shell ececution the commands work fine and I am able to set my coils as I please.

Update:
Version 2.1.0 does to log shell commands while 2.1.1 does.
It looks like I do get responce from my bash files I have created for the ModBus but the sensors are not transfering data to the sensor (custom sensor one).
I exit the bash file with Exit 0, 1 and 2 to reflect 2 states (On, Off and Comm Error).
The sensors do not reflect the proper state.

What am I doeing wrong?

Posted by niraviry at Sep 06, 2015 15:52

Finally got it. Will post it under the Modbus post.

Posted by niraviry at Sep 14, 2015 20:17

Could you out a link to your ModBus post here please?
I'm also having troubles with shell execution protocol.

and the debug log isn't making me any wiser....

DEBUG 2015-09-19 19:02:58,876 (Shell): Found cached ShellExe command with id: 1357
DEBUG 2015-09-19 19:02:58,927 (Shell): Will start shell command: /home/pi/shProject/CallCamPopUpToKodi.sh and use params: null
DEBUG 2015-09-19 19:03:00,485 (Shell): Shell command: /home/pi/shProject/CallCamPopUpToKodi.sh returned: call to KODI sent
DEBUG 2015-09-19 19:04:48,924 (Shell): Found cached ShellExe command with id: 1358
DEBUG 2015-09-19 19:04:48,926 (Shell): Will start shell command: /home/pi/shProject/redScreenTV5Sec.sh and use params: null
DEBUG 2015-09-19 19:04:49,500 (Shell): Shell command: /home/pi/shProject/redScreenTV5Sec.sh returned:
DEBUG 2015-09-19 19:09:56,430 (Shell): Found cached ShellExe command with id: 1357
DEBUG 2015-09-19 19:09:56,432 (Shell): Will start shell command: /home/pi/shProject/CallCamPopUpToKodi.sh and use params: null
DEBUG 2015-09-19 19:09:57,638 (Shell): Shell command: /home/pi/shProject/CallCamPopUpToKodi.sh returned: call to KODI sent

Posted by icefluffy at Sep 19, 2015 18:11

Hi.

This is the post. http://openremote.org/pages/viewpage.action?pageId=21039276&focusedCommentId=23601278#comment-23601278

It works great. Keep in mind that there might be a misunderstanding about the polling period. I did several changes at the last stage and one of them as to remove the m in the polling time. I think stands for minutes while nothing stands for milliseconds.
furthermore, I have many polling (sensors) so I set each in a slightly different period so the chance of time conflict shall be lower.

Hope this works for you.
BTW, I am going on vacation tomorrow night so I will have less time to help.

Posted by niraviry at Sep 19, 2015 19:09

Thx,

the script I called contained the following:
sshpass -p openelec ssh root@192.168.69.199 /storage/hyperion/bin/hyperion-remote.sh -c red -d 5000

this did not work...

I installed hyperion on my open remote platform and am now using this in my script:
hyperion-remote -a 192.168.69.199:19444 --priority 50 --color red --duration 5000

works like a charm now...

Posted by icefluffy at Sep 19, 2015 19:14
Document generated by Confluence on Jun 05, 2016 09:40