Logic Machine Forum
Bluetooth - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Bluetooth (/showthread.php?tid=725)



Bluetooth - Rodriguez - 07.04.2017

Hi, I would like to know with what version of the logic machine I can work this example...
http://openrb.com/bluetooth-presence-detection-and-rssi
Thanks. Smile


RE: Bluetooth - admin - 07.04.2017

It works over USB so any LM can be used, you just need to install extra packages


RE: Bluetooth - bmodeco - 08.04.2017

Hi,
I want to use this also. I have LM5PMU and i do not see the BLE-tab?
Does it only show when you plug in a usb device?
I was thinking of using the BT820 or are there better alternatives (longer range?)
Thanks, Bart


RE: Bluetooth - Erwin van der Zwart - 08.04.2017

Hi Bart,

See: https://dl.openrb.com/lm-16.09/pkg/

Try libbleutooth package

BR,

Erwin


RE: Bluetooth - bmodeco - 10.04.2017

Thanks Erwin, will give it a try.
Bart


RE: Bluetooth - admin - 10.04.2017

You need to install these packages first, the reboot:
libbluetooth
luable
genohm-scada-ble


RE: Bluetooth - bmodeco - 11.04.2017

(10.04.2017, 07:11)admin Wrote: You need to install these packages first, the reboot:
libbluetooth
luable
genohm-scada-ble

Hi Admin,
Tried to install them - none of them installed: error below.
Any ideas?
Bart

unknown package 'libbluetooth'.
Collected errors:
* pkg_hash_fetch_best_installation_candidate: Packages for libbluetooth found, but incompatible with the architectures configured
* opkg_install_cmd: Cannot install package libbluetooth.


RE: Bluetooth - Jørn - 11.04.2017

(11.04.2017, 18:33)bmodeco Wrote:
(10.04.2017, 07:11)admin Wrote: You need to install these packages first, the reboot:
libbluetooth
luable
genohm-scada-ble

Hi Admin,
Tried to install them - none of them installed: error below.
Any ideas?
Bart

unknown package 'libbluetooth'.
Collected errors:
* pkg_hash_fetch_best_installation_candidate: Packages for libbluetooth found, but incompatible with the architectures configured
* opkg_install_cmd: Cannot install package libbluetooth.

They have to be installed in the right sequence, start with libbluetooth then luable lastly genohm-scada-ble

But this might not be your issues since none of them installed.

Jørn.


RE: Bluetooth - admin - 12.04.2017

You need packages for newer HW version, you can find them here:
https://dl.openrb.com/lm-17-imx6/pkg/


RE: Bluetooth - bmodeco - 14.04.2017

(12.04.2017, 06:12)admin Wrote: You need packages for newer HW version, you can find them here:
https://dl.openrb.com/lm-17-imx6/pkg/

Hi Admin,
Tried this - it is working now - everything loaded correctly.
Some questions i have:
- in the BLE-tab no devices show up - I only get devices using your presence detection-script with scan each 5sec (script ble.scan(callback))
Is there a reason why no devices show up in the BLE-tab? Maybe because they are not BLE and only regular bluetooth?
Is there a way when scanning to obtain more info: like device info/name, manufacturer, etc... I was surprised about the amount of devices are in my house -  a lot of them are impossible to figure out (no way to get the mac-address from Tiles, kitchendevices with bluetooth, etc) so it would be great if i had some more info to be able to identify them (who is who).

Br, Bart


RE: Bluetooth - admin - 14.04.2017

Have you rebooted LM after package install? BLE does not have a strict identification protocol - just advertising messages with device MAC and a name.


RE: Bluetooth - bmodeco - 14.04.2017

(14.04.2017, 06:27)admin Wrote: Have you rebooted LM after package install? BLE does not have a strict identification protocol - just advertising messages with device MAC and a name.

Hi Admin,
I did reboot the LM as requested.
I am using for example Tiles to check presence - they advertise all the time. When using your script I can detect them (and other Bluetooth devices) entering/leaving the house but in the BLE-tab of the LM none of them show up.
For now I can work with that: your script runs fine, I can check for presence or not.
It is strange that they do not show in the BLE-tab.
Thanks, Bart


RE: Bluetooth - Igor68 - 27.06.2017

Hi, help, please. I can not connect to the device bluetooth. All packages are installed. With a universal profile the device works, but there is no script.

require('ble')
ble.up()
sock = ble.sock()
ble.settimeout(sock, 30)
res = ble.connect(sock, "df:54:50:42:0b:a4")
log(res)
ble.close(sock)


RE: Bluetooth - admin - 27.06.2017

Try connecting like this:
Code:
res = ble.connect(sock, "df:54:50:42:0b:a4", true)
It will use random address instead of a public one, this is needed for some devices.


RE: Bluetooth - Igor68 - 27.06.2017

Error code: 115

thanks It works!


RE: Bluetooth - admin - 27.06.2017

Do you have universal profile running in parallel?


RE: Bluetooth - DGrandes - 07.08.2018

(27.06.2017, 13:06)Igor68 Wrote: Hi, help, please. I can not connect to the device bluetooth. All packages are installed. With a universal profile the device works, but there is no script.

require('ble')
ble.up()
sock = ble.sock()
ble.settimeout(sock, 30)
res = ble.connect(sock, "df:54:50:42:0b:a4")
log(res)
       ble.close(sock)

Where should i put that code? In Common Functions or in Resident script?


RE: Bluetooth - admin - 07.08.2018

Resident script. Never put anything but Lua functions into Common functions, otherwise each script with execute the code you have in Common functions.