Skip to content

Instantly share code, notes, and snippets.

@dirksan28
Last active February 8, 2022 07:47
Show Gist options
  • Save dirksan28/4180b8732db125be7819286793992e8e to your computer and use it in GitHub Desktop.
Save dirksan28/4180b8732db125be7819286793992e8e to your computer and use it in GitHub Desktop.

The head revision FW does not work with my rad1o badge

list of open questions

  1. does the new FW utilize some HW-Components which may be broken (from the beginning) but never used by the old FW?

HiRes Pictures of the rad1o board

Click to expand!

Front1 Front2 left right

Old Firmware + Old libhackrf+tools (works fine)

  • stock fw (rad1o-old & rad1o-app + apt install hackrf)
root@ubuntu:~/rad1o/f1rmware/hackrf/host/build# hackrf_info 
Found HackRF board 0:
USB descriptor string: 0000000000000000a83065d921755327
Board ID Number: 3 (Unknown Board ID)
Firmware Version: git-e1234bc
Part ID Number: 0xa0000a30 0x00714747
Serial Number: 0x00000000 0x00000000 0xa83065d9 0x21755327

root@ubuntu:~/rad1o/f1rmware/hackrf/host/build# hackrf_transfer -r /dev/null
call hackrf_sample_rate_set(10000000 Hz/10.000 MHz)
call hackrf_baseband_filter_bandwidth_set(9000000 Hz/9.000 MHz)
call hackrf_set_freq(900000000 Hz/900.000 MHz)
Stop with Ctrl-C
19.9 MiB / 1.000 sec = 19.9 MiB/second
19.9 MiB / 1.001 sec = 19.9 MiB/second
20.2 MiB / 1.000 sec = 20.2 MiB/second
19.7 MiB / 1.001 sec = 19.6 MiB/second
20.2 MiB / 1.001 sec = 20.2 MiB/second
19.9 MiB / 1.001 sec = 19.9 MiB/second
^CCaught signal 2
 0.8 MiB / 0.032 sec = 24.9 MiB/second

User cancel, exiting...
Total time: 6.03586 s
hackrf_stop_rx() done
hackrf_close() done
hackrf_exit() done
fclose(fd) done
exit

head revision of firmware + libhackrf (does NOT work)

  • checked against (clean installed ubuntu 16.04, 18.04, 20.04) on VMware and (USB-stick) live system on real hardware
  • the firmware-binary (on the rad1o) has been checkt by schneider to be ok
  • source https://github.com/greatscottgadgets/hackrf
f1rmware/hackrf/host/build/cmake ..
f1rmware/hackrf/host/build/make
sudo f1rmware/hackrf/host/build/make install
sudo f1rmware/hackrf/host/build/ldconfig
dirk@vm-xubuntu18-04:~/hackrf/hackrf/firmware/hackrf_usb/build$ hackrf_info 
hackrf_info version: git-aec108b
libhackrf version: git-aec108b (0.6)
Found HackRF
Index: 0
Serial number: 0000000000000000a83065d921755327
Board ID Number: 3 (rad1o)
Firmware Version: git-bf84a3a (API:1.05)
Part ID Number: 0xa0000a30 0x00714747

dirk@vm-xubuntu18-04:~/hackrf/hackrf/firmware/hackrf_usb/build$ hackrf_transfer -r /dev/null 
call hackrf_set_sample_rate(10000000 Hz/10.000 MHz)
call hackrf_set_hw_sync_mode(0)
call hackrf_set_freq(900000000 Hz/900.000 MHz)
Stop with Ctrl-C
 0.0 MiB / 1.001 sec =  0.0 MiB/second, amplitude -inf dBfs

Couldn't transfer any bytes for one second.

Exiting... hackrf_is_streaming() result: HACKRF_TRUE (1)
Total time: 1.00153 s
hackrf_stop_rx() done
hackrf_close() done
hackrf_exit() done
fclose() done
exit

Misc

The old FW does not work with the new CPLD image

Sometime during testing I've flashed the CPLD code from the trunc HackRF-FW release to the rad1o. This led to the old FW/libhackrf combination also showing the Couldn't transfer any bytes for one second. error.

A downgrade to the CPLD code from https://github.com/greatscottgadgets/hackrf/releases/tag/v2017.02.1 fixed the issue. This is not a problem because the current FW release brings the CPLD code "on the fly" anyway.

libhackrf was/will not be fully removed by apt purge - the leftovers may conflict tests and operation.

Short prove (which will "work" on ubuntu 16,18 and 20.04)

$ sudo apt install hackrf
$ sudo apt purge hackrf

The libs are still there

$ dpkg -l|grep hack
ii  libhackrf0:amd64                           2015.07.2-6                                     amd64        Software defined radio peripheral - runtime library

$ find / -name "libhackrf*" 2>/dev/null
/usr/share/doc/libhackrf0
/usr/local/include/libhackrf
/usr/lib/x86_64-linux-gnu/libhackrf.so.0
/usr/lib/x86_64-linux-gnu/libhackrf.so.0.4.0

Solution: apt purge hackrf libhackrf0 followed by a apt autoremove does the trick!

Ubuntu 20.04 Example

Click to expand!
dirk@ubuntu:~/Desktop$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.3 LTS
Release:	20.04
Codename:	focal
dirk@ubuntu:~/Desktop$ dpkg -l|grep hack
dirk@ubuntu:~/Desktop$ find / -name "libhackrf*" 2>/dev/null
dirk@ubuntu:~/Desktop$ 
dirk@ubuntu:~/Desktop$ sudo apt install hackrf
Reading package lists... Done
Building dependency tree
 ...
dirk@ubuntu:~/Desktop$ dpkg -l|grep hack
ii  hackrf                                     2018.01.1-2                           amd64        Software defined radio peripheral - utilities
ii  libhackrf0:amd64                           2018.01.1-2                           amd64        Software defined radio peripheral - runtime library
dirk@ubuntu:~/Desktop$ find / -name "libhackrf*" 2>/dev/null
/usr/share/doc/libhackrf0
/usr/lib/x86_64-linux-gnu/libhackrf.so.0
/usr/lib/x86_64-linux-gnu/libhackrf.so.0.5.0
/var/lib/dpkg/info/libhackrf0:amd64.md5sums
/var/lib/dpkg/info/libhackrf0:amd64.conffiles
/var/lib/dpkg/info/libhackrf0:amd64.shlibs
/var/lib/dpkg/info/libhackrf0:amd64.triggers
/var/lib/dpkg/info/libhackrf0:amd64.list
/etc/modprobe.d/libhackrf0.conf
dirk@ubuntu:~/Desktop$ sudo apt purge hackrf
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  libhackrf0
Use 'sudo apt autoremove' to remove it.
The following packages will be REMOVED:
  hackrf*
0 upgraded, 0 newly installed, 1 to remove and 148 not upgraded.
After this operation, 134 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 171277 files and directories currently installed.)
Removing hackrf (2018.01.1-2) ...
Processing triggers for man-db (2.9.1-1) ...

dirk@ubuntu:~/Desktop$ 

At this point there should no leftover libraries in a functional manner... ;-(

dirk@ubuntu:~/Desktop$ dpkg -l|grep hack
ii  libhackrf0:amd64                           2018.01.1-2                           amd64        Software defined radio peripheral - runtime library

dirk@ubuntu:~/Desktop$ find / -name "libhackrf*" 2>/dev/null
/usr/share/doc/libhackrf0
/usr/lib/x86_64-linux-gnu/libhackrf.so.0
/usr/lib/x86_64-linux-gnu/libhackrf.so.0.5.0
/var/lib/dpkg/info/libhackrf0:amd64.md5sums
/var/lib/dpkg/info/libhackrf0:amd64.conffiles
/var/lib/dpkg/info/libhackrf0:amd64.shlibs
/var/lib/dpkg/info/libhackrf0:amd64.triggers
/var/lib/dpkg/info/libhackrf0:amd64.list
/etc/modprobe.d/libhackrf0.conf

autoremove helps!

irk@ubuntu:~/Desktop$ sudo apt autoremove
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  libhackrf0
0 upgraded, 0 newly installed, 1 to remove and 148 not upgraded.
After this operation, 52.2 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 171261 files and directories currently installed.)
Removing libhackrf0:amd64 (2018.01.1-2) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
dirk@ubuntu:~/Desktop$ dpkg -l|grep hack
rc  libhackrf0:amd64                           2018.01.1-2                           amd64        Software defined radio peripheral - runtime library
dirk@ubuntu:~/Desktop$ find / -name "libhackrf*" 2>/dev/null
/var/lib/dpkg/info/libhackrf0:amd64.list
/etc/modprobe.d/libhackrf0.conf
dirk@ubuntu:~/Desktop$ sudo apt purge libhackrf0
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  libhackrf0*
0 upgraded, 0 newly installed, 1 to remove and 148 not upgraded.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 171254 files and directories currently installed.)
Purging configuration files for libhackrf0:amd64 (2018.01.1-2) ...
dirk@ubuntu:~/Desktop$ dpkg -l|grep hack
dirk@ubuntu:~/Desktop$ find / -name "libhackrf*" 2>/dev/null
dirk@ubuntu:~/Desktop$ 
@dirksan28
Copy link
Author

dirksan28 commented Jan 13, 2022

Q: does the rad1o board deliver phantom voltage for an active antenna?
A: not by default. You have to solder an inductor next to antenna port to enable phantom pwr.

At the original hackrf this is made switchable by software.

Note to myself: RTFM upfront and CAREFULLY -> https://frab.cccv.de/system/event_attachments/attachments/000/002/814/original/rad1o-32c3.pdf

@dirksan28
Copy link
Author

dirksan28 commented Jan 17, 2022

Until that "Couldn't transfer any bytes for one second." error even appears using the old FW, if hackrf_transfer was started a 2nd time. I have done a fresh firmware setup based on https://rad1o.badge.events.ccc.de/howto:build <-Recovery method. Now it works!

Note: Compile and use DFU-Util from the rad1o repo https://github.com/rad1o/f1rmware.git !

@schneider42
Copy link

@dirksan28 Sorry for not following up until now. I'm not sure how to interpret your last post. Does the new firmware now work for you?

@dirksan28
Copy link
Author

dirksan28 commented Feb 7, 2022

Hi @schneider42 - nice to hear from you. Unfortunately I've had not much time to look after that issue the last few weeks either ;-)

The current situation is as follows:

  • After a lot of tries I found me in a situation where even the old camp firmware did not work properly (if I started hackrf_transfer -r /dev/null all seams to be ok, but actrl-cfollowed by a second start of hackrf_transfer produced that well known Couldn't transfer any bytes for one second. error again.

  • so I decided to do a fresh install using the the FLASHgui approach described here https://rad1o.badge.events.ccc.de/howto:build (based on the master-revision of https://github.com/rad1o/f1rmware)

  • that now led to a situation where the rad1o works. I've tested it with hackrf_transfer, hackrf_sweep, gqrx and other software - all worked fine

  • the only downside is, that I have to turn the rad1o off and on again all the time - using the pwr-switch on the pcb.

    • If I just put it into the usb-port of the computer it still fails with "Couldn't transfer any bytes...".
    • But - by leaving the rad1o connected to the computer and then just switching the rad1o off and on again, all will work fine afterwards. (regardless whether the lipo is connected or not)

So it works now - a kind of.
But as a result of all that experiments - I'm more confident now that there is no hardware fault. What do you think?

Just saw that your latetest pull request at https://github.com/greatscottgadgets/hackrf has been merged now. Maybe I should give that another try...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment