FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
238 views 1 comments
by anonymous
I would like to know if there is any way to send to an external server data of the bluetooth devices that have been scanned, not the ones paired as the option in data to server allows, it could be either the web admin page or through RutOS and then making a script with either Python or the SDK.

The idea of being able to send the scanned devices is to mimic the GPS tracker funtionallity but having the possibillity of being connected through ethernet.

1 Answer

0 votes
by anonymous

Hello,

Thank you for reaching out!

While this is not possible to achieve via WebUI, it can be done via SSH/CLI.

To achieve this, first, a command to start the scan will need to be sent:

ubus call blesem "scan.start"

The scan may take around 6 seconds (depending on the number of devices and what data is needed). Then this command can be used to get the list of devices:

ubus call blesem "scan.result"

If only MAC addresses of Bluetooth devices are needed, then the returned results are already usable after 4-5 seconds, however, if names are needed as well, the process may take longer.

The received data could be stored in a custom Modbus register, and then transferred to your server using Data to Server feature.

An alternative could be to use JSON-RPC and gather this data using requests directly from your server, where the Bluetooth devices will be processed.

  

Hope you find this information useful!

Best regards,
DaumantasG

Best answer
by anonymous
It worked, end up writing a Python script in order to change the output since the JSON that "scan.result" gives is too large for the 125 registers that you can use for the MODBUS TCP request.

Thanks for your help