Advertisement
Guest User

Crystal Ball notes

a guest
Jun 4th, 2021
447
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.44 KB | None | 0 0
  1. components:
  2. -----------
  3. $15 raspi zero w
  4. $5 8-16gb+ micro SD card
  5. $6 mini usb mic (Kinobo USB 2.0)
  6. $3 mini-usb to usb-B cable adapter
  7. $3 mini-hdmi to hdmi cable adapter
  8.  
  9. $15 raspi audio hat (Adafruit Speaker Bonnet)
  10. $15 speakers (Adafruit Stereo Enclosed Speaker Set - 3W 4 Ohm)
  11. $11 LED lights (NeoPixel Ring - 16 x WS2812 5050 RGB LED with Integrated Drivers )
  12. $3 motion sensor (HC-SR501 Infrared PIR Motion Sensor Module)
  13. $15 snow globe (Darice Make, Plastic, 130mm Waterglobe Kit, Clear )
  14. =========
  15. $91 total
  16.  
  17. also needed:
  18. ------------
  19. monitor w/ hdmi, usb keyboard (to program pi)
  20. sand paper (1500 grit)
  21. box for base of crystal ball (tea container)
  22. hot glue gun
  23. raspi breadboard jumper wires
  24. soldering iron and solder
  25.  
  26.  
  27. bonnet install:
  28. https://learn.adafruit.com/adafruit-speaker-bonnet-for-raspberry-pi/raspberry-pi-usage
  29.  
  30. leds:
  31. https://learn.adafruit.com/adafruit-neopixel-uberguide/python-circuitpython
  32.  
  33. raspi assistant:
  34. looked into Rhasspy for voice control, but scrapped it after having trouble
  35.  
  36. https://www.instructables.com/Pi-Home-a-Raspberry-Powered-Virtual-Assistant/
  37.  
  38. https://pimylifeup.com/raspberry-pi-google-assistant/
  39. https://github.com/googlesamples/assistant-sdk-python/issues/235#issuecomment-409523986
  40.  
  41. must compile from scratch as premade binaries don't work on pi zero
  42. -------------------------------------------------------------------
  43. pip uninstall grpc grpcio
  44. rm -rf ~/.cache/pip/*
  45. apt install libffi-dev libssl-dev
  46. python -m pip install --upgrade --no-binary :all: grpcio
  47.  
  48. first start example:
  49. --------------
  50. google-oauthlib-tool --client-secrets ~/credentials.json \
  51. --scope https://www.googleapis.com/auth/assistant-sdk-prototype \
  52. --scope https://www.googleapis.com/auth/gcm \
  53. --save --headless
  54.  
  55. later start?:
  56. ------------
  57. googlesamples-assistant-pushtotalk --project-id raspi-assistant-id --device-model-id raspi-assistant-model-id
  58.  
  59. modified:
  60. ---------
  61. /home/pi/venv/lib/python3.7/site-packages/googlesamples/assistant/grpc/pushtotalk.py
  62.  
  63. /home/pi/venv/lib/python3.7/site-packages/googlesamples/assistant/grpc/crystalball.py
  64.  
  65.  
  66. hardware pins used:
  67. -------------------
  68. sound: 18, 19, 21 https://learn.adafruit.com/adafruit-speaker-bonnet-for-raspberry-pi/pinouts
  69. lights: 12, 5v, G https://learn.adafruit.com/adafruit-neopixel-uberguide/python-circuitpython
  70. motion: 13, 5v, G https://learn.adafruit.com/pir-passive-infrared-proximity-motion-sensor/circuitpython-code
  71.  
  72.  
  73. extra installs:
  74. ---------------
  75. motion stocks
  76. pip install gpiozero yfinance
  77.  
  78. apt-get install espeak
  79.  
  80.  
  81. sound conf: /etc/asound.conf
  82. -----------------------------
  83. pcm.speakerbonnet {
  84. type hw card 0
  85. }
  86.  
  87. pcm.dmixer {
  88. type dmix
  89. ipc_key 1024
  90. ipc_perm 0666
  91. slave {
  92. pcm "speakerbonnet"
  93. period_time 0
  94. period_size 1024
  95. buffer_size 8192
  96. rate 44100
  97. channels 2
  98. }
  99. }
  100.  
  101. ctl.dmixer {
  102. type hw card 0
  103. }
  104.  
  105. pcm.softvol {
  106. type softvol
  107. slave.pcm "dmixer"
  108. control.name "PCM"
  109. control.card 0
  110. }
  111.  
  112. ctl.softvol {
  113. type hw
  114. card 0
  115. }
  116.  
  117. pcm.mic {
  118. type plug
  119. slave {
  120. pcm "hw:1,0"
  121. rate 44100
  122. }
  123. }
  124.  
  125. pcm.!default {
  126. type plug
  127. slave.pcm "softvol"
  128. slave.pcm "mic"
  129. }
  130.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement