Open 130s opened 7 years ago
It should definitely allow them to be on different hosts and that would probably be the normal case.
Let me rephrase. Do you expect any ROS-related service running on OpenHAB side? Using a running OpenHAB2 server that I recently installed:
http://%IOTSERVER_IPADDR%:8080/rest/items/
seems to return some meaningful values. There's no text "ROS" found in the output.http://%IOTSERVER_IPADDR%:8080/rest/items/ROS
returns "404 Item ROS does not exist!
".This made me wonder if this package currently requires a special OpenHAB module (binding? I'm not sure the right term for that) to be running on OpenHAB server side.
I think figured out by myself. I think the code referred to in my first post assumes that there's a OpenHAB Group called "ROS" existent on OpenHAB server (I think that portion of code is taken from Samples REST).
I'll try to think of a way to handle both cases (with and without ROS Group
).
When you set up items in OpenHab (light switches, etc) you can put them in an arbitrary number of groups. For the iot_bridge, you place the items you want to report to ROS in the group "ROS". This allows you to have a number of IoT items being controlled by OpenHAB but only have some of them report status to ROS.
Thanks for the input. I'll try to set up "ROS
" group to see how that works.
While I can see that there are situations where grouping for ROS is convenient, setting up something specific to ROS on OpenHAB
's would limit usecases; some users (like me) might not want to set anything related to ROS on IoT side. As I implied in https://github.com/corb555/iot_bridge/issues/5#issuecomment-309923957, I'll think of way that covers both needs and open a pull request.
Thanks for the input. I'll try to set up "ROS" group to see how that works.
After having created ROS
group on openHAB, though, running script, which tries to access http://my_ohserver:8080/rest/items/ROS_status/state, leads to 404.
This line requests ROS_status
.
Is *_status
supposed to be set by openHAB automatically (if this is the case I still need learn openHAB)?
Modifying code to remove _status
still doesn't work; http://my_ohserver:8080/rest/items/ROS/state leads to "bad request". Opening that page results in "NULL".
On OH1, it should be: /rest/items/ROS. I used the documentation from here:
https://github.com/openhab/openhab1-addons/wiki/Samples-REST
This line with 'GROUP_NAME = "ROS"', the request URL always becomes
http://%IOTSERVER_IPADDR%:8080/rest/items/ROS
, which meansROS
is assumed to be running on the IoT (e.g. OpenHAB) server side. I don't know if that's what we always want.