Difference between revisions of "Sample configuration for beacons"

From AMTech WikiDocs
Jump to: navigation, search
(Created page with "* Using the thing type BLEbeaconsScanner * Create BLEBeaconsScanner instance, set properties related to the specific instance (Ex. scanEddystone) * Create M2mBridge instance *...")
 
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
== Requirements and required steps ==
 +
 +
=== Required thing types ===
 +
* amtechM2mBridge
 +
* BLEbeaconsScanner
 +
 +
=== As a creator define a service with actor(s) ===
 +
* Define and actor and name it.
 +
* Add to the actor policies to GET (read), POST (create) and/or PUT (edit) entities of the required types. In this case amtechM2mBridge and BLEbeaconsScanner.
 +
* Create an activity and name it.
 +
* Add the previously created actor to the activity.
 +
* Optionally add logic to the activity through new observers/reasoners/etc.
 +
* Publish the activity and in the process, share it with at least one follower tenant by using the property guesttenants. Now the admin of these tenants will have the possibility to subscribe to the generated service and invite new users to its own tenant using the actors defined by the service or a subset of them.
 +
 +
=== As follower admin ===
 +
* Subscribe to the service that the creator is offering.
 +
* Figure out the accesses you want to give to the bridge or bridges that will be configured based on this service and design a serie of invited followers (one for each bridge). Invite these new users (bridge users) to the tenant with the actors defined by the creator or a subset of them.
 +
 +
=== Design the bridges ===
 +
Still as follower admin (although this can also be done by the creator), start designing the bridge templates:
 +
* Create a new BLEbeaconsScanner instance and configure all its required properties.
 +
* Create an amtechM2mBridge instance.
 +
* Configure required properties and useful properties as:
 +
** Add the BLEbeaconsScanner instance to the bridge instances
 +
** Configure bridge error observation config:
 +
*** Topic should be configured as an existing root topic or a subtopic (at any level) of an existing root topic (creators can create new root topics if needed). For instance: /m2mBridge/example/errors where /m2mBridge is an existing topic.
 +
*** Configure producer. A placeholder substitution like #{thingId} may be useful as value for the producer.
 +
** Might be useful to configure the logger level to "debug" instead of the default value "error".
 +
** Do the [[Observation_production_config|observation production configuration part]].
 +
*** Add BLEbeaconsScanner to the list of things
 +
*** Go to its list of produced observations
 +
*** Add required observations like eddystoneScan, ibeaconScan, etc
 +
*** Configure topic and producer for this produced observations. Similar to the bridge error observation config:
 +
**** Add topic as root topic or subtopic of an existing root topic (creators can create new root topics if needed). Ex. /m2mBridge/example/eddystoneScannings or /m2mBridge/example/ibeaconScannings
 +
**** Configure the producer. Again, some placeholder substitution may be useful.
 +
** If configured as creator, share this bridge instance with the follower tenant so that invited users belonging to the list can clone it.
 +
* Validate the bridge (it should validate or otherwise you should have overlooked some of these steps)
 +
 +
===Observation production graph view===
 +
[[File:bridgeOPConfigView.png|950px||thumbnail|center| Graph view]]
 +
 +
=== As invited user to the follower tenant ===
 +
* Accept the invitation sent by the follower admin.
 +
* Configure the bridge with the DAP URL and your credentials in bridgeConfig.json
 +
* Set the configured bridge as the template.
 +
* Configure all the other required properties as templateId, bridgeIdPrefix, etc.
 +
* Run the bridge.
 +
 +
<!-- '''As creator'''
 
* Using the thing type BLEbeaconsScanner
 
* Using the thing type BLEbeaconsScanner
 
* Create BLEBeaconsScanner instance, set properties related to the specific instance (Ex. scanEddystone)
 
* Create BLEBeaconsScanner instance, set properties related to the specific instance (Ex. scanEddystone)
 
* Create M2mBridge instance
 
* Create M2mBridge instance
 +
**[[Observation_production_config|Configure Observation Production]]
 
* Add the BLEBeaconsScanner to the list of instances of the bridge
 
* Add the BLEBeaconsScanner to the list of instances of the bridge
 
* Configure actor to give access to the bridge and beacon
 
* Configure actor to give access to the bridge and beacon
* Define an activity & Configure Observation Production
+
* Define an activity & add the actor
 
* Publish activity
 
* Publish activity
 
* Subscribe follower to the generated service.  
 
* Subscribe follower to the generated service.  
* This is the userId to set at [[Edge_Configuration|bridgeConfig.json]]
+
* This is the userId to set at [[Edge_Configuration|bridgeConfig.json]] -->

Latest revision as of 12:12, 20 September 2017

Requirements and required steps

Required thing types

  • amtechM2mBridge
  • BLEbeaconsScanner

As a creator define a service with actor(s)

  • Define and actor and name it.
  • Add to the actor policies to GET (read), POST (create) and/or PUT (edit) entities of the required types. In this case amtechM2mBridge and BLEbeaconsScanner.
  • Create an activity and name it.
  • Add the previously created actor to the activity.
  • Optionally add logic to the activity through new observers/reasoners/etc.
  • Publish the activity and in the process, share it with at least one follower tenant by using the property guesttenants. Now the admin of these tenants will have the possibility to subscribe to the generated service and invite new users to its own tenant using the actors defined by the service or a subset of them.

As follower admin

  • Subscribe to the service that the creator is offering.
  • Figure out the accesses you want to give to the bridge or bridges that will be configured based on this service and design a serie of invited followers (one for each bridge). Invite these new users (bridge users) to the tenant with the actors defined by the creator or a subset of them.

Design the bridges

Still as follower admin (although this can also be done by the creator), start designing the bridge templates:

  • Create a new BLEbeaconsScanner instance and configure all its required properties.
  • Create an amtechM2mBridge instance.
  • Configure required properties and useful properties as:
    • Add the BLEbeaconsScanner instance to the bridge instances
    • Configure bridge error observation config:
      • Topic should be configured as an existing root topic or a subtopic (at any level) of an existing root topic (creators can create new root topics if needed). For instance: /m2mBridge/example/errors where /m2mBridge is an existing topic.
      • Configure producer. A placeholder substitution like #{thingId} may be useful as value for the producer.
    • Might be useful to configure the logger level to "debug" instead of the default value "error".
    • Do the observation production configuration part.
      • Add BLEbeaconsScanner to the list of things
      • Go to its list of produced observations
      • Add required observations like eddystoneScan, ibeaconScan, etc
      • Configure topic and producer for this produced observations. Similar to the bridge error observation config:
        • Add topic as root topic or subtopic of an existing root topic (creators can create new root topics if needed). Ex. /m2mBridge/example/eddystoneScannings or /m2mBridge/example/ibeaconScannings
        • Configure the producer. Again, some placeholder substitution may be useful.
    • If configured as creator, share this bridge instance with the follower tenant so that invited users belonging to the list can clone it.
  • Validate the bridge (it should validate or otherwise you should have overlooked some of these steps)

Observation production graph view

Graph view

As invited user to the follower tenant

  • Accept the invitation sent by the follower admin.
  • Configure the bridge with the DAP URL and your credentials in bridgeConfig.json
  • Set the configured bridge as the template.
  • Configure all the other required properties as templateId, bridgeIdPrefix, etc.
  • Run the bridge.