Skip to content

This app is intended to demonstrate finding of assets (e.g. wheelchair) in a hospital.

License

Notifications You must be signed in to change notification settings

soylentOrange/Assetfinder-tabris

Repository files navigation

Assetfinder

Project funding

General information

This app is intended to demonstrate finding of assets (e.g. wheelchair) in a hospital. It relies on a Bluetooth Mesh infrastructure running on Thingy 52 devices by Nordic Semi.

This app is developed by the Biomechanics Lab of the University Medical Center Schleswig-Holstein, Campus Luebeck.

The HealthCAT Project is supported by Interreg Germany-Danmark with funds from the European Regional Development Fund. Learn more about Interreg Germany-Danmark at www.interreg5a.eu.

Caveat

The mqtt-libraries (paho-mqtt and mqtt.js) work only in the iOS Developer app by tabris (v3.3.0).

Tabris.js

See further sections on how to get Tabris.js setup and running.

Tabris Setup

This section only applies when you want to start from scratch. More information is found at Tabris.js.

If you haven't done so already, install the Tabris CLI on your machine:

sudo npm i tabris-cli -g

Create an empty project folder:

mkdir Assetfinder

Change to this directory and initialize Tabris within this folder:

cd Assetfinder

sudo tabris init
  • Select Tabris.js Version 3.x (default).
  • Set an App name and App ID.
  • Select Vanilla for the Type of Project.
  • Optionally select an IDE integration.

To test that everything works as intended, forward to the Run section. You'll be rather bored... rocked!

Sidenote setup in MacOS Catalina

Make sure to have at least the Xcode Command Line Tools installed. See node-gyp Catalina notes for details.

Get bits and pieces into place

Assetfinder uses paho-mqtt, which is an MQTT browser-based client library written in Javascript that uses WebSockets to connect to an MQTT Broker. See the license terms for paho-mqtt. To integrate the library, simply install paho-mqtt via npm:

npm i paho-mqtt

Sidenote: I slightly modified the paho-mqtt.js because it gave me errors in Tabris.js:

// in line 819
if(localStorage.length > 0) {
  for (var i = 0; i < localStorage.length; i++)
    if (   localStorage.key(i).indexOf("Sent:"+this._localKey) === 0 || localStorage.key(i).indexOf("Received:"+this._localKey) === 0)
      this.restore(key);
}

Copy the modified paho-mqtt.js-file into the apps's src directory.

Remove paho-mqtt from the dependencies-section of the "package.json" in the project directory (as you are now using the local file). The paho-mqtt is required in the app.js as:

var Paho = require('./paho-mqtt');

Works only for ios......

Now, add some meaningful code to the app.js to test drive the mqtt-connection...

Run

If you haven't done so already, install the Tabris CLI on your machine:

sudo npm i tabris-cli -g

Then in the project directory, type:

npm start

This will start a Tabris.js code server at a free port and print its URL to the console. The app code can then be side-loaded in the developer app by entering that URL.

Build

The app can be built using the online build service at tabrisjs.com or locally using Tabris.js CLI.

See Building a Tabris.js App for more information.

About

This app is intended to demonstrate finding of assets (e.g. wheelchair) in a hospital.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published