Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

i2c display

OLED Pin	 Pi GPIO  Pin	   Notes
Vcc	      1 	           3.3V
Gnd	      14            Ground
SCL	      5	            I2C SCL
SDA	      3	            I2C SCA

git clone https://github.com/adafruit/Adafruit_Python_SSD1306.git

i2cdetect -y 1

INSTALL basics

sudo apt-get update -y && sudo apt-get upgrade -y
sudo apt install -y nodejs npm  puredata  python3-pip python-pip python3 python  -y

INTERNET HOTSPOT FROM THE PI ;-) good for osc control , servers etc when you dont need internet

wget -q https://git.io/voEUQ -O /tmp/raspap && bash /tmp/raspap

GRAPHICAL INTERFACE FOR RASPBIAN OS ( installed lite before, only termnal)

sudo apt-get install --no-install-recommends xinit

sudo apt-get install -y raspberrypi-ui-mods rpi-chromium-mods

sudo reboot
boot to the console for most things and only start the Pixel desktop as required using the command startx

move from pc to pi

scp (-r recursive) C:\file\place\  pi:/home/pi/

resources (activity monitor with terminal style)

htop

disk usage

du  -h --max-depth=1

netscan //// find devices

ifconfig // shows your ip , then nmap with your local range

sudp apt-get install nmap 
nmap -sn 192.168.1.0/24

FIND

find -name FileName
whereis thispatch.pd 
        thispatch*

permissions

sudo ls -altrh /home/pi/foldertoCheck

Send folder to raspberry from laptop through ssh

scp -r folder_to_send pi:folder_to_receive/

SSH KEYGEN (create a ssh authentication key so no password login is required)

C:\Users\x\.ssh
config[file]--
Host pi
HostName 192.168.0.19
User pi
----
ssh-keygen -t rsa -b 4096 -C "your@mail.com"
scp .ssh/id_rsa.pub  pi:/home/pi/

remove old keys

rm /home/pi/.ssh/authorized_keys  

add the key to the authorized devices list

cat /home/pi/id_rsa.pub >> /home/pi/.ssh/authorized_keys

Pure Data

Example . Start puredate without GUI (from terminal) with a sample rate of 44100 , verbose to debug more messages

The name of the interface, in this case MobilePre , size of the audio buffer -audiobuf 32 samples , add a midi device in

named /dev/midi2 in my system .

pd -nogui -r 44100 -verbose -audioadddev MobilePre -audiobuf 32 -midiaddindev /dev/midi2

// see pf -h for a full list of commands available
//or alternatively

noaudioin: True
audiobuf: 32
rate: 44100
nomidiin: False
midiindev1: 0
nomidiout: False
midioutdev1: 0
path1: /home/pi/pd/externals
npath: 1
standardpath: 1
verbose: 1
flags: -nogui -rt

sudo ln -s  /home/pi/.pdsettings /root/.pdsettings

PISERVER PD

control of the patches via web interface from any device, see my github ( AutomataPdosc thingy)
npm install socket.io express http

AUDIO TEST

speaker-test -t sine -f 440 -c 2 -s 1 
amixer cset numid=1 -- 98%

ALIASES

Create your own customized commands editing this file then tiping the alias triggers the command

sudo nano .bash_aliases

#### check pi reported temperature from terminal 

alias temp='/opt/vc/bin/vcgencmd measure_temp'

alias restart='sudo reboot'
alias ciao='sudo shutcldown -h now'
alias delf='sudo rm -r'

fancy temp meter GPU AND CPU ºC

https://www.cyberciti.biz/faq/linux-find-out-raspberry-pi-gpu-and-arm-cpu-temperature-command/

wifi setup

You can create a file called wpa_supplicant.conf and drag it to the SD card on your laptop with the raspberry OS

at boot it will try to connect to that wifi with the specified data

wpa_supplicant.conf //////

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

network={
        ssid="WIFI NAME"
        psk="WIFI PASSWORD"
        proto=RSN
        key_mgmt=WPA-PSK
        pairwise=CCMP
        auth_alg=OPEN
}

/////////////////////////////////////

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment