{"id":15,"date":"2020-02-15T23:14:00","date_gmt":"2020-02-16T04:14:00","guid":{"rendered":"https:\/\/soullesscupcake.club\/?p=15"},"modified":"2023-04-28T23:27:27","modified_gmt":"2023-04-29T03:27:27","slug":"babies-and-linux-the-quest-for-a-diy-baby-monitor-the-sequel-i-have-too-many-raspberry-pis","status":"publish","type":"post","link":"https:\/\/soullesscupcake.club\/index.php\/2020\/02\/15\/babies-and-linux-the-quest-for-a-diy-baby-monitor-the-sequel-i-have-too-many-raspberry-pis\/","title":{"rendered":"Babies and Linux: The Quest for A DIY Baby Monitor: The Sequel: I Have Too Many Raspberry Pi\u2019s"},"content":{"rendered":"\n<p>Are you cheap? Did you just have a baby? Do you need a way of monitoring your newly minted progeny? Do you have Raspberry Pi\u2019s for days? If you answered yes to all of the above, let me take you on a journey of self-discovery and command-line shenanigans.<\/p>\n\n\n\n<p>The goal is to create an audio baby monitor for my spawn as she is now sleeping, sometimes, in her own room with as little cost as possible. We already have a Wyze Cam for video check-ins and motion sensing. We could use our current mobile devices and leave the stream up 24\/7, but that is unrealistic. We will need our devices for other uses. Also, killing the batteries of these devices is not the most cost-effective or eco-friendly way of living.<\/p>\n\n\n\n<p>The solution was to take a stockpile of existing equipment and bend it to my technological will. Taking two Raspberry Pi\u2019s and a few other components and placing them into a magic blender of imagination and frustration to create a simple yet effective Linux powered audio baby monitor.<\/p>\n\n\n\n<p>The setup is simple. An audio server and streaming client. A Raspberry Pi with a microphone array broadcasting audio over our home network 24\/7, and a second Pi playing that audio 24\/7 with some speakers. After some research <a href=\"http:\/\/icecast.org\/\">Icecast2<\/a> and <a href=\"http:\/\/www.darkice.org\/\">Darkice<\/a> looked to be the most promising. The benefit of using this setup would include playing the audio on any device with a web browser on top of completing the initial goal. As for the client, Pi MusicBox fits the bill. Pi Musicbox works well on a Raspberry Pi 0w, supports network streaming, can start a stream at boot, and has a stream watchdog that will restart the stream after network loss or some other issue. Below are the part list and setup instructions.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Part List<\/strong><\/h4>\n\n\n\n<h5 class=\"wp-block-heading\">Audio Server<\/h5>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Raspberry Pi 3<\/li>\n\n\n\n<li>Micro SD Card 8Gb<\/li>\n\n\n\n<li>Micro USB Power Supply<\/li>\n\n\n\n<li>Any USB Microphone (I used a PS3 Eye)<\/li>\n\n\n\n<li>Blue Tack (Optional \u2013 To cover LEDs)<\/li>\n<\/ul>\n\n\n\n<h5 class=\"wp-block-heading\">Audio Client<\/h5>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Raspberry Pi 0w<\/li>\n\n\n\n<li>Micro SD Card 8Gb<\/li>\n\n\n\n<li>Micro USB Power Supply<\/li>\n\n\n\n<li>USB Powered Speakers<\/li>\n\n\n\n<li>OTG USB Hub<\/li>\n\n\n\n<li>USB Sound Card (I used one from a Logitech headset I had lying around)<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Putting it All Together<\/h4>\n\n\n\n<h5 class=\"wp-block-heading\">SD Card Preparation Server<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>Write the current Raspbian Buster to a SD card\n\nAdd ssh file to boot partition\n        Open Notepad\n        Click File and Save As\n        Navigate to boot partition\n        Change Save as type to All Files \n        Save as ssh\n\nAdd wpa_supplicant.conf to boot partition\n        Open Notepad\n        Add below code and change for your network\n        Change Save as type to All Files \n        Navigate to boot partition\n        Save as wpa_supplicant.conf \n\nNote: make sure both files are saved without .txt extension<\/code><\/pre>\n\n\n\n<p>Audio Server<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Attach Microphone\nInsert SD Card \nBoot Pi\nSSH into Pi using it's network address, I used my routers DHCP page to find this\nNext are the terminal commands\nsudo raspi-config           #edit pi's differnt configs\nChoose option 1             #to change the password to something else\nChoose 2 and then 1         #to change the hostname (I chose icecast)\nChoose 3 and then b2        #to have the Pi wait for a network connection at boot\nChoose finish\nSelect reboot\nSSH back into the Pi        #now you can use icecast.local or whatever you choose as the domain instead of the ip\nsudo apt update &amp;&amp; sudo apt upgrade -y\nsudo apt install icecast2   #to install icecast2\nChoose configure\nLeave localhost\nChange source password\nChange relay password\nChange admin password\nSudo apt install darkice\narecord -l                  #to see you microphone mine was at 1,0\nsudo nano darkice.cfg       #creating the darkice config file\n\n&#91;general]\nduration        = 0      # duration in s, 0 forever\nbufferSecs      = 1      # buffer, in seconds\nreconnect       = yes    # reconnect if disconnected\n \n&#91;input]\ndevice          = plughw:1,0 # Soundcard device for the audio input\nsampleRate      = 44100   # sample rate 11025, 22050 or 44100\nbitsPerSample   = 16      # bits\nchannel         = 1       # 2 = stereo\n \n&#91;icecast2-0]\nbitrateMode     = vbr       # constant bit rate ('cbr' constant, 'abr' average)\nquality         = 1.0       # 1.0 is best quality (use only with vbr)\nformat          = vorbis       # format. Choose 'vorbis' for OGG Vorbis\nbitrate         = 320       # bitrate\nserver          = localhost # or IP\nport            = 8000      # port for IceCast2 access\npassword        = CHANGEME  # source password for the IceCast2 server\nmountPoint      = CHANGEME.mp3  # mount point on the IceCast2 server .mp3 or .ogg\nname            = CHANGEME\ndescription     = CHANGEME\n\nchange passowrd to your source password from above and the other CHANGEME to whatever you like\nlower bitrate to 192 if you encouter stuttering\n\nhit crtl + x\nhit y\nhit enter\n\nsudo nano darkice.sh       #creating the darkice shell command to run with crontab\n\n#!\/bin\/bash\nsudo \/usr\/bin\/darkice -c \/home\/pi\/darkice.cfg\n\nhit crtl + x\nhit y\nhit enter\n\ncrontab -e\n\nat the end add\n\n@reboot sleep 20 &amp;&amp; sudo \/home\/pi\/darkice.sh\n\nsudo reboot\n\nopen your browser and navigate to icecast.local:800 or yourip:8000 \nplay the stream to test\n\nnote tested in Chrome, Firefox, and Silk on desktop and mobile\n<\/code><\/pre>\n\n\n\n<p>SD Card Preparation Client<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Write the current Pi MusicBox to a SD card\nNavigate to boot \nNavigate to config folder\nOpen settings.ini\nType in your Network SSID and Network Key in the appropiate fields\nConnect OTG Hub to Pi\nConnect USB DAC\nConnect speakers to DAC\nConnect Speaks to USB Hub\nInsert SD card\nBoot the Pi\nIn a browser navigate to musicbox.local\nGo to settings\nGo to musicbox\nChange root password\nChange Autoplay URI to http:\/\/icecast.local:8000\/yourmount.mp3 or http:\/\/yourserverip:8000\/yourmount.mp3\nTurn on Stream Watchdog\nGo to Audio \nChange Initial Volume to your preference\nGo to the bottom click Save\nClick Apply Changes Now\n\nYour Pi should reboot to playing the Audio\n\n<\/code><\/pre>\n\n\n\n<p>At this point, you should have a complete system setup. Now you can set up your devices where needed. You can also add as many clients you need permitting the bandwidth allows. I used hook and loop ties to attach the microphone to a crib bar and then applied blue tack to hide the LEDs. This setup is not cost-effective if you have to buy all the parts considering a cheap monitor on Amazon costs 16.95 at the time of writing. If you have the parts or are looking for an interesting project, get your Linux on. I want to thank Matt Kaar at <a href=\"http:\/\/mattkaar.com\/\">http:\/\/mattkaar.com\/<\/a> for inspiration. I used his original <a href=\"http:\/\/mattkaar.com\/blog\/2012\/12\/01\/raspberry-pi-as-a-baby-monitor\/\">project<\/a> as a base and adapted it to my needs. All hail our Penguin overlord!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Are you cheap? Did you just have a baby? Do you need a way of monitoring your newly minted progeny? Do you have Raspberry Pi\u2019s for days? If you answered yes to all of the above, let me take you on a journey of self-discovery and command-line shenanigans. The goal is to create an audio [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-15","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/soullesscupcake.club\/index.php\/wp-json\/wp\/v2\/posts\/15","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/soullesscupcake.club\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/soullesscupcake.club\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/soullesscupcake.club\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/soullesscupcake.club\/index.php\/wp-json\/wp\/v2\/comments?post=15"}],"version-history":[{"count":1,"href":"https:\/\/soullesscupcake.club\/index.php\/wp-json\/wp\/v2\/posts\/15\/revisions"}],"predecessor-version":[{"id":16,"href":"https:\/\/soullesscupcake.club\/index.php\/wp-json\/wp\/v2\/posts\/15\/revisions\/16"}],"wp:attachment":[{"href":"https:\/\/soullesscupcake.club\/index.php\/wp-json\/wp\/v2\/media?parent=15"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/soullesscupcake.club\/index.php\/wp-json\/wp\/v2\/categories?post=15"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/soullesscupcake.club\/index.php\/wp-json\/wp\/v2\/tags?post=15"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}