Giter Club home page Giter Club logo

node-red-contrib-linking-device's People

Contributors

dependabot[bot] avatar tinoue avatar

Stargazers

 avatar

Watchers

 avatar  avatar

node-red-contrib-linking-device's Issues

linking-scanner suspended in a certain condition

  • linking-sensorでデバイスとコネクト
  • その後デバイスが応答しなくなる(具体的には電池消耗)
  • node-red再起動
  • デバイスが接続要求(電池が一時的に回復したため)

この状態で、以下のメッセージが表示され、linking-scannerがsuspend状態のまま復帰しない。

linking-device: scanner interrupted.
18-09-21 23:40:26 [warn]  Communication send error: Error: not opened
noble: unknown peripheral efce2430e4ed connected!
linking-device: scanner stopped.
noble: unknown peripheral efce2430e4ed disconnected!

linking-sensor doesn't discover device

linking-sernsorに登録済みデバイスがまだスキャンで発見されていない場合、
linking-sernsorの編集ダイアログを開いた際、スキャンするのが期待される動作だが
現状では即"Failed to get device servicer: Not Found"のエラーダイアログが表示される。

noble: Failed to connect to the device: Command Disallowed (0xc)

node-redをCTRL-Cで終了して再起動後に発生。

linking-device: connecting to device: Tukeru_th0164215
Error: Failed to connect to the device: Command Disallowed (0xc): Tukeru_th0164215
18-08-23 09:36:01 [error]  failed to connect Tukeru_th0164215 : Error: Failed to connect to the device: Command Disallowed (0xc)

以下のissueでは接続中デバイスに再度接続をしようとすると同じメッセージが発生。
noble/noble#255

ただし、ビーコンデータは来ているので、接続中ではないと思われる。

improve to retry connection by linking-sensor

現状disconnectするとそれっきりになりやすい。
ただ、どうしても接続できない状況はあるため、リトライするにしてもインターバルを長くする対応が必要。最大1h間隔ぐらいでもいいと思われる。

noble: RangeError on Hci.processLeAdvertisingReport

18-08-18 14:30:48 [info]  started sensor: humidity
18-08-18 14:30:48 [debug]  humidity notification started.
buffer.js:977
    throw new RangeError('Index out of range');
    ^

RangeError: Index out of range
    at checkOffset (buffer.js:977:11)
    at Buffer.readInt8 (buffer.js:1103:5)
    at Hci.processLeAdvertisingReport (/home/pi/git/node-red-contrib-linking-device/node_modules/noble/lib/hci-socket/hci.js:804:25)
    at Hci.processLeMetaEvent (/home/pi/git/node-red-contrib-linking-device/node_modules/noble/lib/hci-socket/hci.js:767:12)
    at Hci.onSocketData (/home/pi/git/node-red-contrib-linking-device/node_modules/noble/lib/hci-socket/hci.js:583:14)
    at emitOne (events.js:116:13)
    at BluetoothHciSocket.emit (events.js:211:7)

linking-scanner suspended unexpectedly

0.9.0
おそらく以下の再現手順:

  • 2つめのlinking-scannerを配置してdeploy
  • そのスキャナを削除してdepoly
  • linking-scannerが止まったままとなる

Need to disconnect device when other device is selected in edit dialog

linking-sensorでデバイスに接続した状態で編集ダイアログを開き、別のデバイスを選択した際、もとのデバイスを切断する必要がある。

そうしないと、接続されたデバイスはscannerにて補足されないため、その後そのデバイスを選ぶことが出来なくなってしまう。

refactor logging

特定のノードに属さないメッセージが、consoleに直で出力されているのをなんとかする。
linking-scannerにロギングを仲介してもらうべきか?

Need to modify retry interval of linking-sensor

デバイスが無反応な場合、connectのリトライ間隔が最短60秒後にしているが、scannerの開始も60秒間隔なので、無反応なデバイスがあるとscannerが動く時間がほとんどない。
エラー時のリトライ間隔を長くするなどの対応が必要。

LinkingDevice.service.start doesn't return when disconnected

以下の状態で先に進まなくなっていた。start中にdisconnectして結果が返ってこない状況の模様。

18-08-24 01:32:54 [debug]  startSensor: Tukeru_th0164215/temperature
linking-device: Request to connect with device: Tukeru_th0164215
linking-device: connecting to device: Tukeru_th0164215
linking-device: device connected: Tukeru_th0164215
18-08-24 01:33:18 [debug]  starting sensor: Tukeru_th0164215/temperature
linking-device: device disconnected: Tukeru_th0164215

LinkingDevice.connection() error not handled

timeoutエラーでrejectしているはずだが、なぜかcatch出来ていないようにみえる。

linking-device/getServices/Sizuku_tha0141790
linking-device: Got request to connect to device: Sizuku_tha0141790
linking-device: Stop scanning.
linking-device: scanner already stopped.
linking-device: connecting to device: Sizuku_tha0141790
Error: Failed to connect to the device: Timeout
    at _init.then.then.then.then.then.then.then.then.catch (/home/pi/git/node-red-contrib-linking-device/node_modules/node-linking/lib/modules/device.js:165:14)
    at <anonymous>
linking-device: connection timeout.
connectSemaphore: too many leave
linking-device/getServices/ failed to connect Sizuku_tha0141790 : Error: connection timeout.
linking-device: Start scanning.

Add "keep connection" property in linking-sensor

接続状態のほうがすぐにLEDを点灯できるが、その際はビーコンが取れないというトレードオフがある。
LEDのみのデバイスのために、接続維持オプションを用意する。

MaxListenersExceededWarning

When linking-sensor retries to connect the following error occured.

(node:15653) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 disconnect listeners added. Use emitter.setMaxListeners() to increase limit

linking-sensorではnode作成時にしかセットしていないので、node-linkigかnobleの可能性も0ではなさそう。

node-red reports timeout error while re-deploying

再デプロイ時にflowをとめるのに15秒以上かかり、node-redでタイムアウトが発生している。
linking-deviceに問題がある可能性大。

18-08-18 13:39:04 [debug]  saved flow revision: 5a4e82b1e9faf60c95f71c44bb1267a7
18-08-18 13:39:04 [info]  Stopping flows
18-08-18 13:39:04 [debug]  red/nodes/flows.stop : stopping flow : global
18-08-18 13:39:04 [debug]  red/nodes/flows.stop : stopping flow : 2b09d8bf.0e4648
18-08-18 13:39:04 [info]  linking-scanner closing.
18-08-18 13:39:04 [info]  linking-scanner closed.
18-08-18 13:39:04 [debug]  linking-led Closing.
18-08-18 13:39:04 [debug]  linking-led Closed.
18-08-18 13:39:04 [info]  linking-sensor closing.
18-08-18 13:39:04 [info]  linking-sensor closed.
18-08-18 13:39:04 [info]  linking-sensor closing.
18-08-18 13:39:04 [info]  linking-sensor closed.
18-08-18 13:39:19 [error]  Error stopping node: TimeoutError: timed out after 15000ms
18-08-18 13:39:19 [debug]  TimeoutError: timed out after 15000ms
    at onTimeout (/home/pi/git/node-red-template-embedded/node_modules/when/lib/decorators/timed.js:69:7)
    at Timeout._onTimeout (/home/pi/git/node-red-template-embedded/node_modules/when/lib/decorators/timed.js:13:4)
    at ontimeout (timers.js:498:11)
    at tryOnTimeout (timers.js:323:5)
    at Timer.listOnTimeout (timers.js:290:5)
18-08-18 13:39:19 [info]  Stopped flows

noble: Error on Smp.handlePairingResponse while connecting to peripheral

Rpi3 and noble 1.9.1
occored 2 times under weak signal condition.

buffer.js:436
      length += list[i].length;
                        ^

TypeError: Cannot read property 'length' of undefined
    at Function.Buffer.concat (buffer.js:436:25)
    at Object.c1 (/home/pi/git/node-red-contrib-linking-device/node_modules/noble/lib/hci-socket/crypto.js:8:19)
    at Smp.handlePairingResponse (/home/pi/git/node-red-contrib-linking-device/node_modules/noble/lib/hci-socket/smp.js:86:12)
    at Smp.onAclStreamData (/home/pi/git/node-red-contrib-linking-device/node_modules/noble/lib/hci-socket/smp.js:57:10)
    at emitTwo (events.js:131:20)
    at AclStream.emit (events.js:214:7)
    at AclStream.push (/home/pi/git/node-red-contrib-linking-device/node_modules/noble/lib/hci-socket/acl-stream.js:35:10)
    at NobleBindings.onAclDataPkt (/home/pi/git/node-red-contrib-linking-device/node_modules/noble/lib/hci-socket/bindings.js:286:15)
    at emitThree (events.js:136:13)
    at Hci.emit (events.js:217:7)

Connecting non-existing device causes semaphore error

linking-device: connecting to device: Sizuku_Lux0196901
(node:11649) UnhandledPromiseRejectionWarning: Error: leave called too many times.
    at Object.leave (/home/pi/git/node-red-contrib-linking-device/node_modules/semaphore/lib/semaphore.js:62:12)
    at PromiseSemaphore.leave (/home/pi/git/node-red-contrib-linking-device/src/linking-device.js:89:18)
    at startSensor (/home/pi/git/node-red-contrib-linking-device/src/linking-device.js:1103:47)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
(node:11649) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 777)

linking-scanner doesn't restart automatically

0.8.0
linking-scannerを2個、linking-sensorを1個、いずれも自動起動ONにした状態で動作させると
linking-sensorの接続でいったん解除されたスキャンが再起動していない。

Possible EventEmitter memory leak detected

デプロイを繰り返すと発生

(node:1140) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 scanStop listeners added. Use emitter.setMaxListeners() to increase limit

noble: Error: Failed to connect to the device: Peripheral already connected

LinkingDeviceのdevice.conneced = falseなのにも関わらず、noboleから既にコネクト済みとのエラー。
以前のconnnectがnoboleからTimeoutでエラーとなっているがその後実は繋がっていた模様。
Under weak signal condition.

Error: Failed to connect to the device: Timeout
    at _init.then.then.then.then.then.then.then.then.catch (/home/pi/git/node-red-contrib-linking-device/node_modules/node-linking/lib/modules/device.js:165:14)
    at <anonymous>
18-08-12 15:52:07 [error]  failed to connect Tukeru_th0164136 : Error: Failed to connect to the device: Timeout
linking-device: Stopping scan to connect.
linking-device: Stop scanning.
linking-device: scanner already stopped.
Error: Failed to connect to the device: Timeout
    at _init.then.then.then.then.then.then.then.then.catch (/home/pi/git/node-red-contrib-linking-device/node_modules/node-linking/lib/modules/device.js:165:14)
    at <anonymous>
linking-device/getServices/ failed to connect Tukeru_th0164136 : Error: Failed to connect to the device: Timeout
linking-device/getServices/Tukeru_th0164136
linking-device: connecting to device: Tukeru_th0164136
linking-device: Stopping scan to connect.
linking-device: Stop scanning.
linking-device: scanner already stopped.
Error: Failed to connect to the device: Peripheral already connected
    at p.connect (/home/pi/git/node-red-contrib-linking-device/node_modules/node-linking/lib/modules/device.js:84:13)
    at Peripheral.<anonymous> (/home/pi/git/node-red-contrib-linking-device/node_modules/noble/lib/peripheral.js:38:7)
    at Object.onceWrapper (events.js:315:30)
    at emitOne (events.js:116:13)
    at Peripheral.emit (events.js:211:7)
    at Peripheral.connect (/home/pi/git/node-red-contrib-linking-device/node_modules/noble/lib/peripheral.js:43:10)
    at Promise (/home/pi/git/node-red-contrib-linking-device/node_modules/node-linking/lib/modules/device.js:82:6)
    at new Promise (<anonymous>)
    at LinkingDevice.connect (/home/pi/git/node-red-contrib-linking-device/node_modules/node-linking/lib/modules/device.js:72:16)
    at /home/pi/git/node-red-contrib-linking-device/src/linking.js:422:34
linking-device/getServices/ failed to connect Tukeru_th0164136 : Error: Failed to connect to the device: Peripheral already connected

Mask beacon data from Oshieru

Oshieruのビーコンデータは暗号化されているが、node-linkingで通常のadvertizementデータ解析を通すと、様々なserviceに対応しているかのようなbeaconDataがランダムに返ってくる。
これでは困るので、beaconDataをマスクする必要がある。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.