tinoue / node-red-contrib-linking-device Goto Github PK
View Code? Open in Web Editor NEWA Node-RED node to control Linking devices
License: Apache License 2.0
A Node-RED node to control Linking devices
License: Apache License 2.0
この状態で、以下のメッセージが表示され、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-sernsorに登録済みデバイスがまだスキャンで発見されていない場合、
linking-sernsorの編集ダイアログを開いた際、スキャンするのが期待される動作だが
現状では即"Failed to get device servicer: Not Found"のエラーダイアログが表示される。
linking-sensorの設定画面でデバイスを変更した際、サービス一覧のチェックボックスの状態が初期化されない。
linking-sernsorで照度の取得を可能にする。node-linkingの変更も必要。
linking-sensorの編集ダイアログで設定したセンサー種別が正常に反映されていない。
linking-device: found device: Sizuku_Lux0196901
18-08-24 20:21:16 [debug] Unsupported beacon data: {"name":"General","serviceId":0}
18-08-24 20:21:16 [debug] Unsupported beacon data: {"name":"Vendor","bin":"000100001000","serviceId":15}
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
ただし、ビーコンデータは来ているので、接続中ではないと思われる。
温度・湿度グラフを見ると、たまに発信したようなグラフになっている。
処理に何らかの問題があるのではないか?
現状disconnectするとそれっきりになりやすい。
ただ、どうしても接続できない状況はあるため、リトライするにしてもインターバルを長くする対応が必要。最大1h間隔ぐらいでもいいと思われる。
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の設定画面にて発見済みデバイス一覧をrssiつきで表示する。
linking-scannerがONになってない場合、他のノードでスキャンが行われてもステータスはidleのままにするべき。動いているようで紛らわしい。
0.9.0
おそらく以下の再現手順:
linking-sensorの編集ダイアログでサポートするセンサーの値が取れない。
リフレッシュボタンをおしてもだめ。
linking-device: found device: Sizuku_Lux0196901
24 Aug 20:14:22 - [red] Uncaught Exception:
24 Aug 20:14:22 - TypeError: JSON.strigify is not a function
linking-sensorでデバイスに接続した状態で編集ダイアログを開き、別のデバイスを選択した際、もとのデバイスを切断する必要がある。
そうしないと、接続されたデバイスはscannerにて補足されないため、その後そのデバイスを選ぶことが出来なくなってしまう。
特定のノードに属さないメッセージが、consoleに直で出力されているのをなんとかする。
linking-scannerにロギングを仲介してもらうべきか?
デバイスが無反応な場合、connectのリトライ間隔が最短60秒後にしているが、scannerの開始も60秒間隔なので、無反応なデバイスがあるとscannerが動く時間がほとんどない。
エラー時のリトライ間隔を長くするなどの対応が必要。
From this link:
https://flows.nodered.org/node/node-red-contrib-linking-device
There is this link:
https://flows.nodered.org/node/README.md
Error 404.
:( (Frown)
以下の状態で先に進まなくなっていた。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
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.
linking-sensorでSizuku_thaを選択した場合、気圧センサーが有効にならない。
This might be a feature/limitation.
接続状態のほうがすぐにLEDを点灯できるが、その際はビーコンが取れないというトレードオフがある。
LEDのみのデバイスのために、接続維持オプションを用意する。
red-contrib-linking-device should be node-red-contrib-linking-device
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ではなさそう。
再デプロイ時に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
0.9.0
Sizuku LuxはLEDを装備していないので、linking-ledで選択された場合にはなんらかの通知等が必要。
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)
Sizuku THAの大気圧が1000前後の固定値になっている。
処理に問題があるのではないか?
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)
0.8.0
linking-scannerを2個、linking-sensorを1個、いずれも自動起動ONにした状態で動作させると
linking-sensorの接続でいったん解除されたスキャンが再起動していない。
LEDの点等がうまくいったかどうかを返すoutput portがあると望ましい。
デプロイを繰り返すと発生
(node:1140) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 scanStop listeners added. Use emitter.setMaxListeners() to increase limit
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
Oshieruのビーコンデータは暗号化されているが、node-linkingで通常のadvertizementデータ解析を通すと、様々なserviceに対応しているかのようなbeaconDataがランダムに返ってくる。
これでは困るので、beaconDataをマスクする必要がある。
Unsupported beacon data: {"name":"Illuminance (lx)","illuminance":0,"serviceId":9}
ありがちなミス
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.