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.