greatscottgadgets / ubertooth

Software, firmware, and hardware designs for Ubertooth
https://greatscottgadgets.com/ubertoothone/
GNU General Public License v2.0
1.93k stars 433 forks source link

uh oh, full_usb_buf not emptied AFH map: 0x00000000000000000000 #127

Closed Darokthar closed 7 years ago

Darokthar commented 8 years ago

I just got an ubertooth one. I build the source from git and uploaded the firmware. The output of ubertooth-util is: $ ubertooth-util -v $ Firmware revision: git-fd9748c $ ubertooth-util -V $ ubertooth git-fd9748c (darokthar@DaroktharLaptop) So 22. Nov 21:23:49 CET 2015 I never got more than maybe 3-5 packets, I'm running debian 8. Has anyone the same issue?

Sometimes ubertooth-rx only ends with the message: $ uh oh, full_usb_buf not emptied Othertimes the message is followed by the AFH map: $ uh oh, full_usb_buf not emptied $ AFH map: 0x00000000000000000000

The spectrum analyzer is running smooth without any errors this far.

I think the problem does happen, if there is not much bluetooth traffic, or no bluetooth traffic at all. When putting my Laptop closer to a machine running bluetooth, i'm able to catch more packets. Maybe the device catches packets, which are not valid bluetooth and then shuts down?

dominicgs commented 8 years ago

The "uh oh, full_usb_buf not emptied" error occurs when the host is not able to keep up with the rate that Ubertooth is sending data over USB. This can be for a number of reasons, but in this case it may be an issue with the code from git - there was a recent patch that may have caused some performance issues.

Are you passing any arguments to ubertooth-rx?

Could you try using the 2015-10-R1 release version of libbtbb and Ubertooth?

Darokthar commented 8 years ago

I tried both. Running ubertooth-rx without arguments and ubertooth-rx -l foo -r bar i get the error in both cases. I'll try the 2015-10-R1 release tomorrow.

dominicgs commented 8 years ago

@elli89 I think this may be related to the changes in AFH/hopping pattern calculations. What do you think?

isplitt commented 8 years ago

elli89 will most likely be unavailable till the middle of December - i think if this issue still exists he will look into it then

Darokthar commented 8 years ago

Ok, i removed the libbtbb with cmake/cleanup.sh and installed libbtbb-2015-10-R1/ afterwards. Then i compiled and installed 2015-10-R1 and checked with ubertooth-util -v and ubertooth-util -V if everything is correct. Both say i installed the 2015-10-R1 version.

The error still occurs after a while. Is the ubertooth data transfer rate increased, if it is unable to catch a lot of bluetooth packets?

dominicgs commented 8 years ago

The Ubertooth data transfer rate is constant, it passes a stream of symbols to the host system, where the libbtbb code searches for packets.

I have some ideas to lessen the impact of the full_usb_buf error, so I'll take a look at that as soon as I can.

gripet commented 8 years ago

I have the same problem 2015-10-R1, Firmware revision: git-f33b0ea Is there any news about this problem?

asad-lesani commented 8 years ago

I also have the same issue, even for 15 seconds scan I get this error. I tried different high performance processor with Ubuntu on it. Any new?

el-han commented 8 years ago

I just uploaded a patch that uses a bigger receive buffer for usb bulk transfers and might solve this issue. @gripet @Darokthar could you please test it and report if it makes a difference?

Please note that I have also changed the behaviour in the way that the software does not stop on a buffer overflow so you would have to search for the error message "uh oh, full_usb_buf not emptied" in the program output.

asad-lesani commented 8 years ago

Can I know where the patch is?

On Tuesday, 5 July 2016, Hannes Elinger notifications@github.com wrote:

I just uploaded a patch that uses a bigger receive buffer for usb bulk transfers and might solve this issue. @gripet https://github.com/gripet @Darokthar https://github.com/Darokthar could you please test it and report if it makes a difference?

Please note that I have also changed the behaviour in the way that the software does not stop on a buffer overflow so you would have to search for the error message "uh oh, full_usb_buf not emptied" in the program output.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/greatscottgadgets/ubertooth/issues/127#issuecomment-230432354, or mute the thread https://github.com/notifications/unsubscribe/ADP9og58Fv5PEX-g0HJEneWJ0Z_KSNLBks5qSiXEgaJpZM4GnL-u .


Asad Lesani PhD Candidate Civil Engineering McGill University, Montreal, QC, Canada Email(s): asad.lesani@mail.mcgill.ca asad.lesani@gmail.com asad.lesani@gmail.com

el-han commented 8 years ago

Please clone my fork of the Ubertooth project 'https://github.com/elli89/ubertooth' and checkout the branch 'ringbuffer_fifo'. Be sure to use the git master of libbtbb and a current firmware on your Ubertooth stick. You can find a firmware binary at https://github.com/elli89/ubertooth/releases/tag/2016-07-alpha

asad-lesani commented 8 years ago

if I get it correctly I should follow these steps:

install llibbtbb from this link:

wget https://github.com/greatscottgadgets/libbtbb/archive/2015-10-R1.tar.gz
-O libbtbb-2015-10-R1.tar.gz

then, install you ubertooh library from your link: https://github.com/elli89/ubertooth.git

and also flash the 2015-10-R1 firmware on module hardware using the link: https://github.com/greatscottgadgets/ubertooth/releases/tag/2015-10-R1

Am I correct?

On Tue, Jul 5, 2016 at 8:34 AM, Hannes Elinger notifications@github.com wrote:

Please clone my fork of the Ubertooth project ' https://github.com/elli89/ubertooth' and checkout the branch 'ringbuffer_fifo'. Be sure to use the git master of libbtbb and a current firmware on your Ubertooth stick. You can find a firmware binary at https://github.com/elli89/ubertooth/releases/tag/2016-07-alpha

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/greatscottgadgets/ubertooth/issues/127#issuecomment-230465393, or mute the thread https://github.com/notifications/unsubscribe/ADP9olw4Haccwr0p45b86n25uupYdXAKks5qSk87gaJpZM4GnL-u .


Asad Lesani PhD Candidate Civil Engineering McGill University, Montreal, QC, Canada Email(s): asad.lesani@mail.mcgill.ca asad.lesani@gmail.com asad.lesani@gmail.com

dominicgs commented 8 years ago

@asad-lesani Almost correct. You will need to use the very latest (unreleased) version of libbtbb, which can be found here: https://github.com/greatscottgadgets/libbtbb/archive/master.zip

Use that instead of https://github.com/greatscottgadgets/libbtbb/archive/2015-10-R1.tar.gz

asad-lesani commented 8 years ago

Perfect, let me try that. Should I still use the 2015-10-R1 firmware on Ubertooth dongle?

On Tue, Jul 5, 2016 at 10:49 AM, Dominic Spill notifications@github.com wrote:

@asad-lesani https://github.com/asad-lesani Almost correct. You will need to use the very latest (unreleased) version of libbtbb, which can be found here: https://github.com/greatscottgadgets/libbtbb/archive/master.zip

Use that instead of https://github.com/greatscottgadgets/libbtbb/archive/2015-10-R1.tar.gz

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/greatscottgadgets/ubertooth/issues/127#issuecomment-230500484, or mute the thread https://github.com/notifications/unsubscribe/ADP9otjnTf102Vmjc7bAYlk708O7oxRyks5qSm7kgaJpZM4GnL-u .


Asad Lesani PhD Candidate Civil Engineering McGill University, Montreal, QC, Canada Email(s): asad.lesani@mail.mcgill.ca asad.lesani@gmail.com asad.lesani@gmail.com

asad-lesani commented 8 years ago

I tried to install the libraries, after that I get this error:

ubertooth-rx
libUSB Error: Command Error:  (-9)
Ubertooth running very old firmware found.
Please upgrade to latest released firmware.

The firmware of the module is the latest one and I can confirm it with ubertooth-util -v that shows: Firmware revision: 2015-10-R1. The version of the library is also (using ubertooth-util -V): ubertooth 2015-10-R1 (dominicgs@hydrogen) Mon Oct 12 22:30:56 BST 2015 Do you have any idea about the issue?

dominicgs commented 8 years ago

Try this firmware that I've just built: https://dominicspill.com/ubertooth/bluetooth_rxtx.dfu

asad-lesani commented 8 years ago

I have updated the firmware to new version and it shows: Firmware revision: git-3c0f8ec. But still after a while I get the error of uh oh, full_usb_buf not emptied

tomsaul commented 8 years ago

I'm new to GitHub, so perhaps I am missing something obvious, but I am looking for the stuff from elli89 referenced above, and I am not seeing the releases and tags he mentioned in his repo. Specifically the ringbuffer_fifo branch, and the new firmware release. For the latter, does the version posted by dominicgs contain the same fixes?

