🛠️

Red Pitaya OS Update

What are you looking for?

Background

A Red Pitaya SD card contains two partitions:
  1. 128 MB FAT containing the ecosystem:
      • Boot files: FSBL, FPGA images, U-Boot, Linux kernel
      • Red Pitaya API libraries and header files
      • Red Pitaya web applications, scripts, tools
      • Customized Nginx web server
  1. ~4 GB Ext4 containing the OS:
      • Ubuntu/Debian OS
      • Various libraries
      • Network setup customization
      • Systemd services customization
Most of Red Pitaya’s source code translates into the ecosystem, which is updated more frequently. The OS is changed less often.
Note
You can find older and developed Red Pitaya OS images and Ecosystem zip files on our download server.
Note
A list of new features, bug fixes, and known bugs for each Red Pitaya release can be found in our CHANGELOG.

Resize file system

When recording an image to a flash card of any size, the file system is initially 4 GB. To increase the available free space, execute the following script:
graphqlKopiraj kodo root@rp-f03dee:~# /opt/redpitaya/sbin/resize.sh
After the script completes, the system will prompt you to restart your Red Pitaya. If done correctly, the system will start with increased space size, which can be checked with the following command:
graphqlKopiraj kodo root@rp-f03dee:~# df -h
Note
If the file system size has not changed, you can try to manually run the command:
graphqlKopiraj kodo root@rp-f03dee:~# sudo resize2fs /dev/mmcblk0p2

How to upgrade the OS using the web interface?

notion image
At boot, Red Pitaya checks for software updates and alerts the user if a new release is available. Users can also check for updates manually.
  1. Open the Red Pitaya desktop using your web browser.
  1. Click on the upgrade alert or on the ecosystem version label in the bottom right corner.
  1. Select the ecosystem version and start the OS updater.
  1. Follow the steps in the OS updater app to install the new OS.
The OS upgrade might cause your Red Pitaya desktop to freeze for a few minutes.
If the updates don’t work, you can always manually upgrade the OS.

How to manually upgrade the OS?

All OS versions are available on this link (locate your board model and download the appropriate OS version):

Download and install the SD card image

The following procedure creates a clean SD card image.
  1. Select an appropriate OS version from the above link and download it.
    1. notion image
  1. Unzip the SD card image.
  1. Write the image onto an SD card. Instructions are available for various operating systems:
  1. Insert the SD card into the Red Pitaya.
    1. notion image

Installing OS on the SD card for Windows Users

  1. Insert the SD card into your PC or SD card reader.
    1. notion image
  1. Download Balena Etcher and install it.
  1. Open the newly installed Balena Etcher application.
    1. notion image
  1. Under Flash from file, select the unzipped Red Pitaya image file.
    1. notion image
  1. Under Select target, choose the drive letter of the SD card. Balena Etcher will only show external drives.
    1. notion image
      Note
      Balena Etcher will only show external drives, but please be careful to select the correct drive if you have multiple cards or USBs plugged into your computer. Choosing the wrong one risks erasing data from the selected drive. You can easily see the drive letter (for example, E:) by looking in the left column of Windows Explorer.
      notion image
  1. When you click Flash, the computer will prompt you to allow the operation. Click Yes and wait for the flashing and validation to complete.
    1. notion image
  1. Close Balena Etcher.
    1. notion image

Installing OS on the SD card for Linux Users

Note
You can also use Balena Etcher on Linux and macOS. Instructions are under the Windows section.

Using Image Writer on Ubuntu

  1. Right-click on the extracted SD card image and select Open With > Disk Image Writer.
    1. notion image
  1. In the Restore Disk Image window, select your SD card in the Destination pull-down menu. Be careful to select the correct device; use the size for orientation (for example, a 16 GB SD card).
    1. notion image
  1. You will be asked to confirm your choice and enter a password. Additional dialog windows will again show the selected destination drive. Take the opportunity to reconsider whether you chose the right device.
    1. notion image

Using Command Line

Note
Please note that the use of the dd tool can overwrite any partition of your machine. If you specify the wrong device in the instructions below, you could delete your primary Linux partition. Please be careful.
  1. Insert the SD card into your PC or SD card reader.
    1. notion image
  1. Open the terminal and check the available disks with df -h. Our SD card is 16 GB. It is named /dev/sdx and divided into two partitions, /dev/sdx1 and /dev/sdx2. The drive mounted at / is your main drive. Be careful not to use it.
    1. bashKopiraj kodo $ df -h Filesystem Size Used Avail Use% Mounted on /dev/sdx1 118M 27M 92M 23% /media/somebody/CAD5-1E3D /dev/sdx2 15.9G 1013M 15.8G 33% /media/somebody/7b2d3ba8-95ed-4bf4-bd67-eb52fe65df55
  1. Unmount all SD card partitions with umount /dev/sdxN (make sure you replace N with the right numbers).
    1. shellKopiraj kodo $ sudo umount /dev/sdx1 /dev/sdx2
  1. Write the image onto the SD card with the following command. Replace red_pitaya_image_file.img with the name of the unzipped Red Pitaya SD Card Image and replace /dev/device_name with the path to the SD card.
    1. shellKopiraj kodo $ sudo dd bs=1M if=red_pitaya_image_file.img of=/dev/device_name
  1. Wait until the process has finished.

Installing OS on the SD card for macOS Users

You can also use Balena Etcher on Linux and macOS. Instructions are under the Windows section.

Using ApplePi-Baker

  1. Insert the SD card into your PC or SD card reader.
  1. Download ApplePi-Baker. Direct link:
  1. Click on the ApplePi-Baker icon, then click Open to run it.
  1. Drag and drop ApplePi-Baker for installation.
  1. Enter your admin password and click OK.
  1. Select the SD card drive. This can be recognized by the size of the card, which is 16 GB.
  1. Select the Red Pitaya OS image file.
  1. It’s coffee time. The application will show you the estimated time for completion.
  1. When the operation is finished, the status will change to idle.
notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image

Using Command Line

  1. Insert the SD card into your PC or SD card reader.
  1. Click Cmd + Space, type Disk Utility into the search box, and press Enter. From the menu, select your SD card and click on the Erase button (be careful not to delete your disk!).
  1. Click Cmd + Space, then enter cd into the Terminal. Then type cd Desktop and press Enter once more.
  1. Unmount the partition so that you can overwrite the disk. Type diskutil list into the Terminal and press Enter. This will show you the list of all memory devices.
  1. Unmount with: diskutil UnmountDisk /dev/diskn (insert the number n of your disk correctly!)
  1. Type: sudo dd bs=1m if=path_of_your_image.img of=/dev/rdiskn (Remember to replace n with the number that you noted before!) (notice that there is a letter r in front of the disk name, use that as well!)
  1. Type in your password and wait a few minutes for the image to be written.
  1. When the image is written, type: diskutil eject /dev/diskn and press Enter.
  1. Safely eject the SD card.
notion image
notion image
notion image
notion image
notion image

Red Pitaya not booting even after OS update?

Please use the Balena Etcher application to re-write the OS manually. The latest Windows update has been reported to have broken the Win32 disk imager.

Manual upgrade

Instead of writing the whole SD card image, it is possible to upgrade only the ecosystem.
A manual upgrade allows you to fix a corrupted SD card image (if only the FAT partition is corrupted) or to install older, newer, or custom ecosystem zip files.
  1. Download a zip file from our download server.
  1. Insert the SD card into the card reader.
  1. Delete all files from the FAT partition. Use Shift + Delete to avoid placing files into the trash bin on the same partition.
  1. Extract the ecosystem zip file contents onto the now empty partition.
If you wish to keep wireless settings, skip deleting the following files:
  • wpa_supplicant.conf
  • hostapd.conf