We can use the previous setup we used in my previous article(Configuring Ibeacons using Raspberry Pi B+ and Python) so that all we need to do is create a python program. And here is the python program I used to scan other BLE devices:
import serial import time port = serial.Serial("/dev/ttyAMA0", baudrate=9600, timeout=3.0) port.write("AT+RENEW") rcv = port.readline() print rcv rcv = "" port.write("AT+RESET") rcv = port.readline() print rcv rcv = "" port.write("AT+ROLE1") rcv = port.readline() print rcv rcv = "" port.write("AT+IMME1") rcv = port.readline() print rcv rcv = "" port.write("AT+SHOW1") rcv = port.readline() print rcv rcv = "" while True: port.write("AT+DISC") rcv = port.readline() print rcv rcv = "" time.sleep(10)
The AT+DISC will scan all BLE devices and will just return the MAC address, the newest firmware version has the command AT+DISI? and this command will return the UUID, RSSI, Major, Minor, Measured Power and the MAC Address. The command AT+DISI? is available with firmware version V539, to check the version of the firmware use AT+VERS?
If your current Ibeacon does not support the latest version, you can update the firmware by following this procedure.
Hi John,
ReplyDeleteThanks for your blog on the HM-10.
I've been trying to get these to work with the AT+DISI? command without any success.
I wish to connect an HM10 to an ESP8266 and put one in each room in my home. the HM10 would just provide the esp8266 with any ble devices it sees and their respective rssi values which can then be centrally processed on a RPi and determine the location of a beacon device.... i just cant get the HM-10 to work as i think they should!
Have you had any luck with the AT-DISI? command??
Cheers,
Greg
Hi Greg,
ReplyDeleteThank you for visiting my blog. I have upgraded my firmware to 5.40 and I had no problem with AT+DISI? It worked the first time I tested it.
In case you are having problems this is the file I used:
https://drive.google.com/file/d/0B1tuk2j-arZSVTc3R1hEbXFuRms/view?usp=sharing
Hi John,
ReplyDeleteYes thats the same version i am using, - could you please confirm the comands you sent before AT+DISI?
Cheers,
Greg
This comment has been removed by the author.
ReplyDeleteCan anyone post latest command sheet for v540
ReplyDeleteGreat article! Thank you so much for sharing this one really well defined all peaceful info regarding iBeacon BLE Device,I Really like it,Love it- ibeacon app development | ibeacon application development
ReplyDelete