asad-lesani commented 8 years ago

I tied this firmware and the new library but still I'm getting the same error after a while.

On Tue, Jul 5, 2016 at 11:44 AM, Dominic Spill notifications@github.com wrote:

Try this firmware that I've just built: https://dominicspill.com/ubertooth/bluetooth_rxtx.dfu

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/greatscottgadgets/ubertooth/issues/127#issuecomment-230517384, or mute the thread https://github.com/notifications/unsubscribe/ADP9olIr1tMz7o9CfCvmkhK_GOCLSGzAks5qSnvbgaJpZM4GnL-u .


Asad Lesani PhD Candidate Civil Engineering McGill University, Montreal, QC, Canada Email(s): asad.lesani@mail.mcgill.ca asad.lesani@gmail.com asad.lesani@gmail.com

tomsaul commented 8 years ago

ubertooth-scan

I installed the firmware provided by dominicgs above, and rebuilt libbtbb and the tools from the current GIT master. When I run any of the tools I get something similar to the following.

Ubertooth API version 0 found, libubertooth requires 1. Please upgrade to latest released firmware.

I'm now trying to build the firmware from the same pull, and it will not compile - problem finding crt0.o - I'll take a closer look later today, but any suggestions (on either problem)?

dominicgs commented 8 years ago

The changes from @elli89 have been merged in to master. You will need to use git versions of libbtbb, ubertooth and the ubertooth firmware.

I have no idea where crt0.o is meant to be coming from. Could you give more information on the problem building the firmware (perhaps in a new issue report?).

tomsaul commented 8 years ago

I will open a new ticket shortly

village-idiot commented 8 years ago

I see this when piping data using 'stdbuf' or 'expect_unbuffer' using ubertooth-rx and ubertooth-btle. While I do not see this error message when using 'unbuffer' it still stops frequently and unpredictably when 'unbuffer' is used. I have found no time or sequence of events that trigger this, it seems purely random. The reason for using 'unbuffer' and variants is to eliminate the delay of displayed data when commands are piped. Seems Linux uses a 4K buffer for efficiency when it detects piping thinking the command result is not being viewed real time.

tomsaul commented 8 years ago

re the buffer fix, I have been testing this for the last couple of days, and it does seem to have helped. I am still seeing the messages occasionally, but it seems to recover. The one possible issue is that it does seem to 'go to sleep' for about a minute after one of these errors occurs (using ubertooth-scan). I never get any samples for a while after I see this - I'll continue to test, but this is definitely a large step forward.

dominicgs commented 8 years ago

As @elli89 commented in another issue report, we're unlikely to be able to completely stop this from happening, but we can probably do a lot to reduce it. It looks like those efforts are paying off. I think we'll need to change the messaging to make it more clear what is happening.

village-idiot commented 8 years ago

Will the firmware update alone increase the time between error messages? Or will it take all the steps outlined above to obtain the best results?

dominicgs commented 8 years ago

You don't need the steps above as I've now merged these changes in to the master git repository. However, you will need to build and run the latest code from git for both libbtbb and Ubertooth, including updating the firmware.

village-idiot commented 8 years ago

Ok cloned : git clone git://github.com/greatscottgadgets/libbtbb Created the 'build' directory, cd to the 'build' directory, then run: cmake .. make make install

Indicated the installation was completed.

Then cloned : git clone git://github.com/greatscottgadgets/ubertooth First thing I noticed is there is no CMakeLists.txt in the 'ubertooth' directory.

Did I grab the wrong files?

dominicgs commented 8 years ago

You have the right files, you're just in the wrong part of the directory structure. To build the host tools you need to be in the host/ subdirectory. Then it's:

mkdir build
cd build
cmake ..
make
sudo make install
village-idiot commented 8 years ago

Fantastic. Should have run 'find' and would have stumbled right into it. I am finding directories with the firmware source but not the bluetooth_rxtx.dfu name. Before I wander off and brick a card is the 'bluetooth_rxtx.dfu' filename lurking in the ubertooth directory or should I use the link to the version you listed above at:

https://dominicspill.com/ubertooth/bluetooth_rxtx.dfu

village-idiot commented 8 years ago

Fantastic. Should have run 'find' and would have stumbled right into it. I am finding directories with the firmware source but not the bluetooth_rxtx.dfu name. Before I wander off and brick a card is the 'bluetooth_rxtx.dfu' filename lurking in the ubertooth directory or should I use the link to the version you listed above at:

