This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Bluetooth
#1
Wink 
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
Reply
#2
It works over USB so any LM can be used, you just need to install extra packages
Reply
#3
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
Reply
#4
Hi Bart,

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

Try libbleutooth package

BR,

Erwin
Reply
#5
Thanks Erwin, will give it a try.
Bart
Reply
#6
You need to install these packages first, the reboot:
libbluetooth
luable
genohm-scada-ble
Reply
#7
(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.
Reply
#8
(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.

Best regards, Jørn.
Reply
#9
You need packages for newer HW version, you can find them here:
https://dl.openrb.com/lm-17-imx6/pkg/
Reply
#10
(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
Reply
#11
Have you rebooted LM after package install? BLE does not have a strict identification protocol - just advertising messages with device MAC and a name.
Reply
#12
(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
Reply
#13
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)
Reply
#14
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.
Reply
#15
Error code: 115

thanks It works!
Reply
#16
Do you have universal profile running in parallel?
Reply
#17
(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?
Reply
#18
Resident script. Never put anything but Lua functions into Common functions, otherwise each script with execute the code you have in Common functions.
Reply


Forum Jump: