rtr7 / router7

router7 is a small home internet router completely written in Go. It is implemented as a gokrazy appliance.
https://router7.org
Apache License 2.0
2.69k stars 110 forks source link

raspberry pi support ? #2

Open pengyunchou opened 6 years ago

xinsnake commented 6 years ago

I believe it can be quite challenging as the issue is raspberry pi has only 1 Ethernet port, and it's not 1Gbps either.

stapelberg commented 6 years ago

At this point, I’m not looking to add any more supported platforms.

That said, I started development on a Raspberry Pi 3B with an Apple USB ethernet adapter, so it should be possible to run router7 in such a setup, possibly with a few changes. If you want to do the work, we can talk about getting pull requests merged to make this possible.

stapelberg commented 4 years ago

With gokrazy/kernel change https://github.com/gokrazy/kernel/commit/88166bd9486e2273b8011c21d60a94ee5f850c79, the required kernel modules for router7 are now available.

So, if you change e.g. the image Makefile target: https://github.com/rtr7/router7/blob/12502113816c4f2a718e6dfea8469c5ad07ec0c1/Makefile#L14-L24

such that:

  1. GOARCH=arm64 is set instead of amd64 (for the Raspberry Pi vs. the PC Engines APU)
  2. -kernel_package=github.com/gokrazy/kernel
  3. -firmware_package=github.com/gokrazy/firmware

you should be able to run router7 on the Raspberry Pi just fine.


One caveat: even with the Raspberry Pi 4, which has a gigabit ethernet port as part of its system-on-chip, and USB3 ports to which you can connect an additional gigabit ethernet adapter, it proves tricky to get full gigabit speeds:

  1. using gokrazy.org, I get ≈500 Mbit/s: https://twitter.com/zekjur/status/1273513899187408897
  2. using Raspbian, I get ≈860 Mbit/s

The measured speed without the Raspberry Pi in the middle is ≈930 Mbit/s.

So, if your upstream connection is slower than 500 Mbit/s, running router7 on the Raspberry Pi 4 might be a good option for you.

That said, it’s still not a good option for me, so I won’t officially recommend doing so—if you’re willing to enter uncharted territory, let me know how it goes! :)

matthyx commented 2 years ago

Hi @stapelberg I think something like https://www.dfrobot.com/product-2242.html should work... if I can get my hands on a CM4 module, I will report back success (or lack of) here.

stapelberg commented 2 years ago

Looks like a good option for the Raspberry Pi indeed. Looking forward to your report!

matthyx commented 2 years ago

For the moment it seems impossible to get one... maybe @geerlingguy can test it as a follow-up to https://www.jeffgeerling.com/blog/2021/two-tiny-dual-gigabit-raspberry-pi-cm4-routers