monitor
monitor copied to clipboard
sudo bash monitor.sh -t :syntax error: operand expected
Hi good day, currently I am running at setting -t (trigger mode), if I didn’t trigger the mode for quite period of time, I am getting syntax error:
./support/btle: line 310: [[: -: syntax error: operand expected (error token is “-”) monitor.sh: line 1773: -: syntax error: operand expected (error token is “-”) Terminated
`> starting monitor.sh (v. 0.2.200)...
removing web request caches 88:75:98:FB:E9:E8 confidence topic: DRRM/Dir_Room/avi (has not previously connected to hci0) E0:AA:96:07:D9:59 confidence topic: DRRM/Dir_Room/rama (has not previously connected to hci0) A8:87:B3:9D:D8:13 confidence topic: DRRM/Dir_Room/dilan (has not previously connected to hci0) known beacon: FD:51:A1:48:4C:AF publishes to: DRRM/Dir_Room/james [+] 0.2.200 22-01-2020 07:16:58 pm [CMD-NAME] 88:75:98:FB:E9:E8 Avi Samsung Electronics CoLtd [+] 0.2.200 22-01-2020 07:17:01 pm [CMD-MQTT] DRRM/Dir_Room/avi { ... confidence : 100 ... } [+] 0.2.200 22-01-2020 07:17:17 pm [CMD-MQTT] DRRM/Dir_Room/rama { ... confidence : 0 ... } [+] 0.2.200 22-01-2020 07:17:21 pm [CMD-NAME] E0:AA:96:07:D9:59 Rama Samsung Electronics CoLtd [+] 0.2.200 22-01-2020 07:17:38 pm [CMD-MQTT] DRRM/Dir_Room/dilan { ... confidence : 0 ... } [+] 0.2.200 22-01-2020 07:17:41 pm [CMD-NAME] A8:87:B3:9D:D8:13 Dilan Samsung Electronics CoLtd [+] 0.2.200 22-01-2020 07:17:54 pm [CMD-NAME] E0:AA:96:07:D9:59 Rama Samsung Electronics CoLtd [+] 0.2.200 22-01-2020 07:18:05 pm [CMD-RSSI] PUBL AA:BB:CC:92:23:45 RSSI: -91 dBm (initial reading | 109 dBm) [+] 0.2.200 22-01-2020 07:19:26 pm [CMD-NAME] E0:AA:96:07:D9:59 Rama Samsung Electronics CoLtd [+] 0.2.200 22-01-2020 07:19:26 pm [CMD-NAME] A8:87:B3:9D:D8:13 Dilan Samsung Electronics CoLtd . . . type[+] 0.2.200 23-01-2020 04:27:13 am [CMD-NAME] A8:87:B3:9D:D8:13 Dilan Samsung Electronics CoLtd [+] 0.2.200 23-01-2020 04:29:55 am [DEL-RAND] RAND 14:AB:3A:D3:0F:FE expired after 188 seconds [+] 0.2.200 23-01-2020 04:35:35 am [CMD-NAME] 88:75:98:FB:E9:E8 Avi Samsung Electronics CoLtd [+] 0.2.200 23-01-2020 04:35:35 am [CMD-NAME] E0:AA:96:07:D9:59 Rama Samsung Electronics CoLtd [+] 0.2.200 23-01-2020 04:35:36 am [CMD-NAME] A8:87:B3:9D:D8:13 Dilan Samsung Electronics CoLtd [+] 0.2.200 23-01-2020 04:38:17 am [DEL-RAND] RAND 35:22:CC:F6:C4:09 expired after 189 seconds [+] 0.2.200 23-01-2020 04:42:06 am [CMD-NAME] 88:75:98:FB:E9:E8 Avi Samsung Electronics CoLtd [+] 0.2.200 23-01-2020 04:42:06 am [CMD-NAME] E0:AA:96:07:D9:59 Rama Samsung Electronics CoLtd [+] 0.2.200 23-01-2020 04:42:06 am [CMD-NAME] A8:87:B3:9D:D8:13 Dilan Samsung Electronics CoLtd ./support/btle: line 310: [[: -: syntax error: operand expected (error token is "-") monitor.sh: line 1773: -: syntax error: operand expected (error token is "-") Terminated `
I have encountered a similar bash syntax error. In the version of monitor.sh I have, the error is reported on line 1809, which is: rssi_change=$((rssi - rssi_latest)) I suspect the rssi value returned is not a number for some case(s). I have changed line 1800 from this: if [ -n "$rssi" ] && [ "${#rssi}" -lt "5" ] && [ "$uptime" -gt "$PREF_STARTUP_SETTLE_TIME" ]; then to add this check and so far seems better. if [ -n "$rssi" ] && [[ "$rssi" =~ ^[0-9-]+$ ]] && [ "${#rssi}" -lt "5" ] && [ "$uptime" -gt "$PREF_STARTUP_SETTLE_TIME" ]; then
I'm having the similar issue @tramanah. My error is as follows: monitor.sh: line 1777: -: syntax error: operand expected (error token is "-") Terminated.
I don't know if this helps but I have 2 usb bluetooth dongles from different manufacturers. However, they both use the Broadcom Corp BCM20702A0 chipset.
In my setup, I have Synology Debian VM setup. It seems when the app terminates, it disconnects my USB connection on the VM. Sometimes it will run for many hours and then sometimes it terminates in about 10-15 mins.
I do have a third usb bluettoth dongle. It's an ASUSTek ASUS USB-BT500 that seems to be rock solid but generates a bunch of the following timeout errors: Bluetooth: hci0: command 0x0419 tx timeout.
Let me know if you need more info/logs.