You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 2.1 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. # Announcement Box
  2. Linux box with a loudspeaker and an emergency light to be used for announcements and notifications.
  3. ## Hardware
  4. ### Overview
  5. * SBC with GPIOs and sound output :: OrangePi Zero with an expansion board
  6. * PA system
  7. * speaker :: 30W, 4 Ohms horn loudspeaker
  8. * sound amplifier :: mono 18W sound amplifier
  9. * relay module :: 12V low trigger relay
  10. * Warning Light system
  11. * warning light :: 12V 10W rotary orange warning light
  12. * relay module :: 12V low trigger relay
  13. * System Activity Light system
  14. * indicator LED
  15. * Human Activity Sensor system
  16. * PIR module
  17. ### Building
  18. TBD
  19. ## Software
  20. ### Overview
  21. * Operating System - Linux :: Armbian Bullseye for the OrangePi Zero
  22. * PA System
  23. * Voice Synthesizer :: Festival / ESpeak
  24. ### Installation
  25. Run as root:
  26. ```bash
  27. cp toolkit/* /usr/local/bin/
  28. cp etc/systemd/system /etc/systemd/system
  29. systemctl enable --now system-activity-light.service
  30. systemctl enable --now human-activity-sensor.service
  31. ```
  32. ## Implementation Notes
  33. ### Armbian + OrangePi Zero Installation
  34. #### Enable analog soundcard
  35. ```
  36. sudo armbian-config
  37. # System > Hardware > [*] analog-codec
  38. ```
  39. #### Software Dependencies
  40. ##### OS Packages
  41. ```bash
  42. apt install mplayer espeak-ng
  43. ```
  44. ##### GPIO toolkit
  45. ```bash
  46. # upstream:
  47. #git clone https://github.com/orangepi-xunlong/wiringOP
  48. # enhanced:
  49. git clone https://github.com/Dejvino/wiringOP
  50. cd wiringOP
  51. ./build clean
  52. ./build
  53. ```
  54. ### PA System
  55. #### Enabling mixed sound output
  56. ```bash
  57. cat ~/.asoundrc
  58. pcm.!default plug:dmix
  59. ```
  60. #### Text to Speech
  61. ```bash
  62. ## Festival
  63. # reading
  64. ...
  65. # to file
  66. text2wave text.txt > wave.wav
  67. ## ESpeak
  68. # voices:
  69. ls /usr/lib/arm-linux-gnueabihf/espeak-data/voices/
  70. # reading
  71. espeak -f text.txt -p 40 -s 160 -v "en-us"
  72. # to file
  73. espeak -f text.txt -p 40 -s 160 -k15 -g 1 -w wave.wav
  74. # using SSML (e.g.: https://www.xml.com/pub/a/2004/10/20/ssml.html)
  75. espeak -f ssml.txt -m
  76. ```
  77. #### Converting into a low-quality broadcast audio
  78. ```bash
  79. sox infile.wav outfile.wav downsample echo 0.5 1 1 1
  80. ```
  81. ### Human Activity Sensor
  82. #### Reading File Timestamp
  83. ```bash
  84. stat /var/tmp/human_last_seen --format=%Y
  85. ```