Deploying and running a redpesk image on a Raspberry Pi
The Raspberry Pi is a small computer that is ideal for learning computing and computer languages.
The redpesk project supports images for the
Raspberry Pi 3 and the
Raspberry Pi 4
boards using the aarch64
architecture.
Each of these boards comes in a variety of models.
See the Raspberry Pi Product Page for more information.
This topic details how to copy a raw redpesk image on an sdcard.
Download images
See the Download Images section
Download the aarch64 image from the command line
Create a directory for downloading image:
mkdir ~/redpeskimage
cd ~/redpeskimage
wget -r -nd -nc --no-parent -A "redpesk*smack*" 'https://download.redpesk.bzh/redpesk-lts/arz-1.0/images/smack/minimal/aarch64/generic/latest'
Copying the image on your sdcard
Plug your sdcard and Find it (be sure it is unmounted)
Copy the correct device path thanks to the command below. It should be a hotplug device.
lsblk -dli -o PATH,VENDOR,TYPE,HOTPLUG,MODEL
DEVICE_TO_COPY='/dev/<hotplug_device>' #in the example it is /dev/sdc
Example:
$ lsblk -dli -o PATH,VENDOR,TYPE,HOTPLUG,MODEL
PATH VENDOR TYPE HOTPLUG MODEL
/dev/sda ATA disk 0 WDC_WD10SPZX-08Z10
/dev/sdc TS-RDF5 disk 1 SD_Transcend #MYSDCARD
/dev/nvme0n1 disk 0 LITEON T11 512
DEVICE_TO_COPY=/dev/sdc
Or if only one device is hotpluggable on your computer:
# need jq
DEVICE_TO_COPY=$(lsblk -dlJ -o PATH,VENDOR,TYPE,HOTPLUG,MODEL | jq -r '.blockdevices[] | select(.hotplug == true).path')
echo $DEVICE_TO_COPY
Umount if needed
lsblk $DEVICE_TO_COPY
# need to umount each partition
sudo umount <part*>
Example:
$ lsblk /dev/sdc
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdc 8:32 1 14.6G 0 disk
├─sdc1 8:33 1 501M 0 part /run/media/iotbzh/0409-3A02
├─sdc2 8:34 1 1G 0 part /run/media/iotbzh/cd3c87ec-1011-4832-aef3-6be0ed3d3748
└─sdc3 8:35 1 2.5G 0 part /run/media/iotbzh/4e508264-8ce2-447f-a829-e4c31ea20047
$ sudo umount /run/media/iotbzh/*
Flash sdcard using dd
Prerequisites
- device is plugged in, found, unmounted
unxz redpesk*.raw.xz
IMAGE=$(ls redpesk*.raw)
sudo dd if=$IMAGE of=$DEVICE_TO_COPY bs=4M status=progress
Boot the Raspberry Pi
For more detail see: Setting up your raspberrypi
Prerequisites
- sdcard copied and plugged into the Raspberry Pi
- keyboard, screen plugged into the Raspberry Pi
- ethernet cable plugged in
Power on the Raspberry Pi
Just start the Pi and wait for it to boot.
Default root password is root
.
Connect to the board over SSH
It needs an ethernet cable plugged into the board, and retrieving its ip.
- User:
root
- Password:
root
Getting the Raspberry Pi IP address
# on rpi
ip -br a
# on your computer
ssh root@<raspberry_pi-IP_address>
Installing a package
See this section for installing and starting helloworld-binding: Install helloworld binding
Debugging
When things go wrong, you can take steps to debug your Raspberry Pi. For debugging, you need a 3.3 Volt USB Serial cable to facilitate communication between your Raspberry Pi board and your build host.
CAUTION: No warranty is provided using the following procedure. Plugging in the serial cable on the wrong board GPIO/connector could damage your board, the host or both ! Pay particular attention to the colors of your cable as they could vary depending on the vendor.
NOTE: If you are using a USB console cable from Adafruit, see “Adafruit’s Raspberry Pi Lesson 5” for connection information.
Use the following steps, which assume you are using an Olimex cable (the previously mentioned Adafruit cable above does not have a blue lead in particular, adapt according to the document above). You can reference the following diagram for information on the following steps:
-
Connect the serial cable leads to the Universal Asynchronous Receiver-Transmitter (UART) connection on your Raspberry Pi board. Do not connect the USB side of the cable to your build host at this time.
-
Connect the cable’s BLUE wire to pin 6 (i.e. Ground) of the UART.
-
Connect the cable’s GREEN RX line to pin 8 (i.e. the TXD line) of the UART.
-
Connect the cable’s RED TX line to pin 10 (i.e. the RXD line) of the UART.
-
Plug the USB connector of the cable into your build host’s USB port.
-
Use your favorite tool for serial communication between your build host and your Raspberry Pi. For example, if your build host is a native Linux machine (e.g. Ubuntu) you could use
screen
as follows from a terminal on the build host:$ sudo screen /dev/ttyUSB0 115200