executeCommandLine gives error - cannot bind 'local:5037'

I use this script for executing a shell

rule "dum2n"
when
		Item DebugSwitch4 received command ON
	then{	
		val String results = executeCommandLine("/etc/openhab2/scripts/StartFireTV.sh", 5000)
		Basement_Fans.sendCommand(ON)
		logInfo("dum2n", results)
}
end

I get this error in the log
2018-03-18 12:03:22.605 [INFO ] [eclipse.smarthome.model.script.dum2n] - cannot bind ‘local:5037’

  • daemon not running. starting it now on port 5037 *
    cannot bind ‘local:5037’

Any one have any idea what cause this problem?

rule "dum2n"
when
    Item DebugSwitch4 received command ON
then	
    val String results = executeCommandLine("/etc/openhab2/scripts/StartFireTV.sh", 5000)
    Basement_Fans.sendCommand(ON)
    logInfo("dum2n", results)
end
2 Likes

It looks like this error is coming from the StartFireTV.sh script instead of OpenHAB.
What is the output of the script when you run it manually?

[11:52:37] openhabian@openHABianPi:~$ /etc/openhab2/scripts/StartFireTV.sh
error: device not found
connected to 192.168.2.34:5555

However, it execute the script as it shall (it starts the fire-tv media player)

I updated the script, so it does not generate an error. I get a litle bit changed error in the log

2018-03-18 12:36:25.794 [INFO ] [eclipse.smarthome.model.script.dum2n] - ADB server didn’t ACK

  • failed to start daemon *
    error: cannot connect to daemon
    cannot bind ‘local:5037’
  • daemon not running. starting it now on port 5037 *
    cannot bind ‘local:5037’
    ADB server didn’t ACK
  • failed to start daemon *
    error: cannot connect to daemon
  • daemon not running. starting it now on port 5037 *
    cannot bind ‘local:5037’
    ADB server didn’t ACK
  • failed to start daemon *
    error: cannot connect to daemon
  • daemon not running. starting it now on port 5037 *

Is dum2n a rule or a script what you start?
What’s the file-name?

My guess is that there is a problem with the rights. I think OpenHAB somehow has less rights while executing the script compared to running it directly via command line.

dum2n = rule
/etc/openhab2/scripts/StartFireTV.sh= script

I set the rigths to the script by using
sudo chmod a+rx /etc/openhab2/scripts/StartFireTV.sh
although I do not know if this gives sufficient rights

sudo rm /tmp/5037
fixed the problem!