Skip to content

client mode added#888

Merged
cooperq merged 45 commits intoEFForg:mainfrom
BeigeBox:feature/client-wifi
Apr 22, 2026
Merged

client mode added#888
cooperq merged 45 commits intoEFForg:mainfrom
BeigeBox:feature/client-wifi

Conversation

@BeigeBox
Copy link
Copy Markdown
Contributor

This has been tested on the Orbic. I have a Moxxe but I haven't tested it on that yet. One concern is that the wpa_supplicant is 1MB at present, which isn't good for the moxxe until we move it's logging to /cache. We may want to limit this to only Orbic until other devices are confirmed to work with this.

Posting this so folks can start to take a look at it and give me feedback. I've got a small shell script also that I threw together to tell me about the capabilities of other devices which I don't own. Reach out to me on mattermost if you have a device other than the Orbic or Moxxe and I'll send that to you. Then we can get a better idea of which devices can support client mode.

Pull Request Checklist

  • The Rayhunter team has recently expressed interest in reviewing a PR for this.
    • If not, this PR may be closed due our limited resources and need to prioritize how we spend them.
  • Added or updated any documentation as needed to support the changes in this PR.
  • Code has been linted and run through cargo fmt.
  • If any new functionality has been added, unit tests were also added.
  • CONTRIBUTING.md has been read.

@BeigeBox
Copy link
Copy Markdown
Contributor Author

I added another small change during the install to replace some daemons that aren't used for rayhunter. They phone home to verizon, and by replacing them with just shell scripts that sleep that's avoided. Plus it gets us more memory.

Comment thread installer/src/orbic_network.rs Outdated
Comment thread client-mode/scripts/wifi-client.sh Outdated
Comment thread daemon/src/server.rs Outdated
@BeigeBox BeigeBox marked this pull request as draft February 16, 2026 18:19
@BeigeBox
Copy link
Copy Markdown
Contributor Author

Now that I have the moxee I'm checking if it can support this too.

@BeigeBox BeigeBox force-pushed the feature/client-wifi branch from b7dc96b to 96ab600 Compare February 26, 2026 02:17
@BeigeBox BeigeBox marked this pull request as ready for review February 26, 2026 02:57
Comment thread installer/src/connection.rs Outdated
Comment thread installer/src/orbic_network.rs Outdated
Comment thread wifi/src/lib.rs Outdated
@cooperq
Copy link
Copy Markdown
Collaborator

cooperq commented Mar 4, 2026

We should figure out a way to hide the web ui config stuff if we didn't build with the wifi feature, right now as far as I can tell it would show up on all devices, no? Also It caused an error when I tried to set wifi stuff without compiling WPA supplicant first.
We should also include the steps for compiling WPA Supplicant in the building from source documentation.

@BeigeBox
Copy link
Copy Markdown
Contributor Author

BeigeBox commented Mar 4, 2026

We should figure out a way to hide the web ui config stuff if we didn't build with the wifi feature, right now as far as I can tell it would show up on all devices, no? Also It caused an error when I tried to set wifi stuff without compiling WPA supplicant first. We should also include the steps for compiling WPA Supplicant in the building from source documentation.

I recall that I was hiding the wifi stuff for devices without support for wifi yet (except the 'device security' section always shows as that's relevant whether you're on wifi or not). I have a script for compiling the WPA supplicant, maybe I forgot to include it. I'll turn that script into actual instructions.

@cooperq
Copy link
Copy Markdown
Collaborator

cooperq commented Mar 6, 2026

To clarify what I meant was I think that wifi should be a separate crate outside of rayhunter. Rust could use a good wifi crate, the only other one was last updated 2 years ago. But more importantly I think that rayhunter should not be this tightly coupled with the wifi handling. Right now this PR is probably too long to properly review, making wifi a separate external crate would probably help with that (or using an existing wifi crate.)

I also think that integrating the wifi with the installer is adding a lot of complexity for very little gain, I would suggest removing that for now and if you have a strong case for why it needs to be in there make that as a separate pull request later.

@BeigeBox
Copy link
Copy Markdown
Contributor Author

BeigeBox commented Mar 6, 2026

To clarify what I meant was I think that wifi should be a separate crate outside of rayhunter. Rust could use a good wifi crate, the only other one was last updated 2 years ago. But more importantly I think that rayhunter should not be this tightly coupled with the wifi handling. Right now this PR is probably too long to properly review, making wifi a separate external crate would probably help with that (or using an existing wifi crate.)

I also think that integrating the wifi with the installer is adding a lot of complexity for very little gain, I would suggest removing that for now and if you have a strong case for why it needs to be in there make that as a separate pull request later.

  1. Good call on removing the wifi from the installer, I'll do that.
  2. Are you suggesting a external crate on crates.io? That's a good long term goal, although I don't feel it's very actionable right now. This API is more device specific than I would like at the moment, for example adding support for the UZ801 required more tweaking than any other device so far (I haven't pushed that). I would like to eventually make it a general purpose crate, although until that point I would prefer to have it live with Rayhunter.
    EDIT: I'm willing to give it a go. I'll take a look over it and see what it would take to make it truly external, although I'm going to timebox that to an evening to avoid getting too deep into it if it's going to be a slog.
    EDIT EDIT: This is easier than I thought, I'll make it an external dep.
  3. In terms of the PR being too large to review, pulling out the wifi from the installer will help. I'll see what else I can do to slim it down.

Copy link
Copy Markdown
Collaborator

@oopsbagel oopsbagel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots to address here, I'd like to see a lot of these changes cleaned up and decoupled from this PR.

The review process has left me wondering to what degree we need to integrate any of the wifi client support with the rayhunter daemon? We're already installing wpa_supplicant, right? What we integrate with rayhunter is at this point mostly plumbing the configuration through to wpa_supplicant and configuring iptables? (I'm not mentioning the ota blocking feature because that needs to move to a separate PR.)

Ideally, we can completely decouple any code changes from rayhunter and provide them separately as a downloadable extra in the FAQ. (e.g., "here's how to setup wpa_supplicant, with links to a prebuilt and vetted binary!", the same way we provide documentation on how to disable wifi.) I'm willing to accept that the solution isn't quite that clean cut, but what besides configuration control do we gain by integrating wifi client mode into the rayhunter binary?

Critically, the stability issues need to be addressed before we can considering including this.

Comment thread .github/workflows/main.yml Outdated
Comment thread tools/build-wpa-supplicant/Dockerfile Outdated
Comment thread installer/src/orbic_network.rs Outdated
Comment thread installer/src/orbic_network.rs Outdated
Comment thread installer/src/orbic_network.rs Outdated
Comment thread daemon/src/config.rs
Comment thread installer/src/connection.rs Outdated
Comment thread daemon/src/config.rs Outdated
Comment thread installer/src/tmobile.rs
Comment thread installer/Cargo.toml Outdated
@BeigeBox
Copy link
Copy Markdown
Contributor Author

BeigeBox commented Mar 11, 2026

Lots to address here, I'd like to see a lot of these changes cleaned up and decoupled from this PR.

The review process has left me wondering to what degree we need to integrate any of the wifi client support with the rayhunter daemon? We're already installing wpa_supplicant, right? What we integrate with rayhunter is at this point mostly plumbing the configuration through to wpa_supplicant and configuring iptables? (I'm not mentioning the ota blocking feature because that needs to move to a separate PR.)

Ideally, we can completely decouple any code changes from rayhunter and provide them separately as a downloadable extra in the FAQ. (e.g., "here's how to setup wpa_supplicant, with links to a prebuilt and vetted binary!", the same way we provide documentation on how to disable wifi.) I'm willing to accept that the solution isn't quite that clean cut, but what besides configuration control do we gain by integrating wifi client mode into the rayhunter binary?

Critically, the stability issues need to be addressed before we can considering including this.

Thanks for your comments, I've looked over them and I'll address them one at a time in their respective locations.

By integrating wifi client mode into the rayhunter installer and daemon we are getting two things in my view. The first being the groundwork for future work that needs a network or internet connection without paying for sim service. The second is user experience. The less roadbumps we have to getting something like this up and running, the greater the number of rayhunters will actually be deployed. If someone has to connect to the AP wifi every time they want more info than the minimal info a colored bar gives them that's going to be an impediment to the using it. Compare that to it being on their home network (or their phones hotspot) where they can just pull it up at any time.

I guess it comes down to what the goal with rayhunter is. Are we aiming to get as many of these out there so that we can truly understand the landscape of SCC deployment, or is it going to be a passion project that requires a lot of technical knowhow. This intent to make the project more accessable bleeds into some of the other work I'm doing which is a GUI for the TFT screen on the Orbic and Moxee.

@BeigeBox
Copy link
Copy Markdown
Contributor Author

I've got some code changes to finish testing then push, as well as comments from @oopsbagel to finish replying to but my lunch hour is up so I'll try and get to that tonight.

@sudo-nano
Copy link
Copy Markdown

I agree that it'd be ideal for client mode to be part of the official rayhunter software. Being able to set up real time alerts without having to pay for a separate cell plan for my rayhunter would be a huge improvement, and having these things integrated into the official installer is a huge help. I'm moderately familiar with setting up wireless related embedded systems, and have built a pwnagotchi, and I still dread trying to use third party modules for them.

ch604
ch604 previously requested changes Mar 16, 2026
Copy link
Copy Markdown
Contributor

@ch604 ch604 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The api doc builder won't like the external struct which has no utoipa decorators, so a change will likely be required upstream if we want to add api docs here successfully.

Comment thread daemon/src/config.rs
Comment thread daemon/src/server.rs
Comment thread daemon/src/server.rs
@ch604
Copy link
Copy Markdown
Contributor

ch604 commented Mar 16, 2026

ffr happy to make that upstream pr :)

@BeigeBox
Copy link
Copy Markdown
Contributor Author

ffr happy to make that upstream pr :)

That would be appreciated, thanks

Comment thread daemon/Cargo.toml Outdated
@BeigeBox BeigeBox requested review from ch604 and oopsbagel March 17, 2026 19:43
Copy link
Copy Markdown
Collaborator

@untitaker untitaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll let @oopsbagel have the final word over things, but I think in general this looks as good as it can get, thanks for the work so far! I am saddened that we have to replicate an entire WiFi GUI for client mode to work, and I'm also not convinced that the separate init script is needed.

Comment thread installer/src/orbic_network.rs Outdated
Comment thread lib/src/lib.rs
Comment thread daemon/src/firewall.rs
@BeigeBox
Copy link
Copy Markdown
Contributor Author

I'll let @oopsbagel have the final word over things, but I think in general this looks as good as it can get, thanks for the work so far! I am saddened that we have to replicate an entire WiFi GUI for client mode to work, and I'm also not convinced that the separate init script is needed.

I had command lines in the installer, although I was asked to take it out.

@cooperq cooperq self-requested a review April 21, 2026 16:14
@BeigeBox BeigeBox requested a review from untitaker April 21, 2026 17:20
Co-authored-by: Cooper Quintin <cooperq@users.noreply.github.com>
Comment thread installer/src/connection.rs Outdated
// `command -v` is a POSIX shell builtin, so it works on minimal busybox firmware
// even when /usr/bin/which is absent.
conn.run_command(&format!(
"command -v {name} >/dev/null 2>&1 && echo FOUND || echo MISSING"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way run_command works over adb the && clause here will be checked against '/bin/rootshell -c $command` which always returns true, therefore this will always echo FOUND even if the binaries aren't there. This is probably better solved in the run_command function in orbic.rs but since this is the only place its an issue its good enough for now.

Comment thread installer/src/orbic.rs Outdated
BeigeBox and others added 2 commits April 21, 2026 17:24
Co-authored-by: Cooper Quintin <cooperq@users.noreply.github.com>
@cooperq cooperq requested review from ch604, oopsbagel and untitaker and removed request for ch604, oopsbagel and untitaker April 22, 2026 16:04
@cooperq cooperq dismissed stale reviews from untitaker, ch604, and oopsbagel April 22, 2026 16:05

stale review

@jangrewe
Copy link
Copy Markdown

😁
ShipitSquirrelGIF

@cooperq cooperq merged commit 3455adb into EFForg:main Apr 22, 2026
36 checks passed
untitaker added a commit that referenced this pull request Apr 24, 2026
PR #888 introduced more files that the installer needs to bundle. Those
files in particular are annoying to deal with because now every
developer needs a working C crosscompiler to get the installer working.
This prompted me to do some other refactoring.

Refactor install-dev to not build the wifi tools if there is no
crosscompiler, and refactor the installer so that these files are loaded
at runtime when built in debug mode.

The build script only ever warns if files are missing, and depending on
debug/release mode, the get_file!() macro either panics at runtime or
fails compiling.

Now the installer can be built again without any files, clippy can be
run directly without any envvars, and the installer runs atleast for
devices that don't need those files. The orbic installer will panic at
runtime if the wifi tools haven't been built. Building the installer in
release mode still requires all files.

Another nicety of loading these files on runtime is that the installer
does not need to be recompiled when the daemon has been rebuilt. This
should make things like make.sh really obsolete, which bypass the
installer for speed.
cooperq pushed a commit that referenced this pull request Apr 24, 2026
PR #888 introduced more files that the installer needs to bundle. Those
files in particular are annoying to deal with because now every
developer needs a working C crosscompiler to get the installer working.
This prompted me to do some other refactoring.

Refactor install-dev to not build the wifi tools if there is no
crosscompiler, and refactor the installer so that these files are loaded
at runtime when built in debug mode.

The build script only ever warns if files are missing, and depending on
debug/release mode, the get_file!() macro either panics at runtime or
fails compiling.

Now the installer can be built again without any files, clippy can be
run directly without any envvars, and the installer runs atleast for
devices that don't need those files. The orbic installer will panic at
runtime if the wifi tools haven't been built. Building the installer in
release mode still requires all files.

Another nicety of loading these files on runtime is that the installer
does not need to be recompiled when the daemon has been rebuilt. This
should make things like make.sh really obsolete, which bypass the
installer for speed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants