How to quickly create an OP25 USB boot drive (with persistent storage)

Status
Not open for further replies.

johnslabo

Member
Joined
Mar 13, 2014
Messages
10
Hi,

Here is a brief summery of the process that I used to create a USB boot drive, based on the excellent GNU Radio live environment, to run op25 (scope.py, etc...). The whole process should take less than 15 minutes, resulting in a bootable GNU Radio environment that is pretested, integrated, and has 25 additional GNU Radio-based applications and block libraries pre-installed.

This summary assumes the following:

- the GNU Radio v3.7.9.2 live image is used

- you have a cursory familiarity with the Ubuntu operating system that the GNU Radio live image is based on, including the ability to edit files and setup networking

- you know how to boot from a USB drive with your current computer system

Follow these steps:

1. Format a USB drive to FAT32. Insure that the maximum size of the stick is 32GB (or the first bootable partition on a larger USB drive is 32GB or smaller).

2. Download the GNU Radio ISO image from:

GNU Radio live DVD

3. On Windows, download the unetbootin utility from:

UNetbootin

(If you are running Linux, you should be able to do something like 'sudo apt-get install unetbootin').

4. Use unetbootin to create the bootable USB stick:

* Click on 'Diskimage', insure that the dropdown menu is set to 'ISO', and select the GNU Radio ISO file downloaded previously.

* Set a value for 'Space used to preserve files across reboots' (I use 2000 to enable 2GB of persistent storage).

* Insure 'Type' is set to 'USB Drive', and 'Drive' points to your USB drive.

* Click 'OK'

5. When finished, eject and then re-insert the USB drive (do not boot from it yet).

6. Two boot files need to be edited to add 'persistence' (this enables saving any changes to the GNU Radio environment across boots). The GNU Radio live system boots with syslinux.cfg when doing a 'legacy boot', and with grub.cfg when booted via the newer EFI system approach.

Edit file /boot/grub/grub.cfg on the USB drive (if running Windows, don't use Notepad, use Notepad++ [excellent and free] or another editor that preserves the original unix file format). I remove other entries from the boot menu as well, so my grub.cfg file ends up looking like this:

Code:
if loadfont /boot/grub/font.pf2 ; then
	set gfxmode=auto
	insmod efi_gop
	insmod efi_uga
	insmod gfxterm
	terminal_output gfxterm
fi

set menu_color_normal=white/black
set menu_color_highlight=black/light-gray

menuentry "Boot Ubuntu (persistent)" {
	set gfxpayload=keep
	linux	/casper/vmlinuz.efi file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash -- persistent
	initrd	/casper/initrd.lz
}

Now edit file /syslinux.cfg on the USB drive. Mine looks like this:

Code:
default menu.c32
prompt 0
menu title GNU Radio Live SDR Environment
timeout 100

label unetbootindefault
menu label Default
kernel /ubnkern
append initrd=/ubninit file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash -- persistent

label ubnentry1
menu label ^Boot Ubuntu (persistent)
kernel /casper/vmlinuz.efi
append initrd=/casper/initrd.lz file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash -- persistent

7. Now boot the USB drive. Setup networking, and set the correct timezone, date, and time (click on the 'gear' icon on the top, right side of the screen to access 'System Settings').

8. On occasion, you may wish to use Ubuntu's 'apt-get' utility to update and/or install new apps. This is completely optional, but if you wish to do so, open a shell terminal and enter the following commands to eliminate potential errors when using apt-get:

* sudo apt-get remove cryptsetup
* sudo dpkg --configure -a

Now execute:

* sudo apt-get update

You can now use apt-get to install and/or upgrade standard packages if you wish.

9. Next, from a shell terminal, change to directory '/usr/local/src/pybombs_legacy' and do the following:

* Edit file 'config.dat' to change line:

gotoptions = --reference=/root/live/gitcache

to

gotoptions =

* Now you can execute 'sudo ./pybombs install gr-op25' to intsall op25.

* Assuming the prior command executed without error, execute 'sudo ldconfig'


**** General Notes ****

- If you choose to use Ubuntu's 'apt-get' utility, insure that you never update the OS kernel (for example, by executing 'sudo apt-get dist-upgrade')... the USB drive will no longer boot if you do!

- After installing, the working directory for op25 (where scope.py resides) is:

/usr/local/src/pybombs_legacy/src/gr-op25/op25/gr-op25_repeater/apps

- For assistance with setting up op25, watch this video:

OP25 Video

and read these:

Welcome to OP25
Signal Scope

- For additionnal detail on the GNU Radio live environment, read this:

GNU Radio Live SDR Image persistence/versions/etc.


Regards,
JS
 

RayAir

Member
Joined
Dec 31, 2005
Messages
1,930
Thanks for posting this. If I get time next week I'm going to try it.

Is it possible to use the Wireshark patch still?
 

johnslabo

Member
Joined
Mar 13, 2014
Messages
10
Thanks for posting this. If I get time next week I'm going to try it.

Is it possible to use the Wireshark patch still?

The pybombs install in step 9 of the summary downloads, builds, and installs the latest and greatest iteration of gr-op25, as made available by the fine folks behind osmocom.org. The included scope.py code does indeed support for wireshark, although I haven't personally tested it.

To what extent that wireshark itself needs to be patched (as was the case at one point in time, detailed here), I cannot say.

Please do let us know how you make out...thx!


Best,
JS
 

jcardani

Member
Premium Subscriber
Joined
Jan 16, 2002
Messages
1,390
Location
Orlando, FL & Ocean City, NJ
Hi All,

I just performed all the above steps and was successful! I already have OP25 installed on a dual boot Windows/Mint Linux machine but it's sure nice to now have it portable on a USB device!

Installed pretty fast with no errors and verified OP25 files were copied correctly. Next step is to connect and setup the Airspy and create the trunked config files.

And if you follow the directions to a T you should not have any problems.

One of the most frustrating parts was getting unetbootin to recognize the USB flash drive. I thought I formatted the Sandisk correctly to FAT32 but for some reason it would not take. I had Lexar available and that worked fine.

And in step 9 it's gitoptions = (not gotoptions =)

It's also important to set up the networking in the top right panel when you get Ubuntu 14.4 running otherwise you won't have connection to the Internet.
 

johnslabo

Member
Joined
Mar 13, 2014
Messages
10
I just performed all the above steps and was successful! I already have OP25 installed on a dual boot Windows/Mint Linux machine but it's sure nice to now have it portable on a USB device!

Installed pretty fast with no errors and verified OP25 files were copied correctly. Next step is to connect and setup the Airspy and create the trunked config files.

And if you follow the directions to a T you should not have any problems.

Thanks for the feedback Joe!

One of the most frustrating parts was getting unetbootin to recognize the USB flash drive. I thought I formatted the Sandisk correctly to FAT32 but for some reason it would not take. I had Lexar available and that worked fine.

The format tool that I've used for years can be found HERE. It hasn't failed me yet.

And in step 9 it's gitoptions = (not gotoptions =)

Thanks for pointing out the typo. I'll correct it as soon as I have the ability to edit my posts (it appears that I don't have enough posts to this forum to do so at the moment).

Best,
JS
 

jcardani

Member
Premium Subscriber
Joined
Jan 16, 2002
Messages
1,390
Location
Orlando, FL & Ocean City, NJ
Hi John,
Thanks for the tip on formatting. I was successful formatting a 32 GB Sandisk using this method but for some reason another Sandisk was not recognized by any program. Must be a defective drive.

The new environment on the 32BGB Sandisk is much faster than the Lexar I previously created.

There are a number of permission issues. For example if I try to use gedit to edit a file it won't let me save it. Permission denied. And I need to run everything as a super user in the shell.

One nagging problem. I can't get my Airspy SDR to be recognized.
This is after I performed all the correct steps to copy and reload the rules using the following steps.

sudo cp ~/pybombs_legacy/src/airspy/airspy_tools/52-airspy.rules /etc/udev/rules.d/

sudo udevadm control --reload-rules

uplugged Airspy then replugged after 10 seconds

Still does not work. Here's the error message: FATAL: Failed to open AirSpy device (-5) AIRSPY_ERROR_NOT_FOUND

Full ouput is below:

ubuntu@ubuntu:~/src/gr-op25/op25/gr-op25_repeater/apps$ sudo ./scope.py --args "airspy" -N 'IF:12,MIX:12,LNA:12' -S 2500000 -f 852000000 -T orange.tsv -o 12.5e3

(python:4544): IBUS-WARNING **: The owner of /home/ubuntu/.config/ibus/bus is not root!
linux; GNU C++ version 4.8.4; Boost_105400; UHD_003.009.004-0-g2b5a88bb

gr-osmosdr v0.1.4-72-g164a09fc (0.1.5git) gnuradio 3.7.10
built-in source types: file fcd rtl rtl_tcp uhd hackrf bladerf rfspace airspy redpitaya

FATAL: Failed to open AirSpy device (-5) AIRSPY_ERROR_NOT_FOUND

Trying to fill up 1 missing channel(s) with null source(s).
This is being done to prevent the application from crashing
due to gnuradio bug #528.

setting gain IF to 12
setting gain MIX to 12
setting gain LNA to 12
set_center_freq: 0
Traceback (most recent call last):
File "./scope.py", line 2751, in <module>
app = stdgui2.stdapp(p25_rx_block, "APCO P25 Receiver", 3)
File "/usr/local/lib/python2.7/dist-packages/gnuradio/wxgui/stdgui2.py", line 46, in __init__
wx.App.__init__ (self, redirect=False)
File "/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/_core.py", line 7981, in __init__
self._BootstrapApp()
File "/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/_core.py", line 7555, in _BootstrapApp
return _core_.PyApp__BootstrapApp(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/gnuradio/wxgui/stdgui2.py", line 49, in OnInit
frame = stdframe (self.top_block_maker, self.title, self._nstatus)
File "/usr/local/lib/python2.7/dist-packages/gnuradio/wxgui/stdgui2.py", line 76, in __init__
self.panel = stdpanel (self, self, top_block_maker)
File "/usr/local/lib/python2.7/dist-packages/gnuradio/wxgui/stdgui2.py", line 98, in __init__
self.top_block = top_block_maker (frame, self, vbox, sys.argv)
File "./scope.py", line 224, in __init__
self.open_usrp()
File "./scope.py", line 1118, in open_usrp
self.__set_rx_from_osmosdr()
File "./scope.py", line 854, in __set_rx_from_osmosdr
raise RuntimeError("failed to set USRP frequency")
RuntimeError: failed to set USRP frequency


John do you know how I can fix these issues?

thanks!
 

johnslabo

Member
Joined
Mar 13, 2014
Messages
10
Thanks for the tip on formatting. I was successful formatting a 32 GB Sandisk using this method but for some reason another Sandisk was not recognized by any program. Must be a defective drive.

I would agree that if a drive isn't recognized after using the 'SD Formatter' utility, it is likely defective.

The new environment on the 32BGB Sandisk is much faster than the Lexar I previously created.

Thumbdrives vary wildly with respect to performance. I've had great luck with the SanDisk 'Cruzer Glide' series... the GNU Radio environment runs very well and is pretty much indistinguishable from running on a hard drive. If you have support for USB 3.0, those drives will work just as well as a harddrive for this application.

There are a number of permission issues. For example if I try to use gedit to edit a file it won't let me save it. Permission denied. And I need to run everything as a super user in the shell.

Not so much permission issues per se, it's mostly the nature of the Ubuntu environment. There are some permission quirks because it is Live CD implementation, but unless you are working in your home directory, you pretty have to get used to prefixing commands with 'sudo'.

As for airspy, I don't have one at present. The errors that you have posted are pretty much standard when the device isn't found. That said, I didn't see you reference having installed airspy-tools and libairspy. OP25 uses osmosdr, which along with the appropriate libraries supports a variety of SDR's (including airspy). Take a look HERE. Not sure if it's pre-installed with the GNU Radio environment or not... I'm traveling at the moment and can't check.

Also check HERE if you haven't already. Specifically, the following:

Code:
./pybombs install airspy

After it finishes, you can run airspy_info and airspy_rx to test your unit.

Let me know how you make out.

Best,
JS
 

jcardani

Member
Premium Subscriber
Joined
Jan 16, 2002
Messages
1,390
Location
Orlando, FL & Ocean City, NJ
I did ./pybombs install airspy said was already there. But I just rebuilt anyway.

Airspy-info command was not found but the source was in the airspy directory. Doesn't the command above build the airspy programs? Or maybe I'm looking in the wrong place or executing airspy-info wrong.

Lastly once I get this sorted out I want to make some minor changes to the OP25 source code.

The changes I want to make are in the source file within gr-op25_repeater/lib/software_imbe_decoder.cc


If I remember correctly all I need to do is change the source code, save the file, and then rebuild OP25 by executing ./pybombs rb gr-op25 correct?

thanks!
 

johnslabo

Member
Joined
Mar 13, 2014
Messages
10
Airspy-info command was not found but the source was in the airspy directory.

I just took a look on my install ... the airspy tools and associated library are indeed installed. Perhaps you have a typo... but it it should be airspy_info (note the underscore... not a dash). On my install, it's at /usr/local/bin/airspy_info.

The source for the airspy tools and lib is in /usr/local/pybombs_legacy/src/airspy. My environment is based on 3.7.9.2 (as per my first post)... your's may well be built on the later 3.7.10 iteration, but I would be surprised if there was a difference.

If I remember correctly all I need to do is change the source code, save the file, and then rebuild OP25 by executing ./pybombs rb gr-op25 correct?

My preferred approach is to uninstall the package, make changes, and then reinstall. So:

> cd /usr/local/src/pybombs_legacy/src/gr-op25/build
> sudo make uninstall

Make your source changes, and then:

> sudo make install
> sudo ldconfig


Best,
JS
 

jcardani

Member
Premium Subscriber
Joined
Jan 16, 2002
Messages
1,390
Location
Orlando, FL & Ocean City, NJ
Hi John,

Thanks for that! I did find the airspy_info where you said it was. You were right I was using a dash instead of underscore. Executed airspy_info and it also could not find the airspy. Not sure what's going on.

tried reloading rules again and same thing happens.

Airspy SDR is good because I can use it on my desktop.

Also any way I can log in as root? The SDR environment never set a password and I can't change permissions because I'm not logged in as root. Also I can't save stuff and execute different non command line programs because I'm not root. In the shell I use sudo prefix and that seems OK.

thanks

Joe
 

johnslabo

Member
Joined
Mar 13, 2014
Messages
10
Thanks for that! I did find the airspy_info where you said it was. You were right I was using a dash instead of underscore. Executed airspy_info and it also could not find the airspy. Not sure what's going on.

If you are feeling adventurous, I would try the following:

> sudo rm /etc/udev/rules.d/52-airspy.rules
> cd /usr/local/src/pybombs_legacy/src/airspy
> sudo mkdir build
> cd ./build
> sudo cmake ../ -DINSTALL_UDEV_RULES=ON
> sudo make

Now, this next one should work, but I'm not positive because I'm not precisely sure how the airspy support was originally installed:

> sudo make uninstall

Assuming that completed without error:

> sudo ldconfig (probably not required at this point, but won't hurt)
> sudo make install
> sudo ldconfig (required this time)

Now try airspy_info and/or airspy_rx.


Best,
JS
 

jcardani

Member
Premium Subscriber
Joined
Jan 16, 2002
Messages
1,390
Location
Orlando, FL & Ocean City, NJ
Thanks John,

I'll do that and let you know how it goes.

Quick question. Are you good with C? Trying to print some extra things out in OP25 that resides on my desktop.

I was successful with displaying the VC silence frames, but now I'm working on displaying the RID (source) in the LDU1. It's a hex bit array and driving me crazy. I have the P25 spec too if needed.

thanks!
 

eddie555

Member
Joined
Oct 5, 2015
Messages
45
Location
Cincinnati, Ohio
9. Next, from a shell terminal, change to directory '/usr/local/src/pybombs_legacy' and do the following:

* Edit file 'config.dat' to change line:

gotoptions = --reference=/root/live/gitcache

to

gotoptions =

You lost me at "Edit file 'config.dat" to change line.........

In the terminal window, I type CD /usr/local/src/pybombs_legacy

unbutu@ubuntu:/usr/local/src/pybombs_legacy

From there (in Terminal Window), cannot find or edit config.dat
 

rosecitytransit

Member
Feed Provider
Joined
Oct 31, 2010
Messages
228
Location
Portland, Oregon
You lost me at "Edit file 'config.dat" to change line.........

In the terminal window, I type CD /usr/local/src/pybombs_legacy

unbutu@ubuntu:/usr/local/src/pybombs_legacy

From there (in Terminal Window), cannot find or edit config.dat

What command are you using to edit the file? You want to use something like: nano config.dat
 

johnslabo

Member
Joined
Mar 13, 2014
Messages
10
You lost me at "Edit file 'config.dat" to change line.........

In the terminal window, I type CD /usr/local/src/pybombs_legacy

unbutu@ubuntu:/usr/local/src/pybombs_legacy

From there (in Terminal Window), cannot find or edit config.dat

That directory should contain a 'config.dat' file. You need to edit it with the editor of your choice...there are a few to choose from, but perhaps the easiest (especially for folks who are more comfortable in a windows environment) is gedit. So, try entering 'sudo gedit ./config.dat'.

As mentioned later in this thread, don't forget that the line you are looking to modify has 'gitoptions', not 'gotoptions' as per the summary in the first post (I don't have the ability to edit my original post to correct the typo).


Best,
JS
 

jcardani

Member
Premium Subscriber
Joined
Jan 16, 2002
Messages
1,390
Location
Orlando, FL & Ocean City, NJ
Hi JS,

Rayair and I are still having issues getting the Airspy to work in the environment. Reloaded rules, reinstalled s/w per your instruction and upgraded firmware with no luck. Ray got cheap dongles to work but the Airspy continues not to be recognized.

thanks!
 

johnslabo

Member
Joined
Mar 13, 2014
Messages
10
Rayair and I are still having issues getting the Airspy to work in the environment. Reloaded rules, reinstalled s/w per your instruction and upgraded firmware with no luck. Ray got cheap dongles to work but the Airspy continues not to be recognized.
thanks!

To be clear, I doubt there is anything inherent with the process of creating a USB stick based on the GNU Live environment that is causing issues with the airspy being recognized. It's likely an issue with the GNU Live environment itself, or perhaps the installation of the OP25 package is trampling over something the airspy needs.

There are a couple of ways to determine this, both leaving OP25 out of the picture:

1. Just follow ONLY steps 1 through 7 in the first post, plug in your airspy, and then try airspy_info and/or airspy_rx.

2. Just boot from the Live CD itself, plug in your airspy, and then try airspy_info and/or airspy_rx.

If your airspy works in either scenario (if it works in one, it should work in the other), then OP25 is likely the culprit. If it doesn't, you've pretty much proven that there is some sort of issue with the current GNU Radio Live environment and the airspy.


Best,
JS
 
Last edited:

RayAir

Member
Joined
Dec 31, 2005
Messages
1,930
It appears to be a grc issue.

I tried it from a live CD and had the same results.

The AirSpy works fine in other programs.
 

jcardani

Member
Premium Subscriber
Joined
Jan 16, 2002
Messages
1,390
Location
Orlando, FL & Ocean City, NJ
I created the environment on USB successfully a while ago but I have a question. I seems that every Linux command must be prefixed by Sudo otherwise I get a permissions error. Even if I start up Gedit normally, I can't save a file. I have to go into the Terminal and execute Sudo Gedit. Is there a reason that the GNURadio environment does this and is there an easy way to fix this?

thanks!
 
Status
Not open for further replies.
Top