OpenHab Telnet

1,680 views
Skip to first unread message

kbd...@gmail.com

unread,
Mar 29, 2013, 3:48:36 AM3/29/13
to ope...@googlegroups.com
Hi

I am new to openhab. but it seems to be a fantastic and very promising platform. so thanks for all the efforts so far

as to the TCP protocol, I am using it to telnet into a control board. the command to turn on a relay is : 'Set Relay 1 ON' or 'Set Relay 1 OFF'

my question is 2 folds:
1- how to send the command string:  the documenttion mentions this example:
{ tcp=">[ON:192.168.0.1:3000:'Set Relay 1 ON'], >[OFF:192.168.0.1:3000:'Set Relay 1 OFF']" }

should i include the ' around the string or should " be used - or maybe none?!

2- i need to authenticate first. but if i set up the board to skip authentication, then i need to wait for a null to be received

openremote would allow something like: null|
'Set Relay 1 OFF'
which means: connect -> wait for null -> send
'Set Relay 1 OFF'

what is the best way to do it on open hab?

thanks
Message has been deleted

kbd...@gmail.com

unread,
Mar 29, 2013, 5:18:36 AM3/29/13
to ope...@googlegroups.com, kbd...@gmail.com
update:how do i verify that the tcpip addon was loaded?

khome

unread,
Mar 29, 2013, 9:17:18 AM3/29/13
to ope...@googlegroups.com, kbd...@gmail.com
in console press enter to get prompt >
then enter 
>ss tcp
openhab should ansver with some number, binding name and the word ACTIVE


пятница, 29 марта 2013 г., 13:18:36 UTC+4 пользователь kbd...@gmail.com написал:

kbd...@gmail.com

unread,
Mar 29, 2013, 2:27:03 PM3/29/13
to ope...@googlegroups.com, kbd...@gmail.com

kbd...@gmail.com

unread,
Mar 29, 2013, 2:28:39 PM3/29/13
to ope...@googlegroups.com, kbd...@gmail.com
thanks for the repl.

i get the following:

osgi> ss tcp
"Framework is launched."


id      State       Bundle



id, state and bundle are all empty.

any ideas?

thanks

Kai Kreuzer

unread,
Mar 29, 2013, 3:24:51 PM3/29/13
to ope...@googlegroups.com
Are you sure that you have copied the binding into the addons folder?

Regards,
Kai

--
You received this message because you are subscribed to the Google Groups "openhab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

kbd...@gmail.com

unread,
Mar 30, 2013, 1:56:24 AM3/30/13
to ope...@googlegroups.com
Yes. it it in the addons directory with the http binding:
ss http

"Framework is launched."


id      State       Bundle
26      RESOLVED    org.apache.commons.httpclient_3.1.0.v201012070820
35      RESOLVED    org.apache.httpcomponents.httpclient_4.1.0.v201103311320
36      RESOLVED    org.apache.httpcomponents.httpcore_4.1.0.v201101201700
74      STARTING    org.eclipse.ecf.provider.filetransfer.httpclient_4.0.200.v20120608-0148
                    Fragments=75
75      RESOLVED    org.eclipse.ecf.provider.filetransfer.httpclient.ssl_1.0.0.v20120608-0148
                    Master=74
99      RESOLVED    org.eclipse.equinox.http.registry_1.1.200.v20120522-2049
100     ACTIVE      org.eclipse.equinox.http.servlet_1.1.300.v20120522-1841
137     RESOLVED    org.eclipse.jetty.http_8.1.3.v20120522
143     ACTIVE      org.eclipse.jetty.osgi.httpservice_8.1.3.qualifier
osgi> 09:47:45.001 ERROR o.o.i.multimedia.actions.Audio[:205] - No TTS service available - tried to say: 9

osgi> ss tcp                            <============================

"Framework is launched."


id      State       Bundle


I followed the standard setp instructions. and I installed the demo, which is working fine. but seems that the system is not load tcp bundle

thanks

Kai Kreuzer

