You are reading content from Scuttlebutt
@luandro %81QrqwrtuGbGkbsp51oudwP1BxRSoMb6qVruFGZNdCY=.sha256
Re: %Kn1yjgA8e

#dev-diary

First release :tada: :tada:

TL&DR: Check out how to deploy your own at the project repository

I took the opportunity of the DD retreat in Catalunya to finally #crabmeet with @Bruno and work on our first release for P2P Hotspot.

Luandro & Bruno workstation

We were able to do a 3 day coding sprint, which was just enough to put the finishing touches to what we had been working up until then.

Here's a brief explanation of all the parts we had to work on:

Concept

Initially the plan was to create something focused for #community-networks, but since we lacked the necessary research on broader community needs as Nico had to put all his focus on family, we decided conceptualize something different.

Since this is a project funded by SSB community, we thought it would be better to make this a device which can be used by anyone who would like to onboard neighbors, friends or attendees in an event or workshop, to FOSS and peer-to-peer technologies.

Hardware support

We had quite a list of the most affordable SBCs that we'd like to support, and Bruno had bought a few to test out. But as it became clear that Go SSB doesn't support 32bits, and that Balena updated with less frequency devices other then Raspberry Pis, we decided to focus on the Raspberry 3 & 4 (maybe Pi Z W2).

They support 64 bits, have their base OS regularly maintained by Balena and are the most popular devices out there anyway.

We know this is an issue considering the lack of availability of Raspberries, and versions for other SBCs like Banana PI and Odroid are on the to-do list.

WiFi

Pi 3 with WiFi dongle

The original wifi-repeater project written in Typescript was almost good enough as it was. There were a few modifications needed, such as adding support for no-password.

Being written in Typescript makes it easy to modify in the future. The alternative, wifi-connect written in Rust seems more robust but needed more tweaking and non of us had enough confidence with Rust to attempt it.

This piece is responsible for creating the access point, and also enables the device acting as a repeater with an additional compatible WiFi dongle connected to it.

Captive-Portal

A captive-portal is the best way to make content easily discoverable by people connecting to an access point, so quite a lot of energy was put into this.

Bruno had found and modified a simple Python implementation, which worked very well, but had a few quirks that needed resolving, such as getting host IP, adding CORs support, downloading and serving an external static website and ajusting a few of the iptables rules.

At some point I re-wrote everything in Nodejs, uniting the captive-portal and wifi projects into one, but it wasn't working as expected for unknown reasons, so we dropped it.

Portal

P2P Hotspot portal opening thru captive-portal on phone

The idea with the portal was to provide documentation for onboarding to FOSS and P2P tools in a storytelling format, with easy-to-follow steps, providing all the necessary installers, links and even the SSB pub invite to users.

The content is all written in Markdown, so it can be easily edited and is multi-lingual (English and Portuguese for now).

SSB Go Pub

The main challenge with creating a SSB Pub in Go the served out needs was in the details. First we needed to expose the generated invite in some way. So I added an Apache server that exposes jsons with pub details, including the invite.

Second, to achieve our desired user-flow where once connected to the local pub users are automatically connected to the broader network, we needed to have the ssb server automatically connect to pubs and rooms set in the Balena environmental variables. It was a bit enigmatic at first but it worked!

Known bugs

  • Having the portal running on port 80 made the captive-portal stop working, so we had to change it to port 8081
  • At some point the friendly local domain, http://p2p.local stopped working for unknown reasons
  • Although the captive-portal works, Internet blocking doesn´t, this could be seen as a feature or an issue

Future plans

  • Make it offline-first
  • Make a WiFI repeater solution (for venues without ethernet availability)
  • Make a version which is 32bits compatible
  • Add Pi-Hole to ad-block and manage custom domains together with a proxy, such as nginx-proxy-manager
  • Explore WiFi managing such as Rasp AP
  • Integrate #peachcloud front-end

Feedback welcome

We are aware that there are still a lot of rough edges, but we are eager to find out what uses the community can give to it, and how we can make it better.

If you have a Raspberry Zero 2, 3 or 4 please test this out by going thru the documentation on the repository and let us know what you think.

If you want some support join this Telegram group. We can prepare you a ready to burn image which gives us access to your device so we can help debugging.

Join Scuttlebutt now