Diethelm, There's more than one way to achieve this. It really depends on the architecture you'd prefer to employ.
> In old days (IoTivity) it was possible to have one server (in one surrounding > application) that starts several devices. Is that possible with IoTivity lite > too? By "surrounding application", are you suggesting a separate application that spawns off specific processes as and when? You can do that with IoTivity-Lite servers too. > If not: I started two servers (one and the copy of the executable from the > first). > When I onboarded the first one successfully onboarding of the second failed. This could've been because both were pointing at the same storage path (i.e. the path supplied to oc_storage_config())? That's the path where all state (credentials, etc.) are persisted. > - is it possible to start two or more servers within one application ? The multi-device server which George cited lets you set up and run multiple virtual servers within a single application process. Each virtual server would have its own set of endpoints/ports. > - How to organise credentials in that case (persistence, etc...) When using a multi-device server, all state is automatically organized by the stack and indexed by virtual server. (For e.g., acl_0 is ACL for the 0th server, acl_1 for the 1st server, etc.). They're also loaded back appropriately into the contexts of each virtual server following a power cycle. > In general there might be the question: > If a server application provides two or more devices: then it can only manage > ONE > credential folder / file ? Is that the design goal? The (oc_storage_config()) folder is one per application process, and state is dumped into separate files and managed by the stack. Thanks, -Kishen. -- Kishen Maloor Intel Corporation From: <iotivity-dev@lists.iotivity.org> on behalf of George Nash <george.n...@intel.com> Date: Tuesday, December 3, 2019 at 2:18 PM To: "Prof. Dr.-Ing. Diethelm Bienhaus" <diethelm.bienh...@mni.thm.de>, Clarke Stevens <clarke.stev...@sjrb.ca> Cc: "iotivity-dev@lists.iotivity.org" <iotivity-dev@lists.iotivity.org>, Sören Fink <soeren.f...@mni.thm.de>, "thorsten.e...@gmx.de" <thorsten.e...@gmx.de> Subject: Re: [dev] IoTivity lite question I am no sure about the OTGC but when I use the onboarding_tool that ships with iotivity-lite I see two device names `My fridge` and `My thermostat`. With two distinct device ids. We may need to file a bug against the OTCG for this issue. Has anyone tried OTGC with against a multiple device sample? Onboarding must be performed for both devices. With IoTivity-classic all security information was written to a single file. With IoTivity-lite the security information is encoded across multiple files. Feel free to open up the folder specified in oc_storage_config(…) you will find many files ( acl_#, cred_#, doxm_#, keypair_#, pstat_# ) Like IoTivity-classic these files are cbor encoded. If you are using cloud, introspection, or the update api’s you may find additional files. All files written to persistent storage by the iotivity-lite stack will only go to the location specified by oc_storage_config. The number appended to the end of the file name is the device that file is associated with. Device numbering starts with zero `0`. George From: Prof. Dr.-Ing. Diethelm Bienhaus <diethelm.bienh...@mni.thm.de> Sent: Tuesday, December 3, 2019 12:51 PM To: Clarke Stevens <clarke.stev...@sjrb.ca>; Nash, George <george.n...@intel.com> Cc: iotivity-dev@lists.iotivity.org; Sören Fink <soeren.f...@mni.thm.de>; thorsten.e...@gmx.de Subject: Re: [dev] IoTivity lite question Dear Clarke, dear George, many thanks for your quick responses. I'm working in a project with the company BSC which is pushing the EnOcean spec. We are preparing some hardware and a gateway for the interop meeting next week. I really like the R Pi example. I started some time ago with Rami's example "IoTivity Development on Raspberry Pi* 3" I think we will start a server providing ONE device with one to several resources representing a single EnOcean sensors. What do you think? One more question - hopefully I will not bother ;-) - since I have been not involved in the iotivity lite topic for a longer time. At the beginning of the security stuff there were cbor files stored holding the credentials. Nowadays there are commands like oc_storage_config("./devicebuilderserver_creds"); oc_storage_config("./devicebuilderserver_creds"); But it seems that e.g. ./devicebuilderserver_creds is displayed as a folder not a file. Maybe there is a trick behind that ... @George: I just tried the multi_device_server_linux.c The OTGC app displays two devices - unfortunately with the same name "My fridge" Having onboarded the first device an onboarding of the second device failed. Was that example tested with the OTGC app and security? In general there might be the question: If a server application provides two or more devices: then it can only manage ONE credential folder / file ? Is that the design goal? Best regards, Diethelm Am 03.12.2019 um 20:53 schrieb Clarke Stevens: Diethelm, From your example, I think you may just be building a basic OCF device with multiple resources (resources in OCF are fairly atomic and devices contain multiple resources). You might want to look at the Raspberry Pi examples here that have multiple resources on daughter boards. I particularly like the Explorer Hat Pro example because it has both sensors and actuators and there is a nice tutorial (enclosed). Also, the EnOcean bridge specification should be available soon. In the mean time, you can see what a bridge looks like with several other protocols (ZigBee, Z-Wave, U+, oneM2M, AllJoyn and Bluetooth). https://github.com/openconnectivity/Sample-Raspberry-Pi-Code If you actually do need a Device to contain other devices, you can do that, but it is not as simple. Thanks, -Clarke On Dec 3, 2019, at 12:11 PM, Prof. Dr.-Ing. Diethelm Bienhaus <diethelm.bienh...@mni.thm.de<mailto:diethelm.bienh...@mni.thm.de>> wrote: Hi all, we are building a gateway for EnOcean sensors. The goal is to have a device for each physical device like a button or a sensor. There are EnOcean sensors with e.g. three measurement points like combined temperature / illuminance / presence. So we want to provide several devices (with one to n resources) from our gateway application. In old days (IoTivity) it was possible to have one server (in one surrounding application) that starts several devices. Is that possible with IoTivity lite too? If so: could some one send me e.g. a link to an example? Many thanks in advance. Best regards, Diethelm -------- Weitergeleitete Nachricht -------- Betreff: RE: IoTivity lite question Datum: Tue, 3 Dec 2019 18:49:40 +0000 Von: Rami Alshafi <ralsh...@vtmgroup.com><mailto:ralsh...@vtmgroup.com> An: Prof. Dr.-Ing. Diethelm Bienhaus <diethelm.bienh...@mni.thm.de><mailto:diethelm.bienh...@mni.thm.de> Hi, Yes, I believe it is possible to be accomplished with IoTivity-lite. I do not know for sure but no one complained about it being an issue at all and I work with many developers. Your best bet is to send out your question to the IoTivity developer mailing list (iotivity-dev@lists.iotivity.org<mailto:iotivity-dev@lists.iotivity.org>) and one of the developers will likely respond. The holidays in the US are coming up so maybe responses will be slower. Thanks, -Rami From: Prof. Dr.-Ing. Diethelm Bienhaus [mailto:diethelm.bienh...@mni.thm.de] Sent: Tuesday, December 3, 2019 8:17 AM To: Rami Alshafi <ralsh...@vtmgroup.com><mailto:ralsh...@vtmgroup.com> Subject: IoTivity lite question Hi Rami, hopefully you can help us (or push forward our problem): Using the nice development process (gen.sh -> build.sh -> run.sh) we could generate a server with the desired resources. OCF Server name : "server_lite_5821" Intialize Secure Resources Register Resource with local path "/humidity" number of Resource Types: 1 Resource Type: "oic.r.humidity" Default OCF Interface: "oic.if.a" Register Resource with local path "/keycardswitch" number of Resource Types: 1 Resource Type: "oic.r.keycardswitch" Default OCF Interface: "oic.if.a" Register Resource with local path "/rockerbutton" number of Resource Types: 1 Resource Type: "oic.r.button" Default OCF Interface: "oic.if.a" Register Resource with local path "/sensor_contact" number of Resource Types: 1 Resource Type: "oic.r.sensor.contact" Default OCF Interface: "oic.if.a" Register Resource with local path "/sensor_presence" number of Resource Types: 1 Resource Type: "oic.r.sensor.presence" Default OCF Interface: "oic.if.a" Register Resource with local path "/temperature" number of Resource Types: 1 Resource Type: "oic.r.temperature" Default OCF Interface: "oic.if.a" Successfully installed PKI certificate Successfully installed intermediate CA certificate Successfully installed root certificate OCF server "server_lite_5821" running, waiting on incoming connections. The goal is to have a device for each physical device like a button or a sensor. There are EnOcean sensors with e.g. three measurement points: Light, Temperature and Occupancy Sensor (A5-08-XX) Temperature value Temp Unit (by spec Temp Range (by TYPE spec) Illumination value Illumination range (by type spec) Occupancy oic.r.temperature oic.r.sensor.illuminance oic.r.sensor.presence oic.d.sensor Generic Sensor So we want to provide several devices (with one to n resources) from our gateway application. In old days (IoTivity) it was possible to have one server (in one surrounding application) that starts several devices. Is that possible with IoTivity lite too? If not: I started two servers (one and the copy of the executable from the first). When I onboarded the first one successfully onboarding of the second failed. Our questions: - is it possible to start two or more servers within one application ? - How to organise credentials in that case (persistence, etc...) Many thanks in advance, Diethelm -- ---------------------------------------------------------- Prof. Dr.-Ing. Dipl.-Wirt. Ing. Diethelm Bienhaus Fachgebiet Informatik mit Schwerpunkt Ingenieur-lnformatik Fachbereich Mathematik, Naturwissenschaften und Informatik Technische Hochschule Mittelhessen Wiesenstr. 14 - D-35390 Gießen -- ---------------------------------------------------------- Prof. Dr.-Ing. Dipl.-Wirt. Ing. Diethelm Bienhaus Fachgebiet Informatik mit Schwerpunkt Ingenieur-lnformatik Fachbereich Mathematik, Naturwissenschaften und Informatik Technische Hochschule Mittelhessen Wiesenstr. 14 - D-35390 Gießen -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#10310): https://lists.iotivity.org/g/iotivity-dev/message/10310 Mute This Topic: https://lists.iotivity.org/mt/65853266/21656 Group Owner: iotivity-dev+ow...@lists.iotivity.org Unsubscribe: https://lists.iotivity.org/g/iotivity-dev/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-