unread,
Mar 30, 2013, 3:51:23 AM3/30/13
to ope...@googlegroups.com
I do not even see the http binding in there - its name is org.openhab.binding.http.

If you do a "ss openhab.binding" you should see all installed bindings listed.
Note that the tcp binding is not part of the demo package - so you have to manually add it from the addons.zip.

Regards,
Kai

kbd...@gmail.com

unread,
Mar 30, 2013, 3:54:36 AM3/30/13
to ope...@googlegroups.com
this is the content of the addons directory:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\kbdeir>d:

D:\>cd openhab

D:\openhab>cd addons

D:\openhab\addons>dir
 Volume in drive D is ExtDisk
 Volume Serial Number is 1218-DC97

 Directory of D:\openhab\addons

03/30/2013  09:43 AM    <DIR>          .
03/30/2013  09:43 AM    <DIR>          ..
12/16/2012  06:52 PM            31,119 org.openhab.binding.http-1.1.0.jar
12/16/2012  06:52 PM            23,213 org.openhab.binding.ntp-1.1.0.jar
12/16/2012  06:54 PM            58,684 org.openhab.binding.tcp-1.1.0.jar
12/16/2012  06:56 PM         9,187,908 org.openhab.io.multimedia.tts.freetts.jar
12/16/2012  07:06 PM         2,352,519 org.openhab.persistence.db4o-1.1.0.jar
12/16/2012  07:07 PM            18,734 org.openhab.persistence.exec-1.1.0.jar
12/16/2012  07:06 PM            19,398 org.openhab.persistence.logging-1.1.0.jar
12/16/2012  07:07 PM           625,539 org.openhab.persistence.rrd4j-1.1.0.jar
               8 File(s)     12,317,114 bytes
               2 Dir(s)  452,735,598,592 bytes free

isn't org.openhab.binding.tcp-1.1.0.jar the right tcp binding jar?

it is already in the addons dir. and it was added from the addons.zip file

thanks

Kai Kreuzer

unread,
Mar 30, 2013, 3:58:29 AM3/30/13
to ope...@googlegroups.com
Yes, this looks ok.
Could you start openHAB in debug mode (start_debug.bat) and send the log file from the startup?

Regards,
Kai

kbd...@gmail.com

unread,
Mar 30, 2013, 4:00:37 AM3/30/13
to ope...@googlegroups.com
hmmm.

osgi> ss openhab.binding

"Framework is launched."


id      State       Bundle


clearly an ss openhab.binding returns nothing in my case. despite that the http & tcp packages are in the addons dir already.

so the problem seems to be not specific to the tcp bundle but is rather that openhab is not seing any bindings in the addons dir.

could it be a path issue on windows?


thanks



On Saturday, March 30, 2013 11:51:23 AM UTC+4, Kai wrote:

kbd...@gmail.com

unread,
Mar 30, 2013, 4:02:05 AM3/30/13
to ope...@googlegroups.com
thanks. sure i will. but ( sorry ia ma new to this ) which log file? in which dir?

thanks

Khodor Bdeir

unread,
Mar 30, 2013, 4:14:01 AM3/30/13
to ope...@googlegroups.com
STARTED IN DEBUG MODE

this is the extract from openhab.log in the logs directory - hope this is it?

12:10:31.532 INFO  o.o.c.internal.CoreActivator[:90]- openHAB runtime has been started (v1.1.0).
12:10:33.428 INFO  o.o.i.r.i.RESTApplication[:158]- Started REST API at /rest
12:10:33.430 INFO  o.o.i.s.i.DiscoveryServiceImpl[:63]- Registering new service _openhab-server._tcp.local. at port 8080
12:10:40.528 INFO  o.o.i.s.i.DiscoveryServiceImpl[:63]- Registering new service _openhab-server-ssl._tcp.local. at port 8443
12:10:41.952 INFO  o.o.m.c.i.f.FolderObserver[:163]- Loaded file 'demo.sitemap'
12:10:42.026 INFO  o.o.m.c.i.f.FolderObserver[:163]- Loaded file 'demo.script'
12:10:42.058 INFO  o.o.m.c.i.f.FolderObserver[:163]- Loaded file 'db4o.persist'
12:10:42.063 INFO  o.o.m.c.i.f.FolderObserver[:163]- Loaded file 'exec.persist'
12:10:42.068 INFO  o.o.m.c.i.f.FolderObserver[:163]- Loaded file 'logging.persist'
12:10:42.071 INFO  o.o.m.c.i.f.FolderObserver[:163]- Loaded file 'rrd4j.persist'
12:10:42.129 INFO  o.o.m.c.i.f.FolderObserver[:163]- Loaded file 'demo.items'
12:10:43.085 INFO  o.o.u.w.i.s.WebAppServlet[:99]- Started Classic UI at /openhab.app
12:10:52.492 ERROR o.o.i.multimedia.actions.Audio[:205]- No TTS service available - tried to say: Welcome at openHab!
12:10:52.843 WARN  o.o.c.p.e.PersistenceExtensions[:404]- There is no queryable persistence service registered with the name 'db4o'
12:10:52.845 ERROR o.o.m.r.i.engine.RuleEngine[:292]- Error during the execution of startup rule 'Update max and min temperatures': cannot invoke method public abstract org.openhab.core.types.State org.openhab.core.persistence.HistoricItem.getState() on null
12:10:52.845 INFO  o.o.m.c.i.f.FolderObserver[:163]- Loaded file 'demo.rules'
12:11:00.024 WARN  o.o.c.p.e.PersistenceExtensions[:404]- There is no queryable persistence service registered with the name 'db4o'
12:11:00.033 ERROR o.o.i.multimedia.actions.Audio[:205]- No TTS service available - tried to say: 1
12:11:15.001 ERROR o.o.i.multimedia.actions.Audio[:205]- No TTS service available - tried to say: 2
12:11:30.001 ERROR o.o.i.multimedia.actions.Audio[:205]- No TTS service available - tried to say: 3
12:11:45.001 ERROR o.o.i.multimedia.actions.Audio[:205]- No TTS service available - tried to say: 4


On Saturday, MarchI,


h 30, 2013 11:58:29 AM UTC+4, Kai wrote:

Kai Kreuzer

unread,
Mar 30, 2013, 4:52:59 AM3/30/13
to ope...@googlegroups.com
Thanks, this only shows that it indeed does not load anything from the addons folder :-(
This is very strange indeed. I could only imagine some access right or path problems.
Does it maybe work if you move your openHAB installation to the C: drive, e.g. into C:\Users\kbdeir?

Regards,
Kai

Khodor Bdeir

unread,
Mar 30, 2013, 7:16:41 AM3/30/13
to ope...@googlegroups.com
Sorry but same thing 
Does not work 

Thanks

          .
03/30/2013  09:43 AM   

Khodor Bdeir

unread,
Mar 30, 2013, 11:19:38 AM3/30/13
to ope...@googlegroups.com

I am sorry to report that it does not work even from a different directory

I am automating a villa. I am stuck between openhab and openremote

I am more keen to get openhab working. I think it is better especially the group functionality 
And the modularity.

In this case, I am getting the same problems on 2 pcs and a raspberry pi
They are all not working

So please, I really appreciate your help as I need to decide on one of them really soon

Thanks


To unsubscribe from this group and stop receiving emails from it, send an email to openhab+unsubscribe@googlegroups.com.

To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "openhab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab+unsubscribe@googlegroups.com.

Kai Kreuzer

unread,
Mar 30, 2013, 12:09:55 PM3/30/13
to ope...@googlegroups.com
Hi,

From my personal perspective, I would say that openHAB is definitely the better choice ;-). Although your current problem casts a damning light on it… I really haven't heard of such a problem so far.

Do I get you right that you experience the same problem on the RaspPi as well? So it is nothing related to Windows then.
May I ask you to try out the latest snapshot version from https://openhab.ci.cloudbees.com/job/openHAB/?

Another thing to check is if the Felix FileInstall bundles is running (as this is the one that observes the addons folder and dynamically adds the found bundles to the runtime). You can do so by typing "ss fileinstall" - it should show "ACTIVE".

Best regards,
Kai

Khodor Bdeir

unread,
Mar 30, 2013, 1:06:55 PM3/30/13
to ope...@googlegroups.com
Thanks for the reply.
it seems to be running now.  I ran the latest build snapshot as advised. I will now try to access my board through telnet and will let you know  how it goes.
this is the output from the console:
Launching the openHAB runtime...
osgi> 21:04:10.267 INFO  o.o.c.internal.CoreActivator[:92] - openHAB runtime has been started (v1.2.0).
BlueCove version 2.1.1-SNAPSHOT on winsock
21:04:12.498 INFO  o.o.i.r.i.RESTApplication[:158] - Started REST API at /rest
21:04:12.498 INFO  o.o.i.s.i.DiscoveryServiceImpl[:63] - Registering new service _openhab-server._tcp.local. at port 8080
21:04:12.685 ERROR OSGi[:98] - sql:driverClass : The SQL driver class is missing - please configure the sql:driverClass parameter in openhab.cfg
org.osgi.service.cm.ConfigurationException: sql:driverClass : The SQL driver class is missing - please configure the sql:driverClass parameter in openhab.cfg
        at org.openhab.persistence.sql.internal.SqlPersistenceService.updated(SqlPersistenceService.java:191)
21:04:19.580 INFO  o.o.i.s.i.DiscoveryServiceImpl[:63] - Registering new service _openhab-server-ssl._tcp.local. at port 8443
21:04:22.373 INFO  o.o.u.w.i.s.WebAppServlet[:99] - Started Classic UI at /openhab.app


osgi> ss tcp
"Framework is launched."


id      State       Bundle
229     ACTIVE      org.openhab.binding.tcp_1.2.0.201303292322
osgi>

Khodor Bdeir

unread,
Mar 30, 2013, 1:39:25 PM3/30/13
to ope...@googlegroups.com
Again,

Yhank you.

I am now able to control my boards.

I will let you know how the project goes.

Regards

Khodor Bdeir

unread,
Mar 30, 2013, 2:58:10 PM3/30/13
to ope...@googlegroups.com
Okay, so the connection is up running, thanks for that again, but I have one more question left:

After opening the connection and sending the command, I'm supposed to receive a reply from my board.

 I opened up a new string entry in the menu, and tried the direct approach through:
String reply "Status" (location in the menu)  { tcp="<[192.168.2.195:23]" } 

But that ended in failure so I tried the same thing but with inserting another command like so:
String reply "Status" (location in the menu)  { tcp=">[192.168.2.195:23:'RSts:1'], <[192.168.2.195:23]" } 

And that also failed so any ideas?


On Friday, March 29, 2013 11:48:36 AM UTC+4, Khodor Bdeir wrote:

Khodor Bdeir

unread,
Mar 31, 2013, 8:24:39 AM3/31/13
to ope...@googlegroups.com
Ok,I have been trying to query the status of the hardware for 6 hours now with no success.

I thought it will be simple. I any one has some reading material then it would be great. it seems the documentation is very minimal in this case.

the task is simple:
1-connect to the board through telnet : 192.168.2.195:23
send command:'RSts:1' to query the status of the first relay
the board answers by 'on' or 'off'

I have been strugling to determine the initial state of the relay. because the relay (or light) is not always controlled through openhab, its status may change as a result of someone turning it on manually. so the interface should query the hardware status frequently or at least once the interface is first launched.

any ideas, or reading material is much appreciated.

Thanks

elra...@gmail.com

unread,
Dec 25, 2013, 6:34:52 AM12/25/13
to ope...@googlegroups.com, kbd...@gmail.com
What Domotica are you using, looks like Easyplus?
Reply all
Reply to author
Forward
0 new messages