{"analyzedAt":"2023-01-15T00:49:58.553Z","collected":{"metadata":{"name":"barnowl-minew","scope":"unscoped","version":"1.2.0","description":"Collect and process ambient Bluetooth Low Energy packets from Minew gateways for real-time location and sensing.  We believe in an open Internet of Things.","keywords":["reelyActive","barnowl","Minew","Minew G1","Minew G2","Minew MG3","Minew MG4","raddec"],"date":"2023-01-14T01:02:37.097Z","author":{"name":"reelyActive","email":"webdev@reelyactive.com"},"publisher":{"username":"reelyactive","email":"infra@reelyactive.com"},"maintainers":[{"username":"reelyactive","email":"infra@reelyactive.com"}],"contributors":[{"name":"Jeffrey Dungen"}],"repository":{"type":"git","url":"git+https://github.com/reelyactive/barnowl-minew.git"},"links":{"npm":"https://www.npmjs.com/package/barnowl-minew","homepage":"https://github.com/reelyactive/barnowl-minew/","repository":"https://github.com/reelyactive/barnowl-minew","bugs":"https://github.com/reelyactive/barnowl-minew/issues"},"license":"MIT","dependencies":{"advlib-identifier":">=0.1.0","raddec":">=0.4.3"},"releases":[{"from":"2022-12-16T00:00:00.000Z","to":"2023-01-15T00:00:00.000Z","count":2},{"from":"2022-10-17T00:00:00.000Z","to":"2023-01-15T00:00:00.000Z","count":2},{"from":"2022-07-19T00:00:00.000Z","to":"2023-01-15T00:00:00.000Z","count":3},{"from":"2022-01-15T00:00:00.000Z","to":"2023-01-15T00:00:00.000Z","count":5},{"from":"2021-01-15T00:00:00.000Z","to":"2023-01-15T00:00:00.000Z","count":5}],"readme":"barnowl-minew\n=============\n\n__barnowl-minew__ converts the decodings of _any_ ambient Bluetooth Low Energy devices by [Minew](https://www.minew.com/) G1, G2, MG3 and MG4 gateways into standard developer-friendly JSON that is vendor/technology/application-agnostic.\n\n![Overview of barnowl-minew](https://reelyactive.github.io/barnowl-minew/images/overview.png)\n\n__barnowl-minew__ is a lightweight [Node.js package](https://www.npmjs.com/package/barnowl-minew) that can run on resource-constrained edge devices as well as on powerful cloud servers and anything in between.  It is included in reelyActive's [Pareto Anywhere](https://www.reelyactive.com/pareto/anywhere/) open source middleware suite, and can just as easily be run standalone behind a [barnowl](https://github.com/reelyactive/barnowl) instance, as detailed in the code examples below.\n\n\nGetting Started\n---------------\n\nFollow our step-by-step tutorials to get started with __barnowl-minew__ or __Pareto Anywhere__ using a _specific_ Minew gateway:\n- [Configure a Minew G1 Gateway](https://reelyactive.github.io/diy/minew-g1-config/)\n\nLearn \"owl\" about the __raddec__ JSON data output:\n-  [reelyActive Developer's Cheatsheet](https://reelyactive.github.io/diy/cheatsheet/)\n\n\nQuick Start\n-----------\n\nClone this repository, install package dependencies with `npm install`, and then from the root folder run at any time:\n\n    npm start\n\n__barnowl-minew__ will indiscriminately accept HTTP POSTs on localhost:3001/minew and output (flattened) __raddec__ JSON to the console.  The following Minew data formats are currently supported:\n- BINARY-LONG (recommmended)\n- MINEW-CONNECT\n- JSON-LONG\n- JSON-RAW\n\n\nHello barnowl-minew!\n--------------------\n\nDeveloping an application directly from __barnowl-minew__?  Start by pasting the code below into a file called server.js:\n\n```javascript\nconst Barnowl = require('barnowl');\nconst BarnowlMinew = require('barnowl-minew');\n\nlet barnowl = new Barnowl({ enableMixing: true });\n\nbarnowl.addListener(BarnowlMinew, {}, BarnowlMinew.TestListener, {});\n\nbarnowl.on('raddec', (raddec) => {\n  console.log(raddec);\n  // Trigger your application logic here\n});\n```\n\nFrom the same folder as the server.js file, install package dependencies with the commands `npm install barnowl-minew` and `npm install barnowl`.  Then run the code with the command `node server.js` and observe the _simulated_ data stream of radio decodings (raddec objects) output to the console:\n\n```javascript\n{\n  transmitterId: \"fee150bada55\",\n  transmitterIdType: 2,\n  rssiSignature: [\n    {\n      receiverId: \"ac233fffffff\",\n      receiverIdType: 2,\n      rssi: -77,\n      numberOfDecodings: 1\n    }\n  ],\n  packets: [ '001a55daba50e1fe0201060303e1ff1216e1ffa1034affe7004500fa55daba50e1fe' ],\n  timestamp: 1645568542222\n}\n```\n\nSee the [Supported Listener Interfaces](#supported-listener-interfaces) below to adapt the code to listen for your gateway(s).\n\n\nSupported Listener Interfaces\n-----------------------------\n\nThe following listener interfaces are supported by __barnowl-minew__.  Extend the [Hello barnowl-minew!](#hello-barnowl-minew) example above by pasting in any of the code snippets below.\n\n### HTTP\n\nThe _recommended_ implementation is using [express](https://expressjs.com/) as follows:\n\n```javascript\nconst express = require('express');\nconst http = require('http');\n\nlet app = express();\nlet server = http.createServer(app);\nserver.listen(3001, function() { console.log('Listening on port 3001'); });\n\nlet options = { app: app, express: express, route: \"/minew\",\n                isPreOctetStream: false }; // Set true for G1 firmware v2/3\nbarnowl.addListener(BarnowlMinew, {}, BarnowlMinew.HttpListener, options);\n```\n\nNonetheless, for testing purposes, __barnowl-minew__ can also create a minimal HTTP server as an alternative to express, and attempt to handle any POST it receives:\n\n```javascript\nbarnowl.addListener(BarnowlMinew, {}, BarnowlMinew.HttpListener, { port: 3001 });\n```\n\n### Test\n\nProvides a steady stream of simulated Minew packets for testing purposes.\n\n```javascript\nbarnowl.addListener(BarnowlMinew, {}, BarnowlMinew.TestListener, {});\n```\n\n\nMinew G1 Service Parameters\n---------------------------\n\nUse the following service parameters for the Minew G1 gateway:\n\n| Property            | Value                             | \n|:--------------------|:----------------------------------|\n| Service Access      | HTTP                              |\n| Upload Interval     | 1 second (RECOMMENDED)            |\n| Url                 | http://xxx.xxx.xxx.xxx:3001/minew |\n| Authentication Type | none                              |\n| BLE Data Format     | Binary / Long                     |\n\nFor the Url parameter, substitute xxx.xxx.xxx.xxx for the IP address of the server running __barnowl-minew__.\n\n__barnowl-minew__ expects firmware __v4.x.x__ or later on the Minew G1 gateway to correctly process binary data as _application/octet-stream_.  For firmware __v2.x.x__ and __v3.x.x__, set the isPreOctetStream option to `true` as in the HTTP example above, in order to accept binary data as _application/json_, as it is (incorrectly) sent by the gateway.\n\n__barnowl-minew__ requires firmware __v3.1.3__ or later on the Minew G1 gateway to correctly interpret the transmitterIdType.\n\n\nMinew G2 Service Parameters\n---------------------------\n\nUse the following service parameters for the Minew G2 gateway:\n\n| Property            | Value                             | \n|:--------------------|:----------------------------------|\n| Service Access      | HTTP                              |\n| Upload Interval     | 100 milliseconds (RECOMMENDED)    |\n| Url                 | http://xxx.xxx.xxx.xxx:3001/minew |\n| Authentication Type | none                              |\n| BLE Data Format     | MINEW-CONNECT or JSON-RAW         |\n\nFor the Url parameter, substitute xxx.xxx.xxx.xxx for the IP address of the server running __barnowl-minew__.\n\n\nMinew MG3 & MG4 Service Parameters\n----------------------------------\n\nUse the following service parameters for the Minew MG3 & MG4 gateways:\n\n| Property            | Value                             | \n|:--------------------|:----------------------------------|\n| Service Access      | HTTP                              |\n| Upload Interval     | 1 second (RECOMMENDED)            |\n| Url                 | http://xxx.xxx.xxx.xxx:3001/minew |\n| Authentication Type | none                              |\n| BLE Data Format     | (JSON-LONG)                       |\n\nFor the Url parameter, substitute xxx.xxx.xxx.xxx for the IP address of the server running __barnowl-minew__.\n\nThe JSON-LONG data format (which is the default and only option) does not specify the transmitterIdType (public or random address) and therefore the raddec output will always have a transmitterIdType of 0, which represents \"unknown\".\n\n\nIs that owl you can do?\n-----------------------\n\nWhile __barnowl-minew__ may suffice standalone for simple real-time applications, its functionality can be greatly extended with the following software packages:\n- [advlib](https://github.com/reelyactive/advlib) to decode the individual packets from hexadecimal strings into JSON\n- [barnowl](https://github.com/reelyactive/barnowl) to combine parallel streams of RF decoding data in a technology-and-vendor-agnostic way\n\nThese packages and more are bundled together as the [Pareto Anywhere](https://www.reelyactive.com/pareto/anywhere) open source middleware suite, which includes a variety of __barnowl-x__ listeners, APIs and interactive web apps.\n\n\nContributing\n------------\n\nDiscover [how to contribute](CONTRIBUTING.md) to this open source project which upholds a standard [code of conduct](CODE_OF_CONDUCT.md).\n\n\nSecurity\n--------\n\nConsult our [security policy](SECURITY.md) for best practices using this open source software and to report vulnerabilities.\n\n[![Known Vulnerabilities](https://snyk.io/test/github/reelyactive/barnowl-minew/badge.svg)](https://snyk.io/test/github/reelyactive/barnowl-minew)\n\n\nLicense\n-------\n\nMIT License\n\nCopyright (c) 2020-2023 [reelyActive](https://www.reelyactive.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR \nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE \nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN \nTHE SOFTWARE."},"npm":{"downloads":[{"from":"2023-01-14T00:00:00.000Z","to":"2023-01-15T00:00:00.000Z","count":0},{"from":"2023-01-08T00:00:00.000Z","to":"2023-01-15T00:00:00.000Z","count":3},{"from":"2022-12-16T00:00:00.000Z","to":"2023-01-15T00:00:00.000Z","count":49},{"from":"2022-10-17T00:00:00.000Z","to":"2023-01-15T00:00:00.000Z","count":299},{"from":"2022-07-19T00:00:00.000Z","to":"2023-01-15T00:00:00.000Z","count":774},{"from":"2022-01-15T00:00:00.000Z","to":"2023-01-15T00:00:00.000Z","count":1546}],"starsCount":0},"github":{"homepage":"https://reelyactive.github.io/diy/minew-g1-config/","starsCount":4,"forksCount":0,"subscribersCount":2,"issues":{"count":2,"openCount":2,"distribution":{"3600":0,"10800":0,"32400":0,"97200":0,"291600":0,"874800":0,"2624400":1,"7873200":0,"23619600":1,"70858800":0,"212576400":0},"isDisabled":false},"contributors":[{"username":"jeffyactive","commitsCount":35}],"commits":[{"from":"2023-01-08T00:00:00.000Z","to":"2023-01-15T00:00:00.000Z","count":8},{"from":"2022-12-16T00:00:00.000Z","to":"2023-01-15T00:00:00.000Z","count":8},{"from":"2022-10-17T00:00:00.000Z","to":"2023-01-15T00:00:00.000Z","count":8},{"from":"2022-07-19T00:00:00.000Z","to":"2023-01-15T00:00:00.000Z","count":11},{"from":"2022-01-15T00:00:00.000Z","to":"2023-01-15T00:00:00.000Z","count":19}]},"source":{"files":{"readmeSize":9138,"testsSize":6642}}},"evaluation":{"quality":{"carefulness":0.71,"tests":0.3,"health":0.3333333333333333,"branding":0},"popularity":{"communityInterest":7,"downloadsCount":99.66666666666667,"downloadsAcceleration":-0.6344748858447488,"dependentsCount":0},"maintenance":{"releasesFrequency":1,"commitsFrequency":0.8468664383561644,"openIssues":0,"issuesDistribution":0.46685744160353526}},"score":{"final":0.5584973093859744,"detail":{"quality":0.645482721091408,"popularity":0.045000316328351435,"maintenance":0.9974353781246543}}}