Raspberry Pi

This is basically my cheatsheet to Raspberry Pi.

When I experience something that I would like to remember, then I'll add it to this page.

Autostart

How to use autostart
(RPI OS Bookworm)

In RPI OS Bookworm the "old" way of autostart something using lxsession does not work anymore (at least I cannot get it to work). So instead you have to do the following:

Open and edit file

sudo nano /home/pi/.config/wayfire.ini

Add the following at the buttom of the file:

[autostart]

somename=<link to progam>

Example:

[autostart]

startbrowser=/usr/bin/chromium-browser --kiosk

.NET

Install .NET

This guy made it very easy to install .NET on Raspberry Pi:

https://github.com/pjgpetecodes

Run in terminal

.NET6:

wget -O - https://raw.githubusercontent.com/pjgpetecodes/dotnet6pi/master/install.sh | sudo bash

.NET8:

wget -O - https://raw.githubusercontent.com/pjgpetecodes/dotnet8pi/main/install.sh | sudo bash

Remote debug

How to debug RPI from VSCode

Install extension

Find and install the extension "Remote Development extension"

Instead of coding directly on the Raspberry Pi, you can use VSCode to remotely run/debug code.

Do the following:

1) Ctrl+Shift+P

2) Select "Remote SSH: Connect current window to host"

3) Click on "+ Add New SSH Host"

4) Enter <user>@<IP-address>

5) (Select config file)

6) Enter Password

You should now see that it is trying to open the connection.

Remote debug

Enable Wifi

You can enable wifi on a prewritten sd-card by doing the following

Enable wifi

1) Create a file called "wpa_supplicant.conf" in the root of the "boot"-folder.

2) Copy/paste: 

country=DK
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
scan_ssid=1
ssid="wifi_ssid"
psk="wifi_pass"
}

3) Save and start RPI

4) If you want SSH enabled as well...
Create a empty file called "SSH" (without file-extension) in the same folder

unsplash