Linux – Mike Richards G4WNC https://photobyte.org Freelance Technical Author, Illustrator & Photographer Fri, 17 Jul 2020 11:22:47 +0000 en-GB hourly 1 https://wordpress.org/?v=6.4.3 Installing & upgrading CQRLOG on a Raspberry Pi https://photobyte.org/installing-upgrading-cqrlog-on-a-raspberry-pi/ https://photobyte.org/installing-upgrading-cqrlog-on-a-raspberry-pi/#comments Tue, 14 Jul 2020 22:26:28 +0000 https://photobyte.org/?p=9865 Updated 17 July 2020 to add missing wildcards from the apt install line!

CQRLOG is one of the most complete contact logging programs for Linux and the Raspberry Pi, but building the latest version from source can be problematic. In this post I’ll show you a simple trick that simplifies the upgrade.

The main source of build problems is database configuration. The simple solution is to first install the old version of CQRLOG fom the Pi repository. To do that, open a terminal session (Ctl-Alt-T) and enter the following line:

sudo apt install cqrlog

By installing from the repository, all the supporting software, including the database application will also be installed. Once the installation has completed you should run CQRLOG by typing cqrlog. Answer’yes’ when asked if you want to store logs on the local machine. This will configure the database and could take a few minutes to complete. Once complete open a log and you will probably see prompts to download various updates, you should accept these. When you’re happy that everything looks ok, close CQRLOG.

With the old version installed and working, we can start the upgrade process. There are two parts to the process. The first is to install some prerequisite packages that are required to support the build. We then download the source code and build the latest version – all with just 6 lines of commands and here they are:

sudo apt install -y lcl*2.0 lazarus*2.0 fp*3.0.4 fpc*3.0.4 libssl-dev
cd ~
git clone https://github.com/ok2cqr/cqrlog.git
cd cqrlog
make
sudo make install

You can now start CQRLOG and you will find that you have the latest version.

Installing an old package from the repository can be a quick way to overcome build problems with other software. It doesn’y always work but can be worth a try.

Mike – G4WNC

]]>
https://photobyte.org/installing-upgrading-cqrlog-on-a-raspberry-pi/feed/ 16
Raspberry Pi – Transfer WSJT-X, JS8Call and FLDIGI settings to a new image https://photobyte.org/raspberry-pi-transfer-wsjt-x-js8call-and-fldigi-settings-to-a-new-image/ https://photobyte.org/raspberry-pi-transfer-wsjt-x-js8call-and-fldigi-settings-to-a-new-image/#comments Fri, 03 May 2019 09:48:34 +0000 https://photobyte.org/?p=2151 Several customers have asked me how they can move their settings and macros from one Pi image to another. This post attempts to simplify the process. To preserve your settings, you just need to copy a few files from the original Pi image to a USB stick and then move them back onto the new image once it is running.

The files to move are:

~/.fldigi/fldigi.prefs

~/.fldigi/macros/macros.mdf. NB: If you have created any personal macro files, they will be stored here and should also be copied.

~/.config/JS8Call.ini

~/.config//WSJT-X.ini

NB: ~ is a shortcut to the Pi home directory, /home/pi

You can use the Pi File Manager to do the move using simple drag and drop.

For those of you that are new to the Pi, here is a step-by-step description of the process:

  1. You need an empty USB memory stick. Any size will do as you’re only storing a few kB of data.
  2. Give the stick a name, i.e. Pidata. This is not essential, but it can make finding it on the Pi a bit easier.
  3. Boot the original Pi image, but don’t run any data modes programs.
  4. Insert the USB stick into the Pi USB socket
  5. You will see a popup on the Pi screen asking if you want to open File Manager; say yes to this.
  6. If you miss the File Manager prompt, you will find the USB stick mounted at: /media/pi/Pidata (or whatever name you gave the stick).
  7. Open a second instance of File Manager by clicking the File Manager icon on the top menu bar.
  8. Make sure the new instance is showing the contents of /home/pi
  9. Arrange the two File Manager instances so they are side-by-side with one showing /home/pi and the other is showing your USB stick.
  10. In the /home/pi File Manager instance, go to the View menu and select Show Hidden. This will reveal a set of hidden directories whose names begin with a period ( . ).
  11. Double-click on .fldigi to see the contents of this directory.
  12. Drag and drop the fldigi.prefs file to the USB stick.
  13. Open the macros directory in .fldigi. Drag and drop all files in this directory with a .mdf suffix.
  14. Click the Up-arrow icon by the address line to return to the /home/pi directory.
  15. Double-click on .config to see the contents of this directory
  16. Drag and drop JS8Call.ini and WSJT-X.ini to the USB stick.
  17. Close both File Managers, shutdown the Pi and remove the USB stick.
  18. Replace the Pi microSD card with the new image and power-up the Pi.
  19. Repeat steps 4 to 10 so that you have the two File Manager instances open.
  20. Navigate to ~/.fldigi and copy fldigi.prefs from the USB stick to that directory.
  21. Navigate to ~/.fldigi/macros and copy all the files with a .mdf suffix to that folder.
  22. Navigate to ~/.config and copy WSJT-X.ini and JS8Call.ini to that directory.
  23. Remove the USB stick, reboot the Pi and all your settings should have been transferred!
]]>
https://photobyte.org/raspberry-pi-transfer-wsjt-x-js8call-and-fldigi-settings-to-a-new-image/feed/ 2
Making a Reduced Size IMG for backups or sharing https://photobyte.org/making-a-reduced-size-img-for-backups/ https://photobyte.org/making-a-reduced-size-img-for-backups/#comments Thu, 01 Oct 2015 07:30:22 +0000 https://photobyte.org/?p=707 Here is a technique for creating an image of an SD card (or any other filesystem) and then reducing the size of that image to exclude unallocated space in the image file system. If you are doing this on a Raspberry Pi you will need to ensure your SD card is large enough to hold both the original and the shrunk image. Alternatively, you could connect an external storage device to hold the images.

Simple Image Creation

Start by creating an image of the SD card with the following command:

sudo dd if=/dev/sdc of=./myImage.img

Where /dev/sdc is the location of the SD card you want to image and ./myImage.img is the desired name and location of the image file.

Better Image Creation

A more sophisticated version of dd can be found by installing dc3dd:

sudo apt-get install -y dc3dd

In addition to creating an image file, dc3dd also provides a progress report and confirmation that the job was completed successfully.

To create an image with dc3dd tool enter:

sudo dc3dd if=/dev/sdc of=./myImage.img

 

Establish the used space and truncate the image

Next you need to know the position of the last allocated sector in the image. To find that type:

fdisk -l myImage.img

The two important details you need from the output are: Units (normally 512 bytes) and the last used sector.

To eliminate the unallocated space from the image use the truncate command as follows:

sudo truncate –size=$[(8447999+1)*512] myImage.img

NB: There are two dashes immediately prior to size in the above – some browsers show this as a single long dash – grrr!

Where 8447999 is the final sector on your image, 512 is the block-size and myImage.img is the  name of the image file you want to shrink. The bracketed section simply adds 1 to the number of blocks in the wanted section and multiplies the total by 512 to calculate the size of the wanted section in bytes. All data above that value is truncated.

That’s it!

What if there’s no unallocated space on the SD Card?

If you have expanded the filesystem on the SD Card but not all the space is in use, you first need to create unallocated space that can be removed later with the truncate command.

To do this, run gparted to view the SD Card’s file system and use the Partition menu to resize the target partition and convert the unused space into unallocated space. Once complete, you can use the truncate command as above to remove it.

]]>
https://photobyte.org/making-a-reduced-size-img-for-backups/feed/ 5