Thursday 22 June 2017

USB Audio raspberry pi

aplay -l.
Comment or clear all records in file:
sudo nano /etc/modprobe.d/alsa-base.conf
Create file:
sudo nano /etc/asound.conf
Fill with next data:
defaults.ctl.card 1
defaults.pcm.card 1
defaults.timer.card 1

Friday 20 May 2016

Autoconnect wireless dongle from raspberry pi to wifi

Remove and reinsert the SD card so that your Windows or Mac PC can see the small FAT32 partition on the card (labelled "boot").
If you get a message telling you the card must be formatted, cancel it.
On that small FAT32 partition, create a file with the name ssh (or ssh.txt). It can be empty, the contents don't matter.
To connect to a wireless network, create another file on the card called wpa_supplicant.conf, which has the following inside:
Code: Select all

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

network={
    ssid="Your network name/SSID"
    psk="Your WPA/WPA2 security key"
    key_mgmt=WPA-PSK
}
Edit country=, ssid= and psk= with your information and save the file.
Use a pure text editor, not a word processor to edit the wpa_supplicant.conf file.
Make sure that both files are in the main directory of the small FAT32 partition, not in any folder.
Safely eject the card from your PC and use it to boot the Pi.
If Raspbian finds an ssh file it will enable SSH and delete the file. If it finds a wpa_supplicant.conf file, it will move it to its correct location and connect to your wireless network. Give your Pi some time to boot and connect to your network (the first boot always takes a bit longer), then you should be able to SSH into the Pi and configure it how you like.

Create a wifi hotspot in windows

Requirements: Windows with a wifi card
Steps: Open cmd.exe with administrator privileges and run:
netsh wlan set hostednetwork mode=allow ssid=MyWLAN key=password123
netsh wlan start hostednetwork
It does not work for 5Ghz, so only 2.4Ghz (windows driver limitation)

Raspberry pi 1 UART interface pinout

So in order to interface with my raspberry pi 1 with rasbian weezy on UART (Universal asynchronous receiver/transmitter) I use USB to UART 5-Pin CP2102 Module Serial Converter (dx.com ) for 3.8 Euros. I connect the RX cable from the usb module to the GPIO 14 (TXD) and the TX from usb to GPIO 15 (RXD).


On the raspberry modify the following files:
1. /boot/cmdline.txt
and make the text look like this:
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
2. /etc/inittab
#Spawn a getty on Raspberry Pi serial line
T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100

Get putty (here) and set the following:
Connection type: Serial
Com port : You get it from device manager
Speed (baud rate): 115200
Bits: 8
Parity: None
Stop Bits: 1
Flow Control: None

Power on the raspberry and you should see kernel logs + login on the putty window.