diff --git a/config.json b/config.json index 9d0c72c..6813445 100644 --- a/config.json +++ b/config.json @@ -1 +1 @@ -{"name":"drideOS","version":"0.11.1","settings":{"debug":false,"videoRecord":true,"flipVideo":false,"gps":false,"speaker":false,"mic":false,"indicator":true,"resolution":"720","fps":30,"clipLength":1,"gSensorSensitivity":"medium","netwrok":{"ssid":"dride","password":"ilovedride"}}} \ No newline at end of file +{"name":"drideOS","version":"0.12.0","settings":{"debug":false,"videoRecord":true,"flipVideo":false,"gps":false,"speaker":false,"mic":false,"indicator":true,"resolution":"720","fps":30,"clipLength":1,"gSensorSensitivity":"medium","netwrok":{"ssid":"dride","password":"ilovedride"}}} \ No newline at end of file diff --git a/daemons/bluetooth/characteristic.js b/daemons/bluetooth/characteristic.js index f33ded5..5ddac0a 100644 --- a/daemons/bluetooth/characteristic.js +++ b/daemons/bluetooth/characteristic.js @@ -3,6 +3,7 @@ var spawn = require('child_process').spawn; var fs = require('fs'); var videoReady = require('./videoReady'); +var led = require('../../modules/led/index'); var bleno = require('bleno'); @@ -33,14 +34,14 @@ buttonStream.prototype.onReadRequest = function(offset, callback) { buttonStream.prototype.onSubscribe = function(maxValueSize, updateValueCallback) { console.log('buttonStream: onSubscribe '); ex = updateValueCallback; - spawn('python', ['/home/core/modules/indicators/python/states/standalone.py', 'isPaired']); + led.isPaired(); }; gpio.on('change', function(channel, value) { if (value) { var currentTimeStamp = new Date().getTime().toString(); videoReady.startListner(currentTimeStamp); - spawn('python', ['/home/core/modules/indicators/python/states/standalone.py', 'welcome']); + led.welcome(); if (ex) { //update state that we need to encode video no matter what diff --git a/modules/led/bin/main b/modules/led/bin/main new file mode 100644 index 0000000..e41e7f4 Binary files /dev/null and b/modules/led/bin/main differ diff --git a/modules/led/index.js b/modules/led/index.js new file mode 100644 index 0000000..3154a12 --- /dev/null +++ b/modules/led/index.js @@ -0,0 +1,13 @@ +var exec = require('child_process').exec; + +module.exports = { + welcome: function() { + exec('sudo ./bin/test'); + }, + error: function() { + exec('sudo ./bin/test'); + }, + isPaired: function() { + exec('sudo ./bin/test'); + } +}; diff --git a/modules/led/package-lock.json b/modules/led/package-lock.json new file mode 100644 index 0000000..aaeb9a2 --- /dev/null +++ b/modules/led/package-lock.json @@ -0,0 +1,38 @@ +{ + "name": "led", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "bindings": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.3.0.tgz", + "integrity": "sha512-DpLh5EzMR2kzvX1KIlVC0VkC3iZtHKTgdtZ0a3pglBZdaQFjt5S9g9xd1lE+YvXyfd6mtCeRnrUfOLYiTMlNSw==" + }, + "nan": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", + "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==" + }, + "neopixels": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/neopixels/-/neopixels-0.0.5.tgz", + "integrity": "sha1-ScbMmex4Q2MZMfMKPoXjUucz15s=" + }, + "rpi-version": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/rpi-version/-/rpi-version-1.4.0.tgz", + "integrity": "sha1-MzUfVwSgmCNRnTays2uOWzdkNW0=" + }, + "rpi-ws281x-native": { + "version": "1.0.0-alpha1", + "resolved": "https://registry.npmjs.org/rpi-ws281x-native/-/rpi-ws281x-native-1.0.0-alpha1.tgz", + "integrity": "sha512-VWpNNcboszZMQv5jCKZiAMQDZUhZeJyFEiWEYU7MCkIGcSjNgWrNqPwjVnHCOKB8JT5UmtcZh+OfMNQdwas8eQ==", + "requires": { + "bindings": "1.3.0", + "nan": "2.10.0", + "rpi-version": "1.4.0" + } + } + } +} diff --git a/modules/led/package.json b/modules/led/package.json new file mode 100644 index 0000000..aff650c --- /dev/null +++ b/modules/led/package.json @@ -0,0 +1,15 @@ +{ + "name": "led", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "neopixels": "0.0.5", + "rpi-ws281x-native": "^1.0.0-alpha1" + } +} diff --git a/package-lock.json b/package-lock.json index 5a467e4..2bf4ad3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "dride-core", - "version": "0.10.3", + "version": "0.11.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 1de0e8b..4eb795c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dride-core", - "version": "0.11.1", + "version": "0.12.0", "description": "Open source dashcam for RaspberryPi ", "scripts": { "build": "node scripts/build.js", diff --git a/state/config.backup.json b/state/config.backup.json index 9d0c72c..6813445 100644 --- a/state/config.backup.json +++ b/state/config.backup.json @@ -1 +1 @@ -{"name":"drideOS","version":"0.11.1","settings":{"debug":false,"videoRecord":true,"flipVideo":false,"gps":false,"speaker":false,"mic":false,"indicator":true,"resolution":"720","fps":30,"clipLength":1,"gSensorSensitivity":"medium","netwrok":{"ssid":"dride","password":"ilovedride"}}} \ No newline at end of file +{"name":"drideOS","version":"0.12.0","settings":{"debug":false,"videoRecord":true,"flipVideo":false,"gps":false,"speaker":false,"mic":false,"indicator":true,"resolution":"720","fps":30,"clipLength":1,"gSensorSensitivity":"medium","netwrok":{"ssid":"dride","password":"ilovedride"}}} \ No newline at end of file