Node.js server to provide indoorLocation from Cisco CMX.
Works with socketIndoorLocationProvider libraries on iOS, Android and JS.
Node.js is required.
npm i
A configurator tool is provided to create the config file necessary to run the CMX Listener.
The config file contains the necessary information to project the coordinates received from CMX onto the Mapwize map.
Here are the steps to follow:
/api/config/v1/maps on your CMX instance. Save the output in a json file../configurator/configureFromMapwize.js -k [YOUR MAPWIZE API KEY] -v [MAPWIZE VENUE ID] -c [PATH TO CMX CONFIG FILE] -o [PATH TO OUTPUT]
NodeJS server to react on CMX notifications.
Each notification will be received and processed into an indorLocation object.
The computed indoorLocation will be saved in a redis database with the IP address as userId to be used by the emitter.
If enabled, the CMX notification can also be logged into an Azure Cosmos DB instance, mapped to a MongoDB collection, and/or into an Azure EventHub.
Thanks to redis, we will be notified each time a key value has been changed.
To do so, redis notifications have to be enabled with the command described below.
redis-cli config set notify-keyspace-events K$
config/all.js filemyservice.servicebus.windows.net)myeventhub)npm run start-listener
To correctly serialize the CMX configuration, one can execute the command described below:
export FLOORS_CONFIGURATION=$(node -e 'var json = require("FILEPATH"); console.log(JSON.stringify(json));')
If you want to put this variable into your clipboard instead, please execute the command below:
node -e 'var json = require("FILEPATH"); console.log(JSON.stringify(json));' | pbcopy
An example of a valid JSON CMX configuration can be found at cmx-listener/test/floors-configuration.json.
In your CMX dashboard, go to Manage/Notifications.
Create a notification with the following parameters:
You can use https://cmxlocationsandbox.cisco.com, with learning/learning as credentials, to test your service.
NodeJS server to react on socket indoor location providers.
Each socket connection will lead to a redis subscription that will help to only get the indoorLocation objects when the location of a user has been changed.
These objects will be sent to the providers via a socket channel.
config/all.js filenpm run start-emitter
Owner
Contributors
Categories
Programming Languages
JavaScriptLicense
Code Exchange Community
Get help, share code, and collaborate with other developers in the Code Exchange community.View Community