mathias / projects

2 stars 0 forks source link

Neighborhood server, solar-powered #3

Open mathias opened 1 year ago

mathias commented 1 year ago

Brief intro:

Rather than use corporate social networks to communicate with your neighbors, each neighborhood should have its own network and communications tool. Such a network could be completely off-grid, and use the kind of captive-portal DNS tricks that commercial wifi portals use. This is a combination of hardware to enable a solar-powered Pi-based server to broadcast its own wifi network, and software to provide the central point for a local community to talk and coordinate. (In essence, a wiki.)

The off-grid features are not the main point, but having a solar-powered server that does not rely on an Internet connection means that we can plan to use the server to coordinate if the internet or electricity is out in the area. Further, local-only usage means that we can shield the network from the open web. We can try and ensure privacy to our users and not require creating accounts. Users should not need to be technical to use the wiki -- the software should all be basic, usable web technology.

Tasks / Sub-Issues


Running on my solar-powered webserver project.

Would include:

All of this needs a setup script like Ansible or something like https://github.com/calliecameron/pi-server so it can be repeatable and reliably be set up.

Prior art:

mathias commented 1 year ago

Maybe consider alternatives to RocketChat. It is what was used in the original, but I don’t know if we need it?

mathias commented 1 year ago

Setup steps so far -- I hope to turn this into a script

edit: Setup moved to doc in #4.

mathias commented 1 year ago

Travel router: GL.iNet GL-AR300M16-Ext travel router OpenWRT flash and configuration instructions:

  1. Follow https://openwrt.org/toh/gl.inet/gl-ar300m instructions
  2. Set a root password as instructed (We will also later need to turn on SSH access.)
  3. ??? -- need to figure out setup so that the Rpi becomes the source of DNS and captive portal works.
  4. Go to “More Settings” -> “Network Mode” ~and make sure they’re all checked, including WDS.~ -- don't enable WDS, it turns off the admin UI.
  5. Turn on the Guest Network and enable "Applications" -> "Captive Portal" with maximum timeout.

In the end, I couldn't get the OpenWRT instructions to work (it flashed the uboot firmware, but it didn't ever install vanilla OpenWRT) so I am continuing with the GLinet-branded version of OpenWRT, which has been upgraded to the newest version. It should be fine and still provide us the options we need to configure later.

mathias commented 1 year ago

Progress on this: I’ve acquired a Raspberry Pi Zero 2W in the hopes that it will use less power. The only downside is its lack of Ethernet port — it’ll either have to connect to the router via wifi or need a USB ethernet dongle.

I printed a little case out of PLA to make it easier to mount to the inside of the enclosure.

I will begin work on figuring out the steps / script to configure the Pi again this week. I’m hoping fall doesn’t mean I soon run out of sunlight to power this with, as I’m quite far north.

mathias commented 1 year ago

Documenting this project has moved to https://github.com/mathias/projects/pull/4 for now, and will be in the docs folder when merged.

mathias commented 1 year ago

Server should include a copy of its own source code and setup guide that it serves, in line with the way RNode works:

Every RNode contains the seeds necessary to reproduce the system, the RNode Bootstrap Console, which is hosted locally on every RNode, and can be activated and accesses at any time - no Internet required.

The designs, guides and software stored within allows users to create more RNodes, and even to bootstrap entire communications networks, completely independently of existing infrastructure

https://www.printables.com/model/370907-handheld-rnode

grimmy commented 5 days ago

Setup steps so far -- I hope to turn this into a script

1. Download Rpi 3 (or whichever model you have) Debian image from https://raspi.debian.net/tested-images/

2. Unzip and flash the image onto a MicroSD card.

3. Boot or the first time.

4. Set root password (attaching keyboard+monitor because it is convenient)

5. `adduser mathias` and follow prompts

   * Add to sudo group: `usermod -aG sudo mathias`
   * 11. Update system packages

   ```
   sudo apt-get update && sudo apt-get install -y sudo
   ```

6. Set up SSH settings:

   * Ensure openssh server is installed: `apt-get install openssh-server`

7. Connect ethernet to main house network and ensure DHCP networking to router is working:
   ```
   ip address # read what eth1 says, to connect to
   ping google.com
   ```

8. SSH back in as `mathias` user (IP address from above)

9. Ensure that sudo works: `sudo whoami` should say `root`

10. `ssh-keygen`

11. `sudo apt install curl`

12. `curl https://github.com/mathias.keys > .ssh/authorized_keys`

13. Preserve my sanity: `sudo apt install vim`

TODO: Turn this into a setup script or Ansible config or whatever.

Other notes: raspi-config doesn't exist on vanilla Debian for Rpis. Maybe consider Raspbian headless again in the future?

Most of this can be done by using rpi-imager now

mathias commented 1 day ago

@grimmy I'll give that a try -- the actual instructions have moved to the doc in #4, and I didn't bother to delete the comments here ;)