https://dominicspill.com/ubertooth/bluetooth_rxtx.dfu

dominicgs commented 8 years ago

bluetooth_rxtx.dfu is the compiled firmware, but we only put the source in the repository. You can either build your own or download the linked version, I believe either should work.

village-idiot commented 8 years ago

Many thanks. I attempted to use ubertooth-dfu to download the firmware from your link to the device but it kept balking about an Ubertooth-One not being found. At that point dropped into the source file directory were you stowed Bluetooth_rxtx and ran the line: make clean all && make && ubertooth-dfu -r -d bluetooth_rxtx.dfu

There was an error message of: libUSB Error: No Device: Check Ubertooth is connected to host (-4) and then it dropped back to a prompt. In another terminal window running: ubertooth-util -U0 -v returned the line

Firmware Revision: git-2bc6502

I compared this to another card that was known to be running with the 2015-10-R1 firmware and it returned the information matching the original firmware. I took the second card and ran: make clean all && make && ubertooth-dfu -r -d bluetooth_rxtx.dfu again. It still balked that a device was not found after finish running but again a check revealed the more recent firmware version 'git-2bc6502'.

The firmware is updating. Not sure what is amiss with my procedure.

Thanks for the guidance.

VI

tomsaul commented 8 years ago

There were comments about this elsewhere - with the thought being that it was just a timing issue - the update triggers a device reboot, and it is not recovering fast enough for the program to get the status.

From my experience it completes, so its really a false alarm.

dominicgs commented 8 years ago

Try running ubertooth-dfu -d bluetooth_rxtx.dfu What output do you get?

village-idiot commented 8 years ago

It yields the same error message about the device not being found. ubertooth-dfu -d bluetooth_rxtx.dfu was the first attempt to load the firmware downloaded from your link and produced the message ' libUSB Error: No Device: Check Ubertooth is connected to host (-4)'. It was after that I tried the build instructions I found in another message chain. It makes me wonder if ubertooth-dfu -d bluetooth_rxtx.dfu is actually successful but the error message is masking reality. I think I have one more unmolested ubertooth-one card. Will try incrementally testing and see where the first hint of a successful firmware update takes place.

One thing I did notice is the screen display is scrolling about four times as fast as it did previously when in a densely populated bluetooth environment.

I have a recently delivered Dell box with quad core I-7 chipset. If I can get Kali to play nicely with it I will try the Ubertooth tools on it. My first attempt a few weeks back with Fedora on the new Dell was an exercise in creatively uttering expletives.

Thanks

VI

dominicgs commented 8 years ago

Your previous comment said that you had an extra -r argument to ubertooth-dfu. I was asking you to try it without.

Are you running in a virtual machine?

On 2 Aug 2016 1:12 a.m., "Neville Eckerson" notifications@github.com wrote:

It yields the same error message about the device not being found. ubertooth-dfu -d bluetooth_rxtx.dfu was the first attempt to load the firmware downloaded from your link and produces the message ' libUSB Error: No Device: Check Ubertooth is connected to host (-4)'. It was after that I tried the build instructions I found in another message chain. It makes me wonder if ubertooth-dfu -d bluetooth_rxtx.dfu is actually successful but the error message is masking reality. I think I have one more unmolested ubertooth-one card. Will try incrementally testing and see where the first hint of a successful firmware update takes place.

Thanks

VI

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/greatscottgadgets/ubertooth/issues/127#issuecomment-236750046, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFmY2mi6d5hSfVsjDncwz6iNukTPoL8ks5qbouCgaJpZM4GnL-u .

village-idiot commented 8 years ago

My apology for lack of attention to the details. I will try it without the '-r' and report back.

No virtual machines are being used. Straight up loads of Kali or Fedora are used on bootable flash. I find virtual machines useful in production once the app is vetted but for development I just do not want the snake in the grass problems that seem to come with the additional variables in VM's. With USB 3.0, cheap flash drives etc it seems much more convenient to simply make bootable flash drives and run from them. If one is corrupted I simply reach in the drawer for a clone of yesterdays end of day effort.

village-idiot commented 8 years ago

Dominic Ran: 'ubertooth-dfu -d bluetooth_rxtx.dfu

Voila! No error message. Grabbed my son's ubertooth card and ran: 'make clean all && make && ubertooth-dfu -d bluetooth_rxtx.dfu' (dropped the -r switch) and it similarly exited without error.

Now what happens with the cards without running the '-r' switch is the card is found to be running the row of colored LED's in a back and forth pattern (Green, Yellow, Red, Red). This is addressed by unplugging the card and re-inserting it into the USB port.

On the URL at: https://github.com/greatscottgadgets/ubertooth/wiki/Firmware it indicates that removing and reinserting is appropriate for resetting the card. It also states the command: ubertooth-dfu --detach will perform the same function however when I ran the above line 'ubertooth-dfu' simply displayed the help menu.

Then using the '-r' switch alone with ubertooth-dfu returned the error message: libUSB Error: No Device: Check Ubertooth is connected to host (-4)

The back and forth LED pattern stopped however and normal comms with the device seemed to resume as I could use other ubertooth tools with the device after running ubertooth-dfu -r

All cards are now running the same firmware and the other Ubertooth tools seem to be working as well as if not better than before.

Thanks for your patience.

VI

bsamuels453 commented 7 years ago

for anyone who found this on google: since the firmware link on @dominicgs 's website died, you can compile that firmware yourself:

  1. download @elli89 's ubertooth master branch here: https://github.com/elli89/ubertooth/archive/master.zip
  2. follow compile instructions here under "Developing Firmware" https://github.com/greatscottgadgets/ubertooth/wiki/Firmware
tomsaul commented 7 years ago

Should this issue also be closed with the latest firmware/tools?

dominicgs commented 7 years ago

I think it could be, but I'd like one of the users who has seen this issue to confirm that they no longer see it.

tomsaul commented 7 years ago

OK - I have been using a build with some of the earlier patches and have been fine, but I'll try to install this new version and run for a while to confirm. I'll report then!

asad-lesani commented 7 years ago

Hello,

Could you tell me the location of latest firmware then I can upgrade it on my modules to check if it is working? Then I would be able confirm it.

Thanks.

On Tue, Apr 4, 2017 at 2:27 PM, Dominic Spill notifications@github.com wrote:

I think it could be, but I'd like one of the users who has seen this issue to confirm that they no longer see it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/greatscottgadgets/ubertooth/issues/127#issuecomment-291590187, or mute the thread https://github.com/notifications/unsubscribe-auth/ADP9otC9vreBNl4Qa6v_vmgaOMeuNM2aks5rsouUgaJpZM4GnL-u .

--

Asad Lesani PhD Candidate Civil Engineering McGill University, Montreal, QC, Canada Email(s): asad.lesani@mail.mcgill.ca asad.lesani@gmail.com asad.lesani@gmail.com

dominicgs commented 7 years ago

@asad-lesani There are binary firmware files included in the release package (ubertooth-2017-03-R2.tar.xz) available from: https://github.com/greatscottgadgets/ubertooth/releases/tag/2017-03-R2

You'll also need to upgrade libbtbb to the latest version, available from here: https://github.com/greatscottgadgets/libbtbb/releases/tag/2017-03-R2

asad-lesani commented 7 years ago

Perfect,

I'll try these versions and leave it running for some days to see how it works.

Asad.

On Tue, Apr 4, 2017 at 3:44 PM, Dominic Spill notifications@github.com wrote:

@asad-lesani https://github.com/asad-lesani There are binary firmware files included in the release package (ubertooth-2017-03-R2.tar.xz) available from: https://github.com/greatscottgadgets/ubertooth/ releases/tag/2017-03-R2

You'll also need to upgrade libbtbb to the latest version, available from here: https://github.com/greatscottgadgets/libbtbb/releases/tag/2017-03-R2

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/greatscottgadgets/ubertooth/issues/127#issuecomment-291610893, or mute the thread https://github.com/notifications/unsubscribe-auth/ADP9oiXbASuYUyjuWnUvt3HbUedohYUiks5rsp23gaJpZM4GnL-u .

--

Asad Lesani PhD Candidate Civil Engineering McGill University, Montreal, QC, Canada Email(s): asad.lesani@mail.mcgill.ca asad.lesani@gmail.com asad.lesani@gmail.com

dominicgs commented 7 years ago

@asad-lesani Any update on this?

tomsaul commented 7 years ago

I've been running the updated version for a few days on two systems now with no noticeable problem.

dominicgs commented 7 years ago

Thanks Tom! I'm going to close this issue.

Please let me know, or reopen the issue, if you see the error again.