Raspberry Pi
Is a general-purpose computer that can runs Raspberry Pi OS among other things
GPIO¶

- Pin 2 is at the side of the board
- Full GPIO Layout
- Pinout on Raspberry 1 model B rev 2 and following are the same, save for the fewer pins.
I2C Development¶
Setup¶
- Activate I2C in
raspi-config - Install
sudo apt install i2c-toolsand add current user to i2c groupsudo adduser $USER i2c - Reboot
- Test if I2C device is found
sudo i2cdetect -y 1Source
Usage¶
- Programming I2C with Python
- Use hexadecimal (start with
0xF) or binary (0b1111) - Setup
sudo apt install python3-pip python3-smbuspip3 install smbus2- Then usage:
python from smbus2 import SMBus i2c_bus = SMBus(1) # Create a new I2C bus on bus 1 data_read = i2c_bus.read_i2c_block_data(I2C_ADDR, 0x0, 1) i2c_bus.write_i2c_block_data(I2C_ADDR, 0x0 , I2C_COMMAND)
- Documentation:
Network¶
USB WLAN / Wi-Fi network interface¶
- The
EW-7811Un 802.11n Wireless Adapteris aRealtek RTL8188CUS- You need
kmod-rtl8192cuin OpenWrt
- You need
Use the Raspberry Pi as a router, wireless access point, ...¶
- Install OpenWrt, it's much more convenient
- To use a tethered smartphone, install corresponding modules
- To download them by hand, check the URLs in the "Software" page of the Open-WRT installation
SD Card¶
- Migrate to smaller SD Card
- Backup
- Use a Linux host to resize the partition
- Make an image and restore it to target SD