Skip to content

Commit 718f59e

Browse files
committed
removing pre-2025 code
1 parent 74dd3c9 commit 718f59e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1
-18695
lines changed

README.md

Lines changed: 1 addition & 288 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,6 @@ Beatboxer in Go
2626
- [Configure to connect over ethernet](#configure-to-connect-over-ethernet)
2727
- [Configure the Pi to connect as Wifi AP](#configure-the-pi-to-connect-as-wifi-ap)
2828
- [Switch the Pi back to connecting to the internet with wifi](#switch-the-pi-back-to-connecting-to-the-internet-with-wifi)
29-
- [OLD](#old)
30-
- [portaudio](#portaudio)
31-
- [rpi\_ws281x](#rpi_ws281x)
32-
- [Env / bootup](#env--bootup)
33-
- [Build](#build-1)
34-
- [Run](#run-1)
35-
- [Stop bbox process](#stop-bbox-process)
36-
- [Check for voltage drop](#check-for-voltage-drop)
37-
- [Editing SD card](#editing-sd-card)
38-
- [Wifi access point](#wifi-access-point)
39-
- [To re-enable internet wifi](#to-re-enable-internet-wifi)
40-
- [Mounting / syncing pi](#mounting--syncing-pi)
41-
- [Set restart crontab](#set-restart-crontab)
4229
- [Docs](#docs)
4330
- [Credits](#credits)
4431

@@ -296,280 +283,6 @@ nmcli connection show
296283
sudo nmcli connection down Hotspot
297284
```
298285

299-
300-
301-
302-
303-
304-
305-
306-
307-
308-
309-
310-
# OLD
311-
312-
313-
### portaudio
314-
315-
```bash
316-
# OSX
317-
brew install portaudio
318-
319-
# Raspbian
320-
sudo apt-get install -y libasound-dev
321-
322-
wget http://portaudio.com/archives/pa_stable_v190600_20161030.tgz -O /tmp/pa_stable_v190600_20161030.tgz
323-
cd /tmp
324-
tar -xzf pa_stable_v190600_20161030.tgz
325-
cd portaudio
326-
./configure
327-
make
328-
sudo make install
329-
sudo ldconfig
330-
```
331-
332-
### rpi_ws281x
333-
334-
Beatboxer depends on a fork of (https://github.com/jgarff/rpi_ws281x). See that
335-
repo for complete instructions.
336-
337-
```bash
338-
cd ~/code/go/src/github.com/siggy/bbox
339-
sudo cp rpi_ws281x/rpihw.h /usr/local/include/
340-
sudo cp rpi_ws281x/ws2811.h /usr/local/include/
341-
sudo cp rpi_ws281x/pwm.h /usr/local/include/
342-
343-
sudo cp rpi_ws281x/libws2811.a /usr/local/lib/
344-
345-
# osx
346-
export CGO_CFLAGS="$CGO_CFLAGS -I/usr/local/include"
347-
export CGO_LDFLAGS="$CGO_LDFLAGS -L/usr/local/lib"
348-
```
349-
350-
## Env / bootup
351-
352-
```bash
353-
# set bootup and shell env
354-
cd ~/code/go/src/github.com/siggy/bbox
355-
cp rpi/.local.bash ~/
356-
source ~/.local.bash
357-
358-
cp rpi/bboxgo.sh ~/
359-
sudo cp rpi/bbox.service /etc/systemd/system/bbox.service
360-
sudo systemctl enable bbox
361-
362-
echo "[[ -s ${HOME}/.local.bash ]] && source ${HOME}/.local.bash" >> ~/.bashrc
363-
364-
# audio setup
365-
366-
# external sound card
367-
sudo cp rpi/asound.conf /etc/
368-
369-
# *output of raspi-config after forcing audio to hdmi*
370-
numid=3,iface=MIXER,name='Mic Playback Switch'
371-
; type=BOOLEAN,access=rw------,values=1
372-
: values=on
373-
# *also this might work*
374-
amixer cset numid=3 2
375-
# OR:
376-
sudo raspi-config nonint do_audio 2
377-
378-
echo "blacklist snd_bcm2835" | sudo tee --append /etc/modprobe.d/snd-blacklist.conf
379-
380-
echo "hdmi_force_hotplug=1" | sudo tee --append /boot/config.txt
381-
echo "hdmi_force_edid_audio=1" | sudo tee --append /boot/config.txt
382-
383-
# make usb audio card #0
384-
sudo vi /lib/modprobe.d/aliases.conf
385-
#options snd-usb-audio index=-2
386-
387-
# reboot
388-
389-
aplay -l
390-
# ... should match the contents of asound.conf, and also:
391-
sudo vi /usr/share/alsa/alsa.conf
392-
defaults.ctl.card 0
393-
defaults.pcm.card 0
394-
```
395-
396-
## Build
397-
398-
```bash
399-
go build cmd/beatboxer_noleds.go && \
400-
go build cmd/beatboxer_leds.go && \
401-
go build cmd/baux.go && \
402-
go build cmd/clear.go && \
403-
go build cmd/fishweb.go && \
404-
go build cmd/human.go && \
405-
go build cmd/leds.go && \
406-
407-
go build cmd/amplitude.go && \
408-
go build cmd/aud.go && \
409-
go build cmd/crane.go && \
410-
go build cmd/crawler.go && \
411-
go build cmd/fish.go && \
412-
go build cmd/keys.go && \
413-
go build cmd/noleds.go && \
414-
go build cmd/record.go
415-
```
416-
417-
## Run
418-
419-
All programs that use LEDs must be run with `sudo`.
420-
421-
```bash
422-
sudo ./beatboxer # main program
423-
sudo ./leds # led testing
424-
sudo ./clear # clear LEDs
425-
./noleds # beatboxer without LEDs (for testing without pi)
426-
./aud # audio testing
427-
./keys # keyboard test
428-
```
429-
430-
## Stop bbox process
431-
432-
```bash
433-
# the systemd way
434-
sudo systemctl stop bbox
435-
436-
# send SIGINT to turn off LEDs
437-
sudo kill -2 <PID>
438-
```
439-
440-
## Check for voltage drop
441-
442-
```bash
443-
vcgencmd get_throttled
444-
```
445-
446-
## Editing SD card
447-
448-
Launch Ubuntu in VirtualBox
449-
450-
```bash
451-
sudo mount /dev/sdb7 ~/usb
452-
sudo umount /dev/sdb7
453-
```
454-
455-
## Wifi access point
456-
457-
Based on:
458-
https://frillip.com/using-your-raspberry-pi-3-as-a-wifi-access-point-with-hostapd/
459-
460-
```bash
461-
sudo tee --append /etc/dhcpcd.conf > /dev/null <<'EOF'
462-
463-
# this must go above any `interface` line
464-
denyinterfaces wlan0
465-
466-
# this must go below `interface wlan0`
467-
nohook wpa_supplicant
468-
EOF
469-
470-
sudo tee --append /etc/network/interfaces > /dev/null <<'EOF'
471-
472-
allow-hotplug wlan0
473-
iface wlan0 inet static
474-
address 192.168.4.1
475-
netmask 255.255.255.0
476-
network 192.168.4.0
477-
broadcast 192.168.1.255
478-
# wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
479-
EOF
480-
481-
sudo tee /etc/hostapd/hostapd.conf > /dev/null <<'EOF'
482-
interface=wlan0
483-
driver=nl80211
484-
ssid=sigpi
485-
hw_mode=g
486-
channel=6
487-
ieee80211n=1
488-
wmm_enabled=0
489-
ht_capab=[HT40][SHORT-GI-20][DSSS_CCK-40]
490-
macaddr_acl=0
491-
auth_algs=1
492-
ignore_broadcast_ssid=0
493-
wpa=2
494-
wpa_key_mgmt=WPA-PSK
495-
wpa_passphrase=showmethepi
496-
# wpa_pairwise=TKIP
497-
rsn_pairwise=CCMP
498-
EOF
499-
500-
sudo tee /etc/default/hostapd > /dev/null <<'EOF'
501-
DAEMON_CONF="/etc/hostapd/hostapd.conf"
502-
EOF
503-
504-
sudo tee --append /etc/dnsmasq.conf > /dev/null <<'EOF'
505-
506-
interface=wlan0
507-
listen-address=192.168.4.1
508-
bind-interfaces
509-
domain-needed
510-
dhcp-range=192.168.4.2,192.168.4.100,255.255.255.0,24h
511-
EOF
512-
513-
sudo tee --append /etc/sysctl.conf > /dev/null <<'EOF'
514-
515-
net.ipv4.ip_forward=1
516-
EOF
517-
518-
sudo service dhcpcd restart
519-
sudo systemctl start hostapd
520-
sudo systemctl start dnsmasq
521-
522-
# reboot to connect over wifi
523-
sudo shutdown -r now
524-
```
525-
526-
### To re-enable internet wifi
527-
528-
Comment out from `/etc/dhcpcd.conf`:
529-
```
530-
# denyinterfaces wlan0
531-
# nohook wpa_supplicant
532-
```
533-
534-
Re-enable in `/etc/network/interfaces`:
535-
```
536-
allow-hotplug wlan0
537-
iface wlan0 inet manual
538-
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
539-
```
540-
541-
sudo service dhcpcd restart
542-
sudo ifdown wlan0; sudo ifup wlan0
543-
sudo systemctl stop hostapd
544-
sudo systemctl stop dnsmasq
545-
546-
### Mounting / syncing pi
547-
548-
```bash
549-
# mount pi volume locally
550-
alias pifs='umount /Volumes/pi; sudo rmdir /Volumes/pi; sudo mkdir /Volumes/pi; sudo chown sig:staff /Volumes/pi && sshfs [email protected]:/ /Volumes/pi -f'
551-
552-
# rsync local repo to pi
553-
rsync -vr ~/code/go/src/github.com/siggy/bbox/.git /Volumes/pi/home/pi/code/go/src/github.com/siggy/bbox
554-
555-
# remove volume mount
556-
alias pifsrm='umount /Volumes/pi; sudo rmdir /Volumes/pi; sudo mkdir /Volumes/pi; sudo chown sig:staff /Volumes/pi'
557-
```
558-
559-
### Set restart crontab
560-
561-
```bash
562-
sudo crontab -e
563-
```
564-
565-
```
566-
*/10 * * * * sudo /sbin/shutdown -r now
567-
```
568-
569-
```
570-
sudo crontab -l
571-
```
572-
573286
## Docs
574287

575288
```bash
@@ -580,4 +293,4 @@ open http://127.0.0.1:4000/bbox
580293
## Credits
581294

582295
- [wavs](wavs) courtesy of (http://99sounds.org/drum-samples/)
583-
- [rpi_ws281x](rpi_ws281x) courtesy of (https://github.com/jgarff/rpi_ws281x)
296+
- Keyboard courtesy of (https://github.com/kodachi614/macropaw)

0 commit comments

Comments
 (0)