Category : bluetooth-lowenergy

Using the code from this topic (Tools to determine exact location when using ibeacons)I was able to create a 2D location using a raspberry and 3 beacons. Could someone please guide me on how to convert this to a 3D location using 4 beacons? I found this article (https://journals.sagepub.com/doi/pdf/10.1177/1550147716671720), and this topic (https://www.mathworks.com/matlabcentral/answers/428304-how-to-calculate-3d-positions-using-the-distance-from-3-separate-points-in-space), but unfortunately ..

Read more

My raspberry code for one beacon: while True: try: devices = scanner.scan(1) for beacon in devices: if beacon.addr == ‘d0:f0:18:44:0b:82′: bc = "{}|{:d}".format(beacon.addr,beacon.rssi) sock.sendto(bc.encode(), server_address) except: print("Error") pass Windows code for one beacon: while True: bc, address = sock.recvfrom(4096) # buffer size adres, sygnal = bc.split(b’|’) # split print(adres, sygnal) This code works perfectly for ..

Read more

I’m trying to send bytes using Python and Bleak module from PC to Ebyte BLE module E104-BT02. The code is following: ADDRESS = "ED:F5:E8:F6:DE:D8" MODEL_NBR_UUID = "00002a24-0000-1000-8000-00805f9b34fb" UART_TX_CHAR_UID = "0000fff1-0000-1000-8000-00805f9b34fb" UART_RX_CHAR_UUID = "0000fff2-0000-1000-8000-00805f9b34fb" def handle_rx(_: int, data: bytearray): print("received:", data) async def main(ble_address): device = await BleakScanner.find_device_by_address(ble_address, timeout=60.0) if not device: raise BleakError(f"A device with ..

Read more

I’ve installed micro python firmware v4.1.2 on an arduino nano 33 ble with OpenMV ide. The ide comes with a python script example: ble_blinky_1.py. The script is also available here: https://docs.arduino.cc/tutorials/nano-33-ble/ble-python-api For an unknown reason, the connection with a smartphone does not work and the connection event handler will not be triggered. Here is an ..

Read more

I am trying to add and run the following python script based on example-advertisement: #!/usr/bin/python # SPDX-License-Identifier: LGPL-2.1-or-later from __future__ import print_function import argparse import dbus import dbus.exceptions import dbus.mainloop.glib import dbus.service import time import threading try: from gi.repository import GObject # python3 except ImportError: import gobject as GObject # python2 mainloop = None BLUEZ_SERVICE_NAME ..

Read more