el_pedriyo
(el_pedriyo)
September 28, 2017, 11:04pm
1
Hi,
I am currently trying to send some data through the serial port to my arduino, but I do not know why it is currently don’t working. This is the code:
rule "Video Light"
when
Item camera_light changed
then
if(camera_light.state == 0){
sendCommand (Arduino , "light=OFF")
}
if(camera_light.state == 1){
sendCommand (Arduino , "light=ON")
}
end
On events.log I am only receiving this:
2017-09-29 00:49:35 - camera_light received command ON
2017-09-29 00:49:41 - camera_light received command OFF
And on openhab.log any error.
Do you know where can I see a log of the actions that openhab is making? Or how to solve my problem?
Thanks
rossko57
(Rossko57)
September 29, 2017, 12:43am
2
0 is not the same as ON, Your rule does nothing unless the state is 0 or 1, but your item only gets ON or OFF commands.
If your item is really a switch type it will only be ON or OFF, so you should alter your if() clauses to look for those states.
el_pedriyo
(el_pedriyo)
September 29, 2017, 6:09am
3
Ah,
And do you know how can I monitor the serial output to Arduino?
Thank you very much, I will try to see how it goes?
rossko57
(Rossko57)
September 29, 2017, 6:50pm
4
Well, I guess you would use a serial monitor - something lika an old laptop is useful for this kind of thing.
el_pedriyo
(el_pedriyo)
September 29, 2017, 7:37pm
5
Now I have tested it and it seems to work.
So then I guest that there is no log with the outputs and actions that openhab execute no?
rossko57
(Rossko57)
September 29, 2017, 8:20pm
6
Of course there is (but it cannot monitor what actually arrives at a serial device)
http://docs.openhab.org/administration/logging.html
Once you find the logs, you will also find the logInfo() really useful to put into your rules so that you can see progress etc.
el_pedriyo
(el_pedriyo)
September 29, 2017, 9:02pm
7
When I try to log to the console with:
ssh -p 8101 openhab@localhost
It tells me this:
ssh: connect to host localhost port 8101: Connection refused
I supose this is the log console which is described in the article you send me. Do you know why is this error reporting?
Thanks
el_pedriyo
(el_pedriyo)
September 29, 2017, 9:04pm
8
Also, I didn’t want to monitor what does arrive to the serial port, I just wanted to know what goes out by openhab
rossko57
(Rossko57)
September 29, 2017, 10:46pm
9
No idea. I use Windows hosts.
Over to others … ?
This looks relevant
I’m having issues connecting to Karaf console. Everything was working correctly in OH 2.1, but when I switched to snapshot I can no longer connect to Karaf console.
If I try ssh -p 8101 openhab@localhost, I get ssh: connect to host localhost port 8101: Connection refused.
I see from nmap localhost that port 8101 is not shown at all.
If I run /usr/share/openhab2/runtime/bin/client I get the following:
mkdir: cannot create directory â/usr/share/openhab2/userdata/tmpâ: No such file or directory …
rossko57
(Rossko57)
September 29, 2017, 10:56pm
10
Wait a minute here …
Are you running Openhab2 ? If you are still on OH1 that logging help page will not apply.
el_pedriyo
(el_pedriyo)
September 30, 2017, 3:42pm
11
Well I currently used this steps for installing it:
I do not know which version was it, but I assume that is was the lastest, althought maybe like you said it is not