{"id":1403,"date":"2024-05-06T11:17:26","date_gmt":"2024-05-06T15:17:26","guid":{"rendered":"https:\/\/sites.williams.edu\/makerspace\/?p=1403"},"modified":"2026-02-11T17:52:44","modified_gmt":"2026-02-11T22:52:44","slug":"truly-local-internet-the-pibrary-project","status":"publish","type":"post","link":"https:\/\/sites.williams.edu\/makerspace\/projects\/truly-local-internet-the-pibrary-project\/","title":{"rendered":"Truly-Local Internet: The PiBrary Project"},"content":{"rendered":"<div id=\"attachment_1448\" style=\"width: 285px\" class=\"wp-caption alignright\"><a href=\"https:\/\/sites.williams.edu\/makerspace\/files\/2024\/05\/PXL_20240516_170219208-scaled.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1448\" class=\"wp-image-1448\" src=\"https:\/\/sites.williams.edu\/makerspace\/files\/2024\/05\/PXL_20240516_170219208-226x300.jpg\" alt=\"Figure 1: A Raspberry Pi 4 Model B\" width=\"275\" height=\"365\" srcset=\"https:\/\/sites.williams.edu\/makerspace\/files\/2024\/05\/PXL_20240516_170219208-226x300.jpg 226w, https:\/\/sites.williams.edu\/makerspace\/files\/2024\/05\/PXL_20240516_170219208-771x1024.jpg 771w, https:\/\/sites.williams.edu\/makerspace\/files\/2024\/05\/PXL_20240516_170219208-768x1020.jpg 768w, https:\/\/sites.williams.edu\/makerspace\/files\/2024\/05\/PXL_20240516_170219208-1157x1536.jpg 1157w, https:\/\/sites.williams.edu\/makerspace\/files\/2024\/05\/PXL_20240516_170219208-1542x2048.jpg 1542w, https:\/\/sites.williams.edu\/makerspace\/files\/2024\/05\/PXL_20240516_170219208-scaled.jpg 1928w\" sizes=\"auto, (max-width: 275px) 100vw, 275px\" \/><\/a><p id=\"caption-attachment-1448\" class=\"wp-caption-text\">Figure 1: A Raspberry Pi 4 Model B<\/p><\/div>\n<p>If a local organization has important information for its neighbors, is there a way it can broadcast directly to them without bouncing the data to Toronto and back? I grew up here in the Berkshires, and have recently joined the Office of Information Technology (OIT) at Williams. Thinking about Williams College\u2019s commitment to <a href=\"https:\/\/learning-in-action.williams.edu\/opportunities\/\" target=\"_blank\" rel=\"noopener\">community service and support,<\/a> my project goal was to demo a low-cost, low-maintenance device which a local organization could use to easily broadcast information and resources over WiFi directly to nearby cell phone users through familiar, standard methods \u2014 (1) connecting to a WiFi network, and (2) navigating to a website address in a browser \u2014 without needing national or global infrastructure, or specialized equipment or technical skills on either side of the connection. Such an \u201cinternet-in-a-box\u201d model could have useful applications in emergency scenarios, but also could provide curated information or resources digitally to multiple people in other specific, time-limited places and moments \u2014 for example, at a festival, workshop, teach-in, or other community event.<\/p>\n<div id=\"attachment_1408\" style=\"width: 310px\" class=\"wp-caption alignleft\"><a href=\"https:\/\/sites.williams.edu\/makerspace\/files\/2024\/05\/pibrary-01.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1408\" class=\"wp-image-1408 size-medium\" src=\"https:\/\/sites.williams.edu\/makerspace\/files\/2024\/05\/pibrary-01-300x226.png\" alt=\"Figure 2: Wilmington VT, a mere 40-minute drive from Williams.\" width=\"300\" height=\"226\" srcset=\"https:\/\/sites.williams.edu\/makerspace\/files\/2024\/05\/pibrary-01-300x226.png 300w, https:\/\/sites.williams.edu\/makerspace\/files\/2024\/05\/pibrary-01-397x300.png 397w, https:\/\/sites.williams.edu\/makerspace\/files\/2024\/05\/pibrary-01.png 579w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-1408\" class=\"wp-caption-text\">Figure 2: Wilmington VT, a mere 40-minute drive from Williams.<\/p><\/div>\n<p>Let\u2019s give this idea some real context. Imagine a small town in nearby southern Vermont &#8211; say, Wilmington. It\u2019s late August, and a storm rips through, dropping 8 inches of rain in 24 hours, washing out roads and bridges, and knocking cell towers and internet infrastructure offline, leaving you without any connectivity for days. Local fire, rescue, and police services, town government, even your electric company, typically use websites, social media, and text messages to communicate critical information \u2014 but now, those methods don\u2019t work. Where can you go for information regarding emergency food, shelter, medical care? Is the water safe to drink? When will power be restored? Where are the downed power lines and flooded roads? You\u2019re both literally and figuratively in the dark.<\/p>\n<p>No need to imagine: this <a href=\"https:\/\/www.vpr.net\/apps\/irene\/timeline\" target=\"_blank\" rel=\"noopener\">actually happened in 2011,<\/a> with Tropical Storm Irene. <a href=\"https:\/\/www.reformer.com\/local-news\/hurricane-sandy-full-coverage-on-megastorm-battering-the-east-coast\/article_bb4312bf-7a12-5607-a78a-589b7e37583c.html\" target=\"_blank\" rel=\"noopener\">Superstorm Sandy in 2012<\/a> presented a similar case. And just this April, a single fiber optic cable damaged by a late-season snowstorm <a href=\"https:\/\/www.berkshireeagle.com\/news\/local\/connectivity-outage-impacts-businesses-across-berkshires\/article_6f9569f2-f2b6-11ee-b879-2bcbfa46b843.html\" target=\"_blank\" rel=\"noopener\">shut down Berkshire businesses<\/a> for a day.<\/p>\n<p>Truly local connections literally do not exist on the modern Internet. Are you on campus and want to view the williams.edu website? That data lives on <a href=\"https:\/\/web-check.xyz\/results\/https%3A%2F%2Fwilliams.edu\" target=\"_blank\" rel=\"noopener\">a server in Toronto<\/a>, and travels through 6 or 7 intermediary servers (including places like New Jersey and Ohio) before it lands in your cell phone\u2019s browser (also <a href=\"https:\/\/www.websitecarbon.com\/website\/williams-edu\/\" target=\"_blank\" rel=\"noopener\">producing 0.5g CO2 each visit<\/a>). Under normal conditions, this globalized infrastructure is reliable, and has important benefits. But it\u2019s useful to think about the edge cases. Climate change is bringing more unpredictable severe weather events. Rural areas like ours are often underserved by internet service providers (ISPs), which often have <a href=\"https:\/\/www.theverge.com\/c\/24070570\/internet-cables-undersea-deep-repair-ships\" target=\"_blank\" rel=\"noopener\">little financial incentive<\/a> to invest in maintaining or expanding infrastructure.<\/p>\n<p>This post offers a guide to creating your own DIY hyper-local webserver. If you can write a webpage (in plain HTML) and are open to my guidance in using a command line: follow along!<\/p>\n<h2>Required Equipment and Steps<\/h2>\n<div id=\"attachment_1409\" style=\"width: 310px\" class=\"wp-caption alignright\"><a href=\"https:\/\/sites.williams.edu\/makerspace\/files\/2024\/05\/pibrary-02.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1409\" class=\"wp-image-1409 size-medium\" src=\"https:\/\/sites.williams.edu\/makerspace\/files\/2024\/05\/pibrary-02-300x225.jpg\" alt=\"Figure 3: Required hardware: Raspberry Pi 4 Model B, Power Supply, PiSwitch, and 32GB MicroSD card with Raspberry Pi OS installed.\" width=\"300\" height=\"225\" srcset=\"https:\/\/sites.williams.edu\/makerspace\/files\/2024\/05\/pibrary-02-300x225.jpg 300w, https:\/\/sites.williams.edu\/makerspace\/files\/2024\/05\/pibrary-02.jpg 352w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-1409\" class=\"wp-caption-text\">Figure 3: Required hardware: Raspberry Pi 4 Model B, Power Supply, PiSwitch, and 32GB MicroSD card with Raspberry Pi OS installed.<\/p><\/div>\n<p>I decided to build using a <a href=\"https:\/\/www.canakit.com\/raspberry-pi-4-starter-kit.html\" target=\"_blank\" rel=\"noopener\">Raspberry Pi 4 Model B<\/a> single-board computer. The Pi is about the size and weight of a deck of cards, and runs a version of Linux, an open-source operating system (OS).<\/p>\n<p>There were two tweaks I determined were necessary to make the Pi ready to play the role I imagined. First: I needed to enable the Pi to act as a webserver, rather than a desktop. Second: I needed to adjust the Pi\u2019s built-in WiFi connection to broadcast, rather than receive, a WiFi signal.<\/p>\n<h2>Tweak 1: Webserver Setup<\/h2>\n<p>Globally, <a href=\"https:\/\/w3techs.com\/technologies\/details\/ws-apache\" target=\"_blank\" rel=\"noopener\">30% of all known websites use Apache,<\/a> an open-source webserver software launched in 1995. I installed Apache on the Pi through the command line, using the command:<\/p>\n<p style=\"font-family: courier\"><strong>sudo apt install apache2<\/strong><\/p>\n<p>Now, any content I wanted to broadcast to other users I could simply place into the preexisting folder at \/var\/www\/html\/. I wrote a home page, an \u201cabout\u201d page, and created 4 subfolders loaded with some open-licensed content (PDFs, audio and video files). You can check out my content (and adapt it if you like!) at <a href=\"https:\/\/github.com\/gpetruzella\/pibrary\" target=\"_blank\" rel=\"noopener\">github.com\/gpetruzella\/pibrary<\/a>.<\/p>\n<h2>Tweak 2: Adjusting WiFi to Broadcast<\/h2>\n<p>I then used the following on the command line to tell the Pi to broadcast as a WiFi hotspot:<\/p>\n<p style=\"font-family: courier\"><strong>sudo nmcli device wifi hotspot ssid &lt;my-chosen-hotspot-name&gt; ifname wlan0<\/strong><\/p>\n<p>(The Pi\u2019s built-in WiFi device is named \u201cwlan0\u201d; I chose to name my hotspot \u201cpibrary\u201d.)<\/p>\n<p>Now, the Pi was broadcasting a WiFi hotspot, which other devices would be able to see and connect to. But\u2026 I wanted to make sure this happened automatically every time the Pi was switched on. To accomplish that, I needed to find the new hotspot\u2019s UUID, then use that in one final configuration step. I found the hotspot\u2019s UUID by running:<\/p>\n<p style=\"font-family: courier\"><strong>nmcli connection<\/strong><\/p>\n<p>This displayed a table with multiple rows: I found the \u201cpibrary\u201d row and copied its UUID. Then, I ran:<\/p>\n<p style=\"font-family: courier\"><strong>sudo nmcli connection modify &lt;pibrary\u2019s UUID&gt; connection.autoconnect yes connection.autoconnect-priority 100<\/strong><\/p>\n<p>With this modification completed, simply switching on the Pi will automatically start broadcasting a WiFi signal (as a \u201chotspot\u201d or source), with no extra steps.<\/p>\n<h2>Connecting from a Nearby Mobile Phone<\/h2>\n<div id=\"attachment_1410\" style=\"width: 260px\" class=\"wp-caption alignleft\"><a href=\"https:\/\/sites.williams.edu\/makerspace\/files\/2024\/05\/pibrary-03.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1410\" class=\"wp-image-1410\" src=\"https:\/\/sites.williams.edu\/makerspace\/files\/2024\/05\/pibrary-03-135x300.jpg\" alt=\"screenshot of the homepage at pibrary.local.\" width=\"250\" height=\"556\" srcset=\"https:\/\/sites.williams.edu\/makerspace\/files\/2024\/05\/pibrary-03-135x300.jpg 135w, https:\/\/sites.williams.edu\/makerspace\/files\/2024\/05\/pibrary-03.jpg 279w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><p id=\"caption-attachment-1410\" class=\"wp-caption-text\">Figure 4: Viewing the homepage at pibrary.local.<\/p><\/div>\n<p>Now, the Pi was both \u201cserving\u201d webpages, and broadcasting a WiFi hotspot. Even without Internet \u2014 such as during power outages \u2014 any nearby user could find and connect to the WiFi hotspot on their phone&#8230; but what \u201cweb address\u201d would they type in the browser to reach the content? The final piece of the puzzle requires knowing the Pi\u2019s \u201chostname\u201d. When I first set up my Pi, I gave it the hostname pibrary (just like the hotspot). The domain name<\/p>\n<p style=\"font-family: courier\"><strong>.local<\/strong><\/p>\n<p>is a <a href=\"https:\/\/www.iana.org\/assignments\/special-use-domain-names\/special-use-domain-names.xhtml\" target=\"_blank\" rel=\"noopener\">special-use domain name<\/a> reserved for local network connections. So, once a cell phone has connected to the \u201cpibrary\u201d WiFi hotspot, that user can type<\/p>\n<p style=\"font-family: courier\"><strong>pibrary.local<\/strong><\/p>\n<p>into the browser to reach the homepage I had set up in Tweak 1. Finding your own Pi\u2019s hostname is as easy as entering the following on the command line:<\/p>\n<p style=\"font-family: courier\"><strong>hostname<\/strong><\/p>\n<h2>Experiencing the Local Website<\/h2>\n<p>Below are a few screenshot examples of navigating the PiBrary resources from an Android phone.<\/p>\n<div id=\"attachment_1411\" style=\"width: 590px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/sites.williams.edu\/makerspace\/files\/2024\/05\/pibrary-04.png.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1411\" class=\"wp-image-1411\" src=\"https:\/\/sites.williams.edu\/makerspace\/files\/2024\/05\/pibrary-04.png-300x135.jpg\" alt=\"screenshot of streaming an open-licensed video.\" width=\"580\" height=\"261\" srcset=\"https:\/\/sites.williams.edu\/makerspace\/files\/2024\/05\/pibrary-04.png-300x135.jpg 300w, https:\/\/sites.williams.edu\/makerspace\/files\/2024\/05\/pibrary-04.png-500x225.jpg 500w, https:\/\/sites.williams.edu\/makerspace\/files\/2024\/05\/pibrary-04.png.jpg 626w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><p id=\"caption-attachment-1411\" class=\"wp-caption-text\">Figure 5: You can stream an open-licensed video.<\/p><\/div>\n<div id=\"attachment_1412\" style=\"width: 260px\" class=\"wp-caption alignleft\"><a href=\"https:\/\/sites.williams.edu\/makerspace\/files\/2024\/05\/pibrary-05.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1412\" class=\"wp-image-1412\" src=\"https:\/\/sites.williams.edu\/makerspace\/files\/2024\/05\/pibrary-05-135x300.jpg\" alt=\"screenshot: accessing directories of open-licensed learning resources.\" width=\"250\" height=\"557\" srcset=\"https:\/\/sites.williams.edu\/makerspace\/files\/2024\/05\/pibrary-05-135x300.jpg 135w, https:\/\/sites.williams.edu\/makerspace\/files\/2024\/05\/pibrary-05.jpg 324w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><p id=\"caption-attachment-1412\" class=\"wp-caption-text\">Figure 6: You can access directories of open-licensed learning resources.<\/p><\/div>\n<div id=\"attachment_1413\" style=\"width: 260px\" class=\"wp-caption alignright\"><a href=\"https:\/\/sites.williams.edu\/makerspace\/files\/2024\/05\/pibrary-06.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1413\" class=\"wp-image-1413\" src=\"https:\/\/sites.williams.edu\/makerspace\/files\/2024\/05\/pibrary-06-135x300.jpg\" alt=\"Figure 7: You can view PDFs.\" width=\"250\" height=\"557\" srcset=\"https:\/\/sites.williams.edu\/makerspace\/files\/2024\/05\/pibrary-06-135x300.jpg 135w, https:\/\/sites.williams.edu\/makerspace\/files\/2024\/05\/pibrary-06.jpg 324w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><p id=\"caption-attachment-1413\" class=\"wp-caption-text\">Figure 7: You can view PDFs.<\/p><\/div>\n<h2>Challenges and Future Expansions<\/h2>\n<p>One limitation of this implementation is the range of consumer-grade WiFi: the maximum signal distance is roughly 90 meters under ideal conditions. The <a href=\"https:\/\/en.wikipedia.org\/wiki\/IEEE_802.11ah\" target=\"_blank\" rel=\"noopener\">HaLow (802.11ah) standard<\/a> offers up to 1km of range; but today\u2019s consumer cell phones aren\u2019t built to use that standard. One solution could use HaLow to send data from one Pi to another &#8211; say, one in town hall and another at a fire station (if each has an inexpensive <a href=\"https:\/\/store.rokland.com\/products\/alfa-network-ahpi7292s-ieee-802-11ah-sub-1-ghz-module-in-raspberry-pi-hat-form-factor\" target=\"_blank\" rel=\"noopener\">HaLow module<\/a> installed), with each one serving its own nearby neighborhood over standard WiFi. Alternatively, even off-the-shelf <a href=\"https:\/\/www.nytimes.com\/wirecutter\/reviews\/best-wi-fi-mesh-networking-kits\/\" target=\"_blank\" rel=\"noopener\">home mesh or WiFi \u201cextender\u201d hardware<\/a> could improve the reach of this model without significant cost.<\/p>\n<p>A second challenge: maintaining and editing content. My ideal use-case was for non-technical community members (e.g. in public safety or town government) to easily push information, announcements, etc. However, this demo succeeded because I knew how to edit and manage webpage content directly (i.e. by writing HTML). For a non-technical community member, using the bare Apache webserver this way could be a significant barrier to easy deployment or quick posting, especially in the environment of a public emergency. To address this, I would like to explore whether the <a href=\"https:\/\/yunohost.org\/\" target=\"_blank\" rel=\"noopener\">YunoHost<\/a> open-source server management application is compatible with the PiBrary project. YunoHost offers a very familiar and robust web editing interface, plus other possible additional services, such as email hosting.<\/p>\n<p>In terms of sustainability, a lightweight Pi-hosted local site radically reduces the total carbon impact of each site visit, even taking into account the fact that Williams\u2019 website is <a href=\"https:\/\/www.thegreenwebfoundation.org\/green-web-check\/?url=https%3A%2F%2Fwww.williams.edu%2F\" target=\"_blank\" rel=\"noopener\">\u201chosted green\u201d.<\/a> A fascinating expansion of this project would be to use <a href=\"https:\/\/sustainablewebdesign.org\/digital-carbon-ratings\/\" target=\"_blank\" rel=\"noopener\">sustainable web design<\/a> principles and standards as a standard part of the college\u2019s digital presence.<\/p>\n<p>Finally, privacy. Unlike ordinary internet browsing, which has many elements protecting and encrypting the flow of data, this demo creates a simple, direct, unencrypted WiFi network. (You may have noticed the \u201cinsecure alert\u201d icon next to the address in some of the screenshots above.) In the absence of any technical trust guarantees, this setup is suitable only for very specific cases where the connection between server and client is based on human trust &#8211; like in a local community!<\/p>\n<p><strong>Thanks to David Keiser-Clark, Makerspace Program Manager, and to my colleagues on the Academic Technology Services team, for their support in developing this prototype.<\/strong><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If a local organization has important information for its neighbors, is there a way it can broadcast directly to them without bouncing the data to Toronto and back? I grew up here in the Berkshires, and have recently joined the &hellip; <a href=\"https:\/\/sites.williams.edu\/makerspace\/projects\/truly-local-internet-the-pibrary-project\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2961,"featured_media":1448,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"ngg_post_thumbnail":0,"footnotes":"","_links_to":"","_links_to_target":""},"categories":[23],"tags":[69,54,56,37],"class_list":["post-1403","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-projects","tag-makerspace","tag-programming","tag-raspberry-pi","tag-sustainability"],"acf":[],"_links":{"self":[{"href":"https:\/\/sites.williams.edu\/makerspace\/wp-json\/wp\/v2\/posts\/1403","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sites.williams.edu\/makerspace\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sites.williams.edu\/makerspace\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sites.williams.edu\/makerspace\/wp-json\/wp\/v2\/users\/2961"}],"replies":[{"embeddable":true,"href":"https:\/\/sites.williams.edu\/makerspace\/wp-json\/wp\/v2\/comments?post=1403"}],"version-history":[{"count":23,"href":"https:\/\/sites.williams.edu\/makerspace\/wp-json\/wp\/v2\/posts\/1403\/revisions"}],"predecessor-version":[{"id":2875,"href":"https:\/\/sites.williams.edu\/makerspace\/wp-json\/wp\/v2\/posts\/1403\/revisions\/2875"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sites.williams.edu\/makerspace\/wp-json\/wp\/v2\/media\/1448"}],"wp:attachment":[{"href":"https:\/\/sites.williams.edu\/makerspace\/wp-json\/wp\/v2\/media?parent=1403"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sites.williams.edu\/makerspace\/wp-json\/wp\/v2\/categories?post=1403"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sites.williams.edu\/makerspace\/wp-json\/wp\/v2\/tags?post=1403"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}