====== Technical Notes - Library in a Box ====== {{::elibboxbanner.png?400|}} ====== Installation ====== Recommended installation of the [[library-box|eLibrary in a Box]] is just via microSD image copy (see microSD Card section below) as well as by inserting the microSD into the Raspberry Pi 3 Model B and powering it up. The microSD (at least 64GB) should be of high quality. \\ \\ ====== Setup ====== When deployed by partner organizations, the [[library-box|eLibrary in a Box]] is ready for use. However, should there be any need for further setup, access is either via ssh or desktop access (with HDMI monitor, USB mouse and keyboard). \\ \\ Secure login credentials from your tech provider. Change default password ASAP. * include in /etc/hosts the following line: 172.24.1.1 library.ph ====== microSD Card ====== {{::microsd.jpg?100 |}} Using a reliable microSD reader, you may copy, backup or reproduce the contents (via image) of eLibrary Box. The source image itself may be shared via peer-to-peer connection or download. Contact psy@up.edu.ph if interested in building your own Library in a Box using this method. \\ \\ So, to have your own eLib in a Box, * (a) buy a [[https://shopee.ph/product/63659866/1307575362|Raspberry Pi 3 Beta Starter Kit]] and a microSD 64GB card * (b) get a back-up image of a working system (Step 1 below) * (c ) restore the image to a new microSD card (Step 2 below) * (d) Insert the card to the the Raspberry Pi 3. \\ \\ =====Backup===== * locate the device (/dev) identifier. On macOS terminal diskutil list * copy (example disk5) sudo dd if=/dev/disk5 of=~/Desktop/tambayayong-eLib-box.dmg * unmount diskutil unmountDisk /dev/disk5 \\ =====Restore===== To restore or replicate the image to another microSD, sudo dd if=~/Volumes/4TB-SG/raspberrypi/tambayayong-updated-19feb2019.dmg of=/dev/disk5 On Mac, try this variation for speed: sudo dd bs=1m if=/Volumes/4TB-SG/raspberrypi/tambayayong-updated-19feb2019.dmg of=/dev/rdisk2 \\ Tips: verify the /dev identifier by using //diskutil list//. Restoration takes longer than backup. For the Tambayayong [[library-box|eLib Box]] using microSD Class 10, about 5 hours on mac mini. When initially getting a "resource busy" error message, try unmounting first the subpartition (example): diskutil umount /dev/disk5s2 \\ Do the same for the other "s" numbers, as determined by the //diskutil list// command. In certain rare cases, you have to do the //force// option. diskutil umount force /dev/disk5s2 Once done with restore, be a good girl/boy. Unmount to finish. diskutil unmountDisk /dev/disk5 ---- For most part, restoring an image is a straightforward process. But sometimes you'll encounter bad cards that you may have to reformat them first to some useless format, just to test whether the card is writable in the first first. So, before doing the routine above, try something like this first: sudo diskutil eraseDisk FAT32 RASPBIAN MBRFormat /dev/disk5 Confirm unmounting with //diskutil list//. You may also have to check whether there's a process preventing you from unmounting. sudo lsof|grep disk5 In which case, you do sudo kill -9 Another possibility that's preventing you from copying an image to a new microSD card is a broken partition table. In which case, just create a new one sudo gpt create -f /dev/disk5 \\ And the most basic of all, when you're having difficulty formatting a microSD card, check if some mechanism on the card adapter or reader is not set to lock or read-only. With the lock on, you'll likely get a "permission denied" message when you do a restore command. \\ \\ ====== Maintenance====== Maintenance of the [[library-box|Library in a Box]] by parts (all available at online stores like Lazada and Shopee): * {{ ::elibboxpowersupply.png?100|}}power supply. This can be replaced by any Android cellphone charger with output of 2.5A. If eLib Box usage is not high, 2A will do, and it can even run on a power bank for mobile phones. But 2.5A is the recommended rating. Make sure, however, that you're not using Raspberry Pi 3 Beta **Plus** - a slightly more powerful version but requiring a more expensive 3A-output power and at least the latest Raspbian Stretch OS. See [[https://en.wikipedia.org/wiki/Raspbian|Raspbian versioning and OS requirement]].\\ \\ The eLib Box or the Raspberry Pi is NOT designed to be powered from a USB port on other connected equipment like a laptop. \\ \\ * {{ ::microsd.jpg?75|}}microSD card. This card contains both the operating system and the contents of the [[library-box|Library in a Box]]. An image backup is recommended so local restoration is possible. Otherwise, request your technology service provider for replacement. Future updates and enhancements may also be available through your technology service provider. \\ \\ In certain situations, it makes sense to pre-position updated microSD cards in the locality to be able to quickly respond to a possible breakdown in one of the eLib sites. \\ \\ * {{ ::raspberry_pi_3.png?100|}}Raspberry Pi 3 Beta microcomputer is available via online stores. (Not to be confused with Raspberry Pi 3 Beta **Plus** - a slightly more powerful version but requiring 3A power and at least the latest Raspbian Stretch OS.) The micro SD that came with the original setup can just be inserted into a newly-ordered Raspberry Pi 3 Model B, and it should be good to go. * {{ ::heatsink.png?80|}}Over time, the heatsink could detach, as its adhesive would dry up. In this case, just remove the heatsink from the box to prevent it from short-circuiting the microcomputer board. The alternative is to use some double-sided, heat-transfering adhesive tape to re-attach the heatsinks. Remember to wipe the surface first before mounting the heatsink. * {{ ::raspbibetawithfan.jpg?100|}} IF you have an eLib Box version with a fan that draws its power from the Raspberry Pi board, notice to which pins fan wires are attached to and the colors (red and black) of the wire. Red on Pin 4 (5v power); black on Pin 6 (ground). Just in case the wires get detached from the board, just put them back in. If the fan itself breaks, don't worry too much about it. Just keep it there until you find a suitable replacement. {{ ::raspberry-pi-gpio-layout-model-b-plus-rotated-2700x900.png?400 |}} \\ \\ * If you're concerned about possible corruption of data if you just yank the power supply without properly shutting, a start/shutdown button may be added to the contraption. See [[raspberry-pi-3-startup-shutdown-button|this rig]]. \\ \\ ---- ====== References ====== * [[https://www.raspberrypi.org/documentation/configuration/wireless/access-point.md|Setting up Raspberry Pi as access point...]] * [[https://thepi.io/how-to-use-your-raspberry-pi-as-a-wireless-access-point/|How to use your Raspberry Pi as a wireless access point]] * [[https://learn.sparkfun.com/tutorials/setting-up-a-raspberry-pi-3-as-an-access-point|Setting up a Raspberry Pi 3 as an Access Point]] * installing Raspian from ground-up: [[https://www.raspberrypi.org/documentation/installation/installing-images/mac.md|Mac]], [[https://www.raspberrypi.org/documentation/installation/installing-images/windows.md|Windows]], [[https://www.raspberrypi.org/documentation/installation/installing-images/linux.md|Linux]] \\ ====== See Also ====== * [[Physical Assembly of Tambayayong eLib Box]] * [[elibrary-partnership|Tambayayong eLibrary Partnership]] * [[Troubleshooting eLib Box]] * [[Raspbian Upgrade]]