{"id":18330373,"url":"https://github.com/mbientlab/metabase-hub","last_synced_at":"2025-10-03T19:29:14.033Z","repository":{"id":81787903,"uuid":"368698461","full_name":"mbientlab/MetaBase-Hub","owner":"mbientlab","description":"MetaWear Javascript SDK - MetaBase App Source Code","archived":false,"fork":false,"pushed_at":"2021-06-23T16:27:18.000Z","size":79,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-15T10:32:52.900Z","etag":null,"topics":["graphs","metabase","sensors","stream-data"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mbientlab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-19T00:14:28.000Z","updated_at":"2022-06-01T08:08:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"ea59ba39-cd12-494b-9cfd-d70cfad19122","html_url":"https://github.com/mbientlab/MetaBase-Hub","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbientlab%2FMetaBase-Hub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbientlab%2FMetaBase-Hub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbientlab%2FMetaBase-Hub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbientlab%2FMetaBase-Hub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbientlab","download_url":"https://codeload.github.com/mbientlab/MetaBase-Hub/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248080328,"owners_count":21044483,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graphs","metabase","sensors","stream-data"],"created_at":"2024-11-05T19:22:16.005Z","updated_at":"2025-10-03T19:29:13.940Z","avatar_url":"https://github.com/mbientlab.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MetaBase App for MetaHub (in Javascript) by MBIENTLAB\nMetaBase configures [MetaSensor](https://mbientlab.com/store/) boards to stream data to your MetaHub.  \n\n[![Platforms](https://img.shields.io/badge/platform-linux%20-lightgrey?style=flat)](https://github.com/mbientlab/MetaBase-Hub)\n[![License](https://img.shields.io/cocoapods/l/MetaWear.svg?style=flat)](https://github.com/mbientlab/MetaBase-Hub)\n[![Version](https://img.shields.io/badge/node-%3D%208.17.0-brightgreen?style=flat)](https://github.com/mbientlab/MetaBase-Hub)\n\n# Config File\nThe primary way to configure the application is with a JSON config file which is passed to the app via the ``--config`` options.  Your config file must have at minimum the devices \nand sensors defined.\n\n```bash\nsudo npm start -- --config metabase-config.json\n```\n\n## Commands\nThe first config option to set is the ``command`` key which controls what the app will do.  You can choose from the following actions:  \n\nAction   | Description\n---------|------------------------------------------------------------------------------------\nstream   | Stream data realtime to the host device, also graphs the data live\nlog      | Records data to the on-board flash memory, can download later with any MetaBase app\ndownload | Retrieves the data from any board setup to record data with a MetaBase app  \n\n```json\n{\n  \"command\": \"stream\"\n}\n```\n\n## Devices\nThe ``devices`` key is an array that holds the mac addresses of the devices to use.  The array elements can either be a MAC address string or an object containing both the MAC \naddress string and a user defined name identifying the device.\n\n```json\n{\n  \"devices\": [        \n    \"D4:5E:82:E1:15:01\",\n    {\"mac\": \"D5:7B:B9:7D:CE:0E\", \"name\": \"Demo Unit\"}\n  ]\n}\n```\n\nIn the above example, the ``D4:5E:82:E1:15:01`` mac address will have a default name assigned to it whereas the ``D5:7B:B9:7D:CE:0E`` will be referred to as \"Demo Unit\" in both  \nthe UI window and MetaCloud\n\n## Sensors\nThe ``sensors`` key is an object that the app uses the configure and enable the various on-board  sensors.  Its keys are the names of the enabled sensors and the values contain the sensor \nconfiguration.  \n\nEach sensors have their own configurable parameters, detailed in the below table:\n\nName                | Parameters                  | Example\n--------------------|-----------------------------|-----------------------------------------\nAccelerometer       | ``odr``, ``range``          | { \"odr\" : 100.0, \"range\": 2.0 }\nGyroscope           | ``odr``, ``range``          | { \"odr\" : 25.0, \"range\": 250.0 }\nMagnetometer        | ``odr``                     | { \"odr\" : 25.0 }\nQuaternion          | ``accRange``, ``gyroRange`` | { \"accRange\": 2.0, \"gyroRange\": 250.0 }\nEuler Angles        | ``accRange``, ``gyroRange`` | { \"accRange\": 4.0, \"gyroRange\": 500.0 }\nLinear Acceleration | ``accRange``, ``gyroRange`` | { \"accRange\": 8.0, \"gyroRange\": 1000.0 }\nGravity             | ``accRange``, ``gyroRange`` | { \"accRange\": 16.0, \"gyroRange\": 2000.0 }\nAmbient Light       | ``odr``, ``gain``           | { \"odr\": 10.0, gain: 4 }\nPressure            | ``odr``                     | { \"odr\": 1.96 }\nTemperature         | ``period``                  | { \"period\": 1800 }\nHumidity            | ``period``                  | { \"period\": 3600 }\n\nFor example, to sample accelerometer (+/-4g @ 100Hz), gyro (+/-1000 deg/s @ 100Hz), and mag data (25Hz):  \n\n```json\n{\n    \"sensors\": {\n        \"Accelerometer\": {\"odr\" : 100.0, \"range\": 4.0},\n        \"Gyroscope\": {\"odr\" : 100.0, \"range\": 1000.0},\n        \"Magnetometer\": {\"odr\" : 25.0}\n    }\n}\n```\n\nFor all sensors, the ``odr`` or ``period`` parameter must be set if applicable.  The app will select default values for the other parameters if not set by the user, and in the case where invalid \nvalues are selected, the closest valid value will be used instead.\n\n### Units\nSampling frequency values are expressed in ``Hz`` except for temperature and humidity which express them in ``seconds``.  For example, the previous JSON snippet will set the \nsensors to sample at 100.0Hz, 100.0Hz, and 25.0Hz respectively.  However, the below JSON snippet will sample temperature and humidity at 30min and 1hr respectively (1800s / 3600s):  \n\n```json\n{\n    \"sensors\": {\n        \"Temperature\": {\"period\" : 1800.0 },\n        \"Humidity\": {\"period\" : 3600.0 }\n    }\n}\n```\n\nNote that the ``period`` key is used in lieu of ``odr``.\n\n## Resolution\nThe ``resolution`` key is optional and sets the windows' width and height for the real time graphs.  If not set, the application will automatically create windows 1/4th the \nscreen resolution.\n\n```json\n{\n    \"resolution\": {\n        \"width\": 960,\n        \"height\": 540\n    }\n}\n```\n\n# Command Line Options\nAll settings in the config file have equivalent command line options.  The ``--devices`` and ``--sensors`` flags are require and can be repeated for multiple devices and sensors respectively.  \nAll other flags are optional.\n\nThe table below maps JSON keys to their matching option:\n\n| JSON Key   | Command Line                 | Required |\n|------------|------------------------------|----------|\n| command    | --command                    | N        |\n| devices    | --device                     | Y        |\n| sensors    | --sensor                     | Y        |\n| resolution | --width, --height            | N        |\n\nThe JSON configuration from the previous section can equivalently expressed in the command line as follows:\n\n```bash\nsudo npm start -- --device D4:5E:82:E1:15:01 --device \"D5:7B:B9:7D:CE:0E=Demo Unit\" \\\n    --sensor Accelerometer='{\"odr\" : 100.0, \"range\": 4.0}' \\\n    --sensor Gyroscope='{\"odr\" : 100.0, \"range\": 1000.0}' \\\n    --sensor Magnetometer='{\"odr\" : 25.0}' \\\n    --width 960 --height 540 \\\n    --command stream\n```\n\n## Disable RealTime Graph\nBy default, the app will create a window for each connected board and graph the data in real time, one graph per stream.  The realtime graphs can consume a lot of resources \nso users can disable it by passing in the ``--no-graph`` option in the command line.\n\n```bash\nsudo npm start -- --config metabase-config.json --no--graph\n```\n\nThis graph is only available when streaming the data.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbientlab%2Fmetabase-hub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbientlab%2Fmetabase-hub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbientlab%2Fmetabase-hub/lists"}