User Tools

Site Tools


squawk

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
squawk [2016-10-10 15:54] robsquawk [2017-01-10 21:01] – [/home/pi/squawk.py] tim
Line 1: Line 1:
-====== Audio Alerts ======+====== Audio Alerts (squawk) ======
  
-Traditionally this was handled by doorpi. However, that pi has too much stuff hanging off it, and was very out of date. There was an issue of a loud pop occurring before any sound played, this was fixed in later firmware updates. Rob has now dedicated a pi (original B) for the purpose and documents it thus:+Traditionally this was handled by doorpi. However, that pi has too much stuff hanging off it, and was very out of date. There was an issue of a loud pop occurring before any sound played, this was fixed in later firmware updates. Rob has purchased a pi (original B), amplifier and speakers for the purpose and documents them thus:
  
 ===== Usage ===== ===== Usage =====
Line 19: Line 19:
 Text-to-speech message (with a clear airport/transit chiming sound): Text-to-speech message (with a clear airport/transit chiming sound):
 <code> <code>
-mosquitto_pub -h mqtt -t 'sound/g1/speak' -m "Good evening, my sensors indicate that the laser cutter may be on fire."+mosquitto_pub -h mqtt -t 'sound/g1/announce' -m "Good evening, my sensors indicate that the laser cutter may be on fire."
 </code> </code>
  
 **Theory:** You could direct sound two only two rooms at once by playing the left or right channel only. By default mpg123 is called with the -m option to ensure that the output is mono and thus the same sound comes out every speaker. **Theory:** You could direct sound two only two rooms at once by playing the left or right channel only. By default mpg123 is called with the -m option to ensure that the output is mono and thus the same sound comes out every speaker.
 +
 +===== Adding new sounds =====
 +
 +Use the web file browser at http://squawk.hacklab:8080/.
  
 ===== Raspbian ===== ===== Raspbian =====
Line 180: Line 184:
         speak(msg.payload)         speak(msg.payload)
  
-    if msg.topic == 'display/doorbot/intercom': +    if msg.topic == 'access/entrance/request': 
-        if msg.payload == '1' and status == 'closed':+        if status == 'closed':
             play('doorbell.mp3')             play('doorbell.mp3')
  
Line 395: Line 399:
  
 There are four speakers connected, two per channel, located in each of the rooms on the ceiling. The speakers are 8 Ohm moisture resistant cheap ceiling speakers that have exceeded expectations and produce a surprisingly full sound. This opens up the potential for using them for background music in the future (e.g. via MPD). There are four speakers connected, two per channel, located in each of the rooms on the ceiling. The speakers are 8 Ohm moisture resistant cheap ceiling speakers that have exceeded expectations and produce a surprisingly full sound. This opens up the potential for using them for background music in the future (e.g. via MPD).
 +
 +==== Raspberry Pi ====
 +
 +Standard pi other than having some wires soldered on the underside of the board to connect to the 3.5mm audio jack. Powered via the header rather than USB.
 +
 +==== Amplifier ====
 +
 +  * TPA3116
 +  * "100 W"
 +  * 12-24v (more volts = more power)
 +  * Volume pot
 +  * 3-pin header input or 3.5mm socket
 +
 +Audio is input via the 3-pin header.
 +
 +Power is input on the centre screw terminal, with left and right speaker outputs either side.
  
 ==== Power Supply ==== ==== Power Supply ====
squawk.txt · Last modified: 2023-11-25 23:45 by jaso55555

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki