ALLTERCO/shelly-script-examples

ble-shelly-btn-gateway-for-other-devices.js not working

Opened this issue · 1 comments

Describe the bug
The script doesn't work and get the following log after start:

shos_rpc_inst.c:230 script.list via WS_in 192.168.2.34:54862 13:14:14
shos_rpc_inst.c:230 script.start via WS_in 192.168.2.34:54862 13:14:16
shelly_user_script.:328 JS RAM stat: initial: 113892 after: 113864, used: 28 13:14:16
shelly_user_script.:367 Running 'script_1.js'...13:14:16
shelly_bluetooth_sca:69 bluetoth scanner already taken 13:14:16
BLE is successfully started 13:14:16
shelly_user_script.:338 JS RAM stat: after user code: 113892 after: 112140, used: 1752 13:14:16
shelly_notification:163 Status change of script:1: {"id":1,"running":true} 13:14:16

stopping the script will resolve in:
shelly_bluetooth_sca:88 bluetooth scanner cannot stop non owned scan 13:12:49
shelly_notification:163 Status change of script:1: {"id":1,"running":false} 13:12:49

Device and script details (please complete the following information):

  • Shelly PlusI4 FCB467BAC924 | 1.0.8 | 58706c2c|
  • Shelly BLU Button 1: 20230725-152141/v1.0.8@0ba28b97

UPDATE:
_It turns out that I had the option "Enable Bluetooth gateway" ON in the settings what was the reason the script didn't worked. By disabling the gateway function now the script works. Can someone explain this?

NOTE: in previous firmware this used to work when the gateway is enabled:
https://youtu.be/ULZ0QfIfgdc?t=532

I have confirmed the above and it had me scratching my head for ages as to why it wasn't working. Please can this be adjusted or at least a warning placed at the start of the script to make sure BT Gateway is disabled on the device the script is run on.