Posts: 36
Threads: 13
Joined: Mar 2017
Reputation:
0
07.04.2017, 14:22
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.
Posts: 7764
Threads: 42
Joined: Jun 2015
Reputation:
447
It works over USB so any LM can be used, you just need to install extra packages
Posts: 57
Threads: 7
Joined: Jul 2016
Reputation:
1
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
Posts: 1764
Threads: 6
Joined: Jul 2015
Reputation:
117
Hi Bart,
See: https://dl.openrb.com/lm-16.09/pkg/
Try libbleutooth package
BR,
Erwin
Posts: 57
Threads: 7
Joined: Jul 2016
Reputation:
1
Thanks Erwin, will give it a try.
Bart
Posts: 7764
Threads: 42
Joined: Jun 2015
Reputation:
447
You need to install these packages first, the reboot:
libbluetooth
luable
genohm-scada-ble
Posts: 57
Threads: 7
Joined: Jul 2016
Reputation:
1
(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.
Posts: 76
Threads: 5
Joined: Sep 2016
Reputation:
4
(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.
Posts: 7764
Threads: 42
Joined: Jun 2015
Reputation:
447
You need packages for newer HW version, you can find them here:
https://dl.openrb.com/lm-17-imx6/pkg/
Posts: 57
Threads: 7
Joined: Jul 2016
Reputation:
1
(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
Posts: 7764
Threads: 42
Joined: Jun 2015
Reputation:
447
Have you rebooted LM after package install? BLE does not have a strict identification protocol - just advertising messages with device MAC and a name.
Posts: 57
Threads: 7
Joined: Jul 2016
Reputation:
1
(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
Posts: 59
Threads: 3
Joined: Nov 2016
Reputation:
0
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)
Posts: 7764
Threads: 42
Joined: Jun 2015
Reputation:
447
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.
Posts: 59
Threads: 3
Joined: Nov 2016
Reputation:
0
27.06.2017, 13:47
(This post was last modified: 27.06.2017, 13:53 by Igor68.)
Error code: 115
thanks It works!
Posts: 7764
Threads: 42
Joined: Jun 2015
Reputation:
447
Do you have universal profile running in parallel?
Posts: 237
Threads: 31
Joined: May 2018
Reputation:
2
(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?
Posts: 7764
Threads: 42
Joined: Jun 2015
Reputation:
447
Resident script. Never put anything but Lua functions into Common functions, otherwise each script with execute the code you have in Common functions.
|