• Stars
    star
    1,264
  • Rank 37,217 (Top 0.8 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created over 9 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Easy WiFi setup for Linux devices from your mobile phone or laptop

Easy WiFi setup for Linux devices from your mobile phone or laptop

WiFi Connect is a utility for dynamically setting the WiFi configuration on a Linux device via a captive portal. WiFi credentials are specified by connecting with a mobile phone or laptop to the access point that WiFi Connect creates.

Current Release CircleCI status License Issues

an open source ๐Ÿ“ก project by balena.io

Download | How it works | Installation | Support | Roadmap

How it works

How it works

WiFi Connect interacts with NetworkManager, which should be the active network manager on the device's host OS.

1. Advertise: Device Creates Access Point

WiFi Connect detects available WiFi networks and opens an access point with a captive portal. Connecting to this access point with a mobile phone or laptop allows new WiFi credentials to be configured.

2. Connect: User Connects Phone to Device Access Point

Connect to the opened access point on the device from your mobile phone or laptop. The access point SSID is, by default, WiFi Connect. It can be changed by setting the --portal-ssid command line argument or the PORTAL_SSID environment variable (see this guide for how to manage environment variables when running on top of balenaOS). By default, the network is unprotected, but a WPA2 passphrase can be added by setting the --portal-passphrase command line argument or the PORTAL_PASSPHRASE environment variable.

3. Portal: Phone Shows Captive Portal to User

After connecting to the access point from a mobile phone, it will detect the captive portal and open its web page. Opening any web page will redirect to the captive portal as well.

4. Credentials: User Enters Local WiFi Network Credentials on Phone

The captive portal provides the option to select a WiFi SSID from a list with detected WiFi networks and enter a passphrase for the desired network.

5. Connected!: Device Connects to Local WiFi Network

When the network credentials have been entered, WiFi Connect will disable the access point and try to connect to the network. If the connection fails, it will enable the access point for another attempt. If it succeeds, the configuration will be saved by NetworkManager.


For a complete list of command line arguments and environment variables check out our command line arguments guide.

The full application flow is illustrated in the state flow diagram.


Installation

WiFi Connect is designed to work on systems like Raspbian or Debian, or run in a docker container on top of balenaOS.

Raspbian/Debian Stretch

WiFi Connect depends on NetworkManager, but by default Raspbian Stretch uses dhcpcd as a network manager. The provided installation shell script disables dhcpcd, installs NetworkManager as the active network manager and downloads and installs WiFi Connect.

Run the following in your terminal, then follow the onscreen instructions:

bash <(curl -L https://github.com/balena-io/wifi-connect/raw/master/scripts/raspbian-install.sh)

balenaOS

WiFi Connect can be integrated with a balena.io application. (New to balena.io? Check out the Getting Started Guide.) This integration is accomplished through the use of two shared files:

  • The Dockerfile template manages dependencies. The example included here has everything necessary for WiFi Connect. Application dependencies need to be added. For help with Dockerfiles, take a look at this guide.
  • The start script should contain the commands that run the application. Adding these commands at the end of the script will ensure that everything kicks off after WiFi is correctly configured. An example of using WiFi Connect in a Python project can be found here.

balenaOS: multicontainer app

To use WiFi Connect on a multicontainer app you need to:

  • Set container network mode to host
  • Enable DBUS by adding the required label and environment variable (more on balenaOS dbus)
  • Grant the container Network Admin capabilities

Your docker-compose.yml file should look like this:

version: "2.1"

services:
    wifi-connect:
        build: ./wifi-connect
        network_mode: "host"
        labels:
            io.balena.features.dbus: '1'
        cap_add:
            - NET_ADMIN
        environment:
            DBUS_SYSTEM_BUS_ADDRESS: "unix:path=/host/run/dbus/system_bus_socket"
    ...

Supported boards / dongles

WiFi Connect has been successfully tested using the following WiFi dongles:

Dongle Chip
TP-LINK TL-WN722N Atheros AR9271
ModMyPi Ralink RT3070
ThePiHut Ralink RT5370

It has also been successfully tested with the onboard WiFi on a Raspberry Pi 3.

Given these results, it is probable that most dongles with Atheros or Ralink chipsets will work.

The following dongles are known not to work (as the driver is not friendly with access point mode or NetworkManager):

  • Official Raspberry Pi dongle (BCM43143 chip)
  • Addon NWU276 (Mediatek MT7601 chip)
  • Edimax (Realtek RTL8188CUS chip)

Dongles with similar chipsets will probably not work.

WiFi Connect is expected to work with all balena.io supported boards as long as they have the compatible dongles.


Support

If you're having any problem, please raise an issue on GitHub or contact us, and the balena.io team will be happy to help.


License

WiFi Connect is free software, and may be redistributed under the terms specified in the license.

More Repositories

1

meta-balena

A collection of Yocto layers used to build balenaOS images
BitBake
967
star
2

balena-engine

Moby-based Container Engine for Embedded, IoT, and Edge uses
Go
686
star
3

balena-raspberrypi

Balena support for RaspberryPI boards
BitBake
190
star
4

balena-supervisor

Balena Supervisor: balena's agent on devices.
TypeScript
147
star
5

balena-os

The central place for all things BalenaOS related.
113
star
6

jetson-flash

This tool allows users to flash BalenaOS on Jetson supported devices
JavaScript
63
star
7

balenaos-in-container

Run balenaOS as a docker container
Shell
49
star
8

balena-jetson

BitBake
44
star
9

kernel-module-build

Example project for building an OOT kernel module in balena
Shell
35
star
10

balenahup

BALENA Host os UPdater
Shell
35
star
11

balena-intel

Balena support for Intel boards
BitBake
33
star
12

librsync-go

Pure Go implementation of librsync/rdiff
Go
31
star
13

configizer

Safe(r) balenaOS config.json updates remotely
Shell
26
star
14

leviathan

A distributed hardware testing framework
JavaScript
23
star
15

balena-allwinner

BitBake
20
star
16

balena-beaglebone

Balena support for Beaglebone boards
BitBake
20
star
17

balena-yocto-scripts

Helper scripts for balena yocto builds
Shell
20
star
18

balena-os-device-support

A list of current, proposed and planned future balena.io supported boards
19
star
19

balena-odroid

Balena support for ODROID boards
BitBake
15
star
20

healthdog-rs

Helper program that connects external periodic heathchecks with systemd's watchdog support
Rust
15
star
21

resin-device-toolbox

[DEPRECATED] The official Resin Device Toolbox CLI for resinOS
CoffeeScript
14
star
22

balena-radxa

BitBake
13
star
23

module-headers

Tool for generating kernel module headers from kernel source. Heavily based on arch's x86-64 PKGBUILD.
Shell
13
star
24

balena-variscite-mx8

BitBake
11
star
25

meta-artik

BSP Yocto layer for Samsung Artik board
BitBake
11
star
26

takeover

Migrate arbitrary devices to balena
Rust
11
star
27

balena-asus-tinker-board

CoffeeScript
10
star
28

balena-generic

Balena support for generic devices
BitBake
9
star
29

balena-image-flasher-unwrap

Tool for unwrapping balena-image from a balena-image-flasher
Shell
8
star
30

balena-fsl-arm

Balena support for Freescale boards
BitBake
8
star
31

serial-it

Shell
7
star
32

balena-qemu

Balena support for QEMU boards
CoffeeScript
7
star
33

os-config

Rust
6
star
34

balena-jetson-orin

Balena integration repository for Jetson Orin devices
Shell
6
star
35

linux-artik7

Linux kernel for Artik 710
C
6
star
36

balena-artik

Balena support for Artik boards
CoffeeScript
6
star
37

balena-up-board

Balena support for UP board
BitBake
6
star
38

leviathan-worker

The worker layer for Leviathan including worker plugins QemuKit & AutoKit
TypeScript
6
star
39

balena-edison

Balena support for Edison boards
Roff
6
star
40

balena-seeed-x86

BitBake
5
star
41

balena-iot-gate-imx8

Shell
5
star
42

balenaosversions

List of released OS versions for different devices on Balena Cloud
JavaScript
5
star
43

poky

Python
4
star
44

bindmount

Rust
4
star
45

balena-coral

BitBake
4
star
46

balena-nanopc-t4

BitBake
4
star
47

balenafin-raspbian

Raspbian support for balenaFin
Shell
4
star
48

uboot-artik7

uBoot for Artik 710
C
4
star
49

balena-isg

Support for Rocktech ISG boards
BitBake
4
star
50

balena-board-template

This is a template to be used for new board support repositories.
4
star
51

mobynit

Package to mount hostapp filessytems
Go
4
star
52

balena-iot-gate-imx8plus

BitBake
3
star
53

balena-variscite

Balena support for Variscite boards
BitBake
3
star
54

balena-owa5x

BitBake
3
star
55

migrate

Migrate brownfield devices to Balena
Rust
3
star
56

balena-benchmarks

Benchmarks for balaena
Shell
3
star
57

meta-edison-bsp

C
3
star
58

balena-artik710

Balena support for Artik 710 boards
CoffeeScript
3
star
59

balena-am571x-evm

Balena support for am57xx-evm boards
CoffeeScript
3
star
60

balena-intel-quark

Balena support for intel-quark boards
JavaScript
3
star
61

meta-artik710

BSP Yocto layer for Samsung Artik 710 board and Co
BitBake
3
star
62

build-artik

Scripts and prebuilts for artik boards
Shell
3
star
63

fatrw

CLI utility and a Rust library that implements safe file read and write operations for FAT file systems
Rust
3
star
64

balena-compulab

BitBake
3
star
65

balena-toradex

Balena support for Toradex boards
CoffeeScript
3
star
66

meta-resin-extra

meta-resin-extra is a Yocto layer used to build extra/optional package on top of meta-resin
BitBake
3
star
67

cloud-config

balenaCloud application used to configure balenaOS from supported metadata services
Shell
3
star
68

balena-chip

Balena support for C.H.I.P. boards
CoffeeScript
3
star
69

balena-ts

Balena support for TS boards
CoffeeScript
3
star
70

balena-parallella

Balena support for Parallella boards
CoffeeScript
3
star
71

balena-iot2000

Balena support for the Siemens IOT2000 family
CoffeeScript
3
star
72

brcm_patchram_plus

Broadcom utility to upload firmware on bluetooth chips
C
3
star
73

resin-provisioner

Supervisor component for provisioning a device against resin servers.
Go
3
star
74

balena-sign

Service used to sign data over the network and retrieve the respective public keys
Python
3
star
75

balena-tci

Shell
2
star
76

resinos-tests-legacy

Shell
2
star
77

test-helpers

TypeScript
2
star
78

meta-tegra

BitBake
2
star
79

meta-tinker-board

BSP yocto layer for Asus Tinker Board
BitBake
2
star
80

renovate-config

Shared renovate configuration and GitHub Action
2
star
81

iot-gate-imx8plus-flashtools

Container scripts for flashing Compulab IOT-GATE-iMX8PLUS with BalenaOS
Shell
2
star
82

balena-jetson-wnb

BitBake
2
star
83

balena-rockpro64

BitBake
2
star
84

gazette

A lightweight log collection service for sending system logs to the balena API
Shell
2
star
85

balena-revpi

BalenaOS integration layer for the Revolution Pi boards
C++
2
star
86

balena-zc702

Balena support for ZYNQ ZC702 boards
CoffeeScript
2
star
87

balena-topic

BitBake
2
star
88

log-streamer

Test sending logs to the API log-stream
TypeScript
2
star
89

balenaos-extra-tools

Shell
2
star
90

colibri-ddr-patch

WIP: Patch DDR size in Colibri boards
C
2
star
91

github-workflows

A collection of reusable github workflows
2
star
92

balena-via-arm

Balena support for VAB820 boards
CoffeeScript
2
star
93

resin-edge

Resin support for edge devices build environment
Shell
2
star
94

balena-connectcore

BalenaOS for the Digi ConnectCore SBCs and System-On-Modules
BitBake
2
star
95

balena-nanopi-r2

BitBake
2
star
96

qemukit

Qemukit helps in writing automated tests on Qemu environments
TypeScript
2
star
97

amber-etcher-kernel

Shell
2
star
98

meta-radxa-rockpi

1
star
99

balena-ts-7970

1
star
100

balenaos-contracts

A collection of meta-data for BalenaOS extensions
1
star