Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scan Rate #141

Open
liyiqiao22 opened this issue Oct 2, 2019 · 6 comments
Open

Scan Rate #141

liyiqiao22 opened this issue Oct 2, 2019 · 6 comments

Comments

@liyiqiao22
Copy link

Hi,

I am using Blue_hydra to monitor traffic in my research. So, I want to capture as many Bluetooth equipped vehicles as possible. I recently found that some of the MAC ID shown on the interface was not recorded into the database and some of them were not stored in blue_hydra_rssi.log file. I am wondering why this is happening? Also, can you provide some explanations on "info_scan_rate"? What is the relationship between "info_scan_rate" and 10.24second inquiry time?

Thanks in advance!

@dimamoose
Copy link

I don't know if this helps, but I think I may have figured this issue out, at least for what I am doing. I have been developing a sophisticated project regarding collecting and analyzing MAC addresses. My Python code was doing the job as intended. Shortly after testing everything, I realized that the blue_hydra's rssi log file was not logging every MAC, and at that point I realized that my project may be a failure. For the BT hardware I was using Ubertooth One and a simple USB BT device. I did some online research and purchased Sena's Parani-UD100-G03 adapter. After using the Sana's adapter, I have noticed that every MAC address is logged almost instantly as it appears, and Python is finally able to tail the change in the rssi log file! As to your info scan rate question, I cannot provide the explanation yet as I am still puzzled by it as well, but just in case, my scan rate is set to 10.

@liyiqiao22
Copy link
Author

Thank you for your reply. I am also using UD100-G03, but still, some of the MAC IDs are not being recorded. Recently, I found that some of the missing MAC IDs are recorded in Blue_hydra.log file. Just curious, what is your python code doing since everything is recorded in log file by blue_hydra?
Regarding the scan rate, there is a comment in the source code saying that if the scan rate lower than 45, it will be automatically set to 45. Therefore, the lowest scan rate that we can use is 45s.

@dimamoose
Copy link

Ok, I pulling all my devices by tailing the rssi log file right now. I am using python3 template 'tailer'
here is the function:
def scanLogBT():

filename = input("Enter log file name: ")
os.system('clear')
repeats = []
try:
    with open(filename + '.txt', 'w') as file_object:
        print("Ctr+C to stop scanning...")
        for line in tailer.follow(open('/root/blue_hydra/blue_hydra_rssi.log')):
            macs = line.split()
            currentDT = datetime.datetime.now()
            if macs[2] not in repeats:
                repeats.append(macs[2])
                file_object.write(f"{line} {currentDT.strftime('%Y-%m-%d@%H:%M:%S')}\n")
            else:
                continue
            print(line)
except FileNotFoundError:
        print("Blue Hydra log must be created. Run Blue Hydra first...")
except KeyboardInterrupt:
    file_object.close()
    print(f"Log is saved to '{filename}.txt'!")

@liyiqiao22
Copy link
Author

Oh, thanks. Are you able to find some missing MAC IDs in blue_hydra.log file? such as "xxxxxxxxx mac id is not being recorded" sort of error message?

@dimamoose
Copy link

dimamoose commented Oct 26, 2019

No, after using senta adapter I am picking up all MACs in discovery mode, however, there is an exception, what I am straggling with is the Ubertooth, I need to scan BT devices that are not in discovery mode. I think I will need to go back to the hardware level using a low level language, developing, writing drivers, design a device and wright something similar to blue hydra.

@liyiqiao22
Copy link
Author

Oh Ok, wish you good luck with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants