Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ohNet suitable for a project?
30-07-2013, 08:03 PM
Post: #1
ohNet suitable for a project?
Hello,
I just wanna know if the following project is realizable with the ohNet libraries:
In a local network there are seceral devices (embedded linux, c++) which should be automatically be found (discovered) by an android smartphone (controlpoint). After several devices were found it should be possible to "pair" the smartphone with one of the other devices. Then it should be possible to send several control commands and data from the smartphone to the device and vice versa.

As far as i've read through the documentation of ohNet, this library should be the perfect fit for this kind of task.
So, my question is: is ohNet the right choice for this project? Or do you see any problems an recommend any other approaches?

regards
Find all posts by this user
31-07-2013, 07:46 AM
Post: #2
RE: ohNet suitable for a project?
ohNet should be well suited for your project. I'm not aware of other libraries that could be easily deployed to both Android and embedded linux.
Find all posts by this user
31-07-2013, 03:56 PM (This post was last modified: 31-07-2013 04:03 PM by lion87.)
Post: #3
RE: ohNet suitable for a project?
Thank you, I am just starting to take a closer look at ohNet and maybe this question is kind of odd, but: Do i need to use ohNet on both sides, the device side and the control point side? Or can i use ohNet on the devices in order to add upnp functionality to my devices, and one could write a control point without using ohNet at all?

I am asking this, because later i want to to provide other developers the possibility to write own code to discover and control the devices.
Find all posts by this user
31-07-2013, 04:02 PM
Post: #4
RE: ohNet suitable for a project?
(31-07-2013 03:56 PM)lion87 Wrote:  Thank you, I am just starting to take a closer look at ohNet and maybe this question is kind of odd, but: Do i need to use ohNet on both sides, the device side and the control point side? Or can i use ohNet on the devices in order to add upnp functionality to my devices, and one could write a control point without using ohNet at all?

You can use any combination of ohNet and other UPnP stacks that you like.
  • ohNet for devices; other for control point
  • other for devices; ohNet for control point
  • ohNet for devices; ohNet for control point
will all be fine. Always assuming you choose a robust stack for "other" anyway Smile
Find all posts by this user
01-08-2013, 08:54 AM
Post: #5
RE: ohNet suitable for a project?
I have some more questions:

Since upnp also uses SOAP for communication, is it also possible to somehow generate a WSDL out of the UPNP descriptions in ohNet to control devices remotely from the internet?

How would you realize an "authentification" mechanism so that only trusted controlpoints can communicate with the devices after descovery?

regards
Find all posts by this user
01-08-2013, 05:28 PM
Post: #6
RE: ohNet suitable for a project?
(01-08-2013 08:54 AM)lion87 Wrote:  Since upnp also uses SOAP for communication, is it also possible to somehow generate a WSDL out of the UPNP descriptions in ohNet to control devices remotely from the internet?

I imagine this would be possible but it won't be entirely straightforward. I suspect that won't even be your biggest problem. Multicast UDP discovery won't be possible over the internet. Even after you know the address of a device, most routers block incoming TCP connections by default.

You'll either need to run your own server which proxies connections between remote control points and UPnP devices or figure out how to allow incoming connections across a variety of different networks.

(01-08-2013 08:54 AM)lion87 Wrote:  How would you realize an "authentification" mechanism so that only trusted controlpoints can communicate with the devices after descovery?

All action invocation and evented updates with UPnP is sent in plain text. If this is an issue for you, UPnP probably isn't suitable for device control; you could consider writing a simple HTTP server and communicating via HTTPS.

If you just need a veneer of security, you could design a service with an authentication action which returns a token that all other actions take as an input argument.
Find all posts by this user
11-10-2013, 08:04 AM
Post: #7
RE: ohNet suitable for a project?
(11-10-2013 04:40 AM)blackrose Wrote:  How would you realize an "authentification" mechanism so that only trusted controlpoints can communicate with the devices after descovery?

As I mentioned in my previous post, a basic mechanism could involve control points calling a 'logon' action which takes a password as an input argument and returns a token (integer or string could work here). All actions you wanted to secure would take this token as an input argument. The UPnP device would store a list of valid tokens and would reject action invocations that did not include one.

As described before, this is still insecure. All network communication will be unencrypted so anyone with access to the network could obtain a copy of your password.

If you want proper security (i.e. you suspect at least some people with access to your network are potentially malicious), you probably shouldn't be using UPnP.
Find all posts by this user


Forum Jump: