Git Product home page Git Product logo

wifi-connect's Introduction

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.

wifi-connect's People

Contributors

andrewn avatar balena-ci avatar balena-renovate[bot] avatar curcuz avatar dansku avatar flowzone-app[bot] avatar horia-delicoti avatar imrehg avatar james2710 avatar jbaldwinroberts avatar klutchell avatar majorz avatar nghiant2710 avatar page- avatar pcarranzav avatar petrosagg avatar pimterry avatar rahul-thakoor avatar renovate-bot avatar sradevski avatar tmigone avatar zrzka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wifi-connect's Issues

Cannot read property '0' of undefined - async timeout

Hello, this issue seems to be the same as #16.
I made sure to have the db.catchall file.

The error recived is:

30.09.15 18:15:44 [+0200] Starting node connman app
30.09.15 18:15:44 [+0200] Connman initialized
30.09.15 18:15:44 [+0200] WiFi initialized
30.09.15 18:15:44 [+0200] body-parser deprecated bodyParser: use individual json/urlencoded middlewares app.js:148:15
30.09.15 18:15:45 [+0200] body-parser deprecated undefined extended: provide extended option ../node_modules/body-parser/index.js:105:29
30.09.15 18:15:46 [+0200] Trying to join previously known networks
30.09.15 18:15:46 [+0200] Getting networks list
30.09.15 18:15:58 [+0200] Hotspot enabled
30.09.15 18:16:22 [+0200] /app/node_modules/bluebird/js/main/async.js:43
30.09.15 18:16:22 [+0200] fn = function () { throw arg; };
30.09.15 18:16:22 [+0200] ^
30.09.15 18:16:22 [+0200] TypeError: Cannot read property '0' of undefined
30.09.15 18:16:22 [+0200] at /app/src/app.js:57:45
30.09.15 18:16:22 [+0200] From previous event:
30.09.15 18:16:22 [+0200] at /app/src/app.js:56:28
30.09.15 18:16:22 [+0200] at /app/node_modules/async/lib/async.js:622:21
30.09.15 18:16:22 [+0200] at /app/node_modules/async/lib/async.js:689:13
30.09.15 18:16:22 [+0200] at iterate (/app/node_modules/async/lib/async.js:265:13)
30.09.15 18:16:22 [+0200] at /app/node_modules/async/lib/async.js:277:29
30.09.15 18:16:22 [+0200] at /app/node_modules/async/lib/async.js:44:16
30.09.15 18:16:22 [+0200] at /app/node_modules/async/lib/async.js:694:17
30.09.15 18:16:22 [+0200] at /app/node_modules/async/lib/async.js:173:37
30.09.15 18:16:22 [+0200] at null._onTimeout (/app/node_modules/async/lib/async.js:631:25)
30.09.15 18:16:22 [+0200] at Timer.listOnTimeout (timers.js:119:15)

the output for ifconfig is:

eth0 Link encap:Ethernet HWaddr b8:27:eb:40:f2:ed
inet addr:192.168.0.124 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::ba27:ebff:fe40:f2ed/64 Scope:Link
UP BROADCAST RUNNING MULTICAST DYNAMIC MTU:1500 Metric:1
RX packets:162808 errors:0 dropped:0 overruns:0 frame:0
TX packets:100314 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:220901343 (210.6 MiB) TX bytes:8696871 (8.2 MiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:2688 errors:0 dropped:0 overruns:0 frame:0
TX packets:2688 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:906202 (884.9 KiB) TX bytes:906202 (884.9 KiB)

rce0 Link encap:Ethernet HWaddr 56:84:7a:fe:97:99
inet addr:172.17.42.1 Bcast:0.0.0.0 Mask:255.255.0.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
-00
inet addr:10.2.0.101 P-t-P:10.2.0.1 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:25 errors:0 dropped:0 overruns:0 frame:0
TX packets:22 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:2260 (2.2 KiB) TX bytes:1902 (1.8 KiB)

wlan0 Link encap:Ethernet HWaddr e8:4e:06:2b:7c:f0
UP BROADCAST MULTICAST DYNAMIC MTU:1500 Metric:1
RX packets:0 errors:0 dropped:51 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

The output from iptables -t nat -L is:

Chain PREROUTING (policy ACCEPT)
target prot opt source destination
RCE all -- anywhere anywhere ADDRTYPE match dst
-type LOCAL

Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
RCE all -- anywhere !loopback/8 ADDRTYPE match dst
-type LOCAL

Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
MASQUERADE all -- 172.17.0.0/16 anywhere

Chain RCE (2 references)
target prot opt source destination

Chain TETHER (0 references)
target prot opt source destination

Hope this helps! Let me know what else i can do :)

Thanks guys Resin is awesome!

Implement exit codes

If I'm looking at the code correctly, app.coffee uses the same exit method regardless if the wifi was connected or not.
The behaviour could be better determined by an external script (implementing the required behaviour for each specific use-case) by using exit codes to determine what caused the program to exit in the first place.

I would suggest implementing the following exit codes (if possible to determine of course):

  • 0 - connected to wifi
  • 1 - general error
  • 2 - argument or configuration variable missing or incorrect
  • 10 - credentials set via AP, restarting to try a connection
  • 11 - credential set, but failed to connect to the wifi

These codes (try) to follow my understanding of Exit Codes With Special Meanings.

Using resin-wifi-connect outside the resin.io context

Hello,

Is there a way to only use this project outside the context of resin.io. All I'm looking for if the wifi captive portal functionality to be able to enter the wifi credentials. I'm trying to figure out if there's a way to use this project on a simple Raspbian installation on a RPi3. Thanks in advance!

Integrated the wifi connect to my code but it seem to run 6 times on startup

I looks like it started it 6 times. Not only that, I have to join the ResinAP and enter the passwd several times.

04.03.17 22:04:34 [-0800] Clear is disabled
04.03.17 22:04:34 [-0800] Device type is raspberrypi3
04.03.17 22:04:34 [-0800] Clear is disabled
04.03.17 22:04:34 [-0800] Device type is raspberrypi3
04.03.17 22:04:34 [-0800] Clear is disabled
04.03.17 22:04:34 [-0800] Device type is raspberrypi3
04.03.17 22:04:34 [-0800] Clear is disabled
04.03.17 22:04:34 [-0800] Device type is raspberrypi3
04.03.17 22:04:34 [-0800] Clear is disabled
04.03.17 22:04:34 [-0800] Device type is raspberrypi3
04.03.17 22:04:34 [-0800] Clear is disabled
04.03.17 22:04:34 [-0800] Device type is raspberrypi3
04.03.17 22:04:34 [-0800] Using connman.service
04.03.17 22:04:34 [-0800] Using connman.service
04.03.17 22:04:34 [-0800] Using connman.service
04.03.17 22:04:34 [-0800] Using connman.service
04.03.17 22:04:34 [-0800] Using connman.service
04.03.17 22:04:34 [-0800] Using connman.service
04.03.17 22:04:34 [-0800] Credentials not found
04.03.17 22:04:34 [-0800] Credentials not found
04.03.17 22:04:34 [-0800] Credentials not found
04.03.17 22:04:34 [-0800] Credentials not found
04.03.17 22:04:34 [-0800] Credentials not found
04.03.17 22:04:34 [-0800] Credentials not found

This message also repeats 6 times.

04.03.17 22:07:50 [-0800] Connecting
04.03.17 22:07:50 [-0800] Stopped hotspot
04.03.17 22:07:50 [-0800] Saving connection
04.03.17 22:07:50 [-0800] [service_home_ethernet]
04.03.17 22:07:50 [-0800] Type = ethernet
04.03.17 22:07:50 [-0800] Nameservers = 8.8.8.8,8.8.4.4
04.03.17 22:07:50 [-0800]
04.03.17 22:07:50 [-0800] [service_home_wifi]
04.03.17 22:07:50 [-0800] Type = wifi
04.03.17 22:07:50 [-0800] Name = THE BLACKSTONE OWL
04.03.17 22:07:50 [-0800] Passphrase = xxxxx
04.03.17 22:07:50 [-0800] Nameservers = 8.8.8.8,8.8.4.4
04.03.17 22:07:50 [-0800]
04.03.17 22:07:50 [-0800] Credentials found
04.03.17 22:07:50 [-0800] Connecting

Installation fails on node v5.10.0

I'm trying to get wifi-connect running standalone on a Raspberry Pi using nodejs v5.10.0. It successfully runs on node 0.10.

Installation fails because further down the dependency chain something relies on [email protected] which I don't think supports newer versions of node.

The latest version of dbus (0.2.17) installs without errors.

I can't find the repos for connman-simplified-resin and connman-api-resin to raise pull requests to update their dependencies.

[email protected] 
└─┬ [email protected] 
  └─┬ [email protected] 
    β”œβ”€β”€ [email protected] 
    └─┬ [email protected] 
      └── [email protected] 

Doesn't build with a C++ error in dbus package

  CXX(target) Release/obj.target/dbus/src/object_handler.o
../src/signal.cc: In function β€˜void Signal::DispatchSignal(v8::Handle<v8::Value>*)’:
../src/signal.cc:29:83: error: invalid conversion from β€˜v8::Handle<v8::Value>*’ to β€˜v8::Local<v8::Value>*’ [-fpermissive]
   Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(handler), 6, info);
                                                                                   ^
In file included from ../src/signal.cc:5:0:
../node_modules/nan/nan.h:803:35: note: initializing argument 4 of β€˜v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*)’
   NAN_INLINE v8::Local<v8::Value> MakeCallback(

I tried different node version (0.10.x, 0.12.x, latest resin/beaglebone-node), added libglib2.0-dev package (mentioned in the dbus' readme), installed newest node-gyp with npm install --unsafe-perm -g node-gyp β€”Β still the same error.

I've noticed that dbus has updated recently to 0.2.13 that uses nan-2.1.0, but its changelog doesn't mention any breaking change that looks applicable.

Make an option to have a random string after the SSID

Adding a random string after the SSID gives you the ability to turn on several devices at the same time, and connect and config one by one.

Add Math.random().toString(36).slice(2).substring(0, 4) to the SSID

So, for example, the line #2 at config.coffe will read:
ssid: process.env.PORTAL_SSID or 'resinAP - ' + Math.random().toString(36).slice(2).substring(0, 4)

The SSID will be resinAP - ahqk
(ahqk will be the random string)

We have just tried it and works good.

Maybe you can do it an option.

Error: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory

started up... knows it's on wrong network.... I join resinap... put in the right network/passwd... joins right network... everything works fine. restart app... knows it's on correct network and passes... everything works fine.... resin ssh into the container and I try to re-enter access point mode and then it goes into error.

root@raspberrypi3-610a8e3:/app/pinballiot# node src/app.js --clear=true
/app/pinballiot/node_modules/dbus/lib/bus.js:18
		self.connection = dbus._dbus.getBus(0);
		                             ^

Error: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
    at new module.exports (/app/pinballiot/node_modules/dbus/lib/bus.js:18:32)
    at module.exports.DBus.getBus (/app/pinballiot/node_modules/dbus/lib/dbus.js:48:12)
    at Object.<anonymous> (/app/pinballiot/src/connman.js:13:14)
    at Object.<anonymous> (/app/pinballiot/src/connman.js:84:4)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/app/pinballiot/src/app.js:9:13)
    at Object.<anonymous> (/app/pinballiot/src/app.js:149:4)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)

Command failed: iw wlan0 scan ap-force

Im on an Intel NUC running Resin OS 2.0.0+rev3 (prod), using the internal wifi.

Even on a clean push of this repo I get the below error on loop.

  Clearing credentials
  Credentials not found
  { Error: Command failed: iw wlan0 scan ap-force

  at ChildProcess.exithandler (child_process.js:206:12)
  at emitTwo (events.js:106:13)
  at ChildProcess.emit (events.js:191:7)
  at maybeClose (internal/child_process.js:877:16)
  at Socket.<anonymous> (internal/child_process.js:334:11)
  at emitOne (events.js:96:13)
  at Socket.emit (events.js:188:7)
  at Pipe._handle.close [as _onclose] (net.js:498:12)
  cause:
  { Error: Command failed: iw wlan0 scan ap-force

  at ChildProcess.exithandler (child_process.js:206:12)
  at emitTwo (events.js:106:13)
  at ChildProcess.emit (events.js:191:7)
  at maybeClose (internal/child_process.js:877:16)
  at Socket.<anonymous> (internal/child_process.js:334:11)
  at emitOne (events.js:96:13)
  at Socket.emit (events.js:188:7)
  at Pipe._handle.close [as _onclose] (net.js:498:12)
  killed: false,
  code: 1,
  signal: null,
  cmd: 'iw wlan0 scan ap-force' },
  isOperational: true,
  killed: false,
  code: 1,
  signal: null,
  cmd: 'iw wlan0 scan ap-force' }

New code can cause device to get into an unrecoverable error state

Background:
Our device was not connected over ethernet anymore while integrating and testing the new wifi connect code.

Presumably I touched the network.config file, corrupting it causing the ethernet to be disabled.
Luckily after a reboot the captive portal was started and using the captive portal someone near the device was able to overwrite the file.

Problem:
This was definitely a human error, however while figuring out what happened I thought I had touched the touched the persisted network config file, and if I did we would have lost it with no way to get it back online (until a reinstall), due to the captive portal not being started and connman not having a valid network config thus disabling all adapters.

Potential remedies:
Check if files are valid before copying them into the running config and/or revert back to the image's configuration after some time disconnected/when invalid file is detected.

Cannot read property '0' of undefined + Captive Portal not working

Connman initialized                                                                                                                                   
WiFi initialized                                                                                                                                      
Mon, 14 Sep 2015 09:04:10 GMT body-parser deprecated bodyParser: use individual json/urlencoded middlewares at app.js:148:15                          
Mon, 14 Sep 2015 09:04:10 GMT body-parser deprecated undefined extended: provide extended option at ../node_modules/body-parser/index.js:105:29       
Trying to join previously known networks                                                                                                              
Getting networks list                                                                                                                                 
Hotspot enabled                                                                                                                                       

/usr/src/app/node_modules/bluebird/js/main/async.js:43                                                                                                
        fn = function () { throw arg; };                                                                                                              
                                 ^                                                                                                                    
TypeError: Cannot read property '0' of undefined                                                                                                      
    at /usr/src/app/src/app.js:57:45                                                                                                                  
    at tryCatcher (/usr/src/app/node_modules/bluebird/js/main/util.js:26:23)                                                                          
    at Function.Promise.attempt.Promise.try (/usr/src/app/node_modules/bluebird/js/main/method.js:31:24)                                              
    at async.retry.callback.table (/usr/src/app/src/app.js:56:28)                                                                                     
    at /usr/src/app/node_modules/async/lib/async.js:622:21                                                                                            
    at /usr/src/app/node_modules/async/lib/async.js:689:13                                                                                            
    at iterate (/usr/src/app/node_modules/async/lib/async.js:265:13)                                                                                  
    at /usr/src/app/node_modules/async/lib/async.js:277:29                                                                                            
    at /usr/src/app/node_modules/async/lib/async.js:44:16                                                                                             
    at /usr/src/app/node_modules/async/lib/async.js:694:17                                                                                            
    at /usr/src/app/node_modules/async/lib/async.js:173:37                                                                                            
    at null._onTimeout (/usr/src/app/node_modules/async/lib/async.js:631:25)                                                                          
    at Timer.listOnTimeout [as ontimeout] (timers.js:112:15)  

npm ERR! Linux 3.18.5                                                                                                                                 
npm ERR! argv "node" "/usr/local/bin/npm" "start"                                                                                                     
npm ERR! node v0.10.38                                                                                                                                
npm ERR! npm  v2.10.1                                                                                                                                 
npm ERR! code ELIFECYCLE                                                                                                                              
npm ERR! [email protected] start: `cd src && node app.js`                                                                                      
npm ERR! Exit status 8                                                                                                                                
npm ERR!                                                                                                                                              
npm ERR! Failed at the [email protected] start script 'cd src && node app.js'.                                                                 
npm ERR! This is most likely a problem with the resin-wifi-connect package,                                                                           
npm ERR! not with npm itself.                                                                                                                         
npm ERR! Tell the author that this fails on your system:                                                                                              
npm ERR!     cd src && node app.js                                                                                                                    
npm ERR! You can get their info via:                                                                                                                  
npm ERR!     npm owner ls resin-wifi-connect                                                                                                          
npm ERR! There is likely additional logging output above.                                                                                             

npm ERR! Please include the following file with any support request:                                                                                  
npm ERR!     /usr/src/app/npm-debug.log   

Support bridging

Allow the wifi internet connection to be shared with an external device over ethernet

Cleanup the Edison version and move to a forked repo

The edison version works, but can be refactored to also work with connman (currently uses hostapd) now that the kernel module issue it had is resolved.

It should also be a separate repo (fork), to improve its visibility and allow making PR's from one to the other to update functionality.

TypeError: Cannot read property '0' of undefined (bluebird/js/main/async.js:43)

Hello,

I'm having some trouble starting the portal mode, I have a Ralink RT5370 (http://www.amazon.fr/gp/product/B00BXWU7X4), but the portal mode never start due to this error :

04.03.16 10:39:43 [+0100] /usr/src/app/node_modules/bluebird/js/main/async.js:43
04.03.16 10:39:43 [+0100] fn = function () { throw arg; };
04.03.16 10:39:43 [+0100] ^
04.03.16 10:39:43 [+0100] TypeError: Cannot read property '0' of undefined
04.03.16 10:39:43 [+0100] at /usr/src/app/src/app.js:63:45
04.03.16 10:39:43 [+0100] at tryCatcher (/usr/src/app/node_modules/bluebird/js/main/util.js:26:23)
04.03.16 10:39:43 [+0100] at Function.Promise.attempt.Promise.try (/usr/src/app/node_modules/bluebird/js/main/method.js:31:24)
04.03.16 10:39:43 [+0100] at async.retry.callback.table (/usr/src/app/src/app.js:60:28)
04.03.16 10:39:43 [+0100] at /usr/src/app/node_modules/async/lib/async.js:651:21
04.03.16 10:39:43 [+0100] at /usr/src/app/node_modules/async/lib/async.js:718:13
04.03.16 10:39:43 [+0100] at iterate (/usr/src/app/node_modules/async/lib/async.js:262:13)
04.03.16 10:39:43 [+0100] at /usr/src/app/node_modules/async/lib/async.js:274:29
04.03.16 10:39:43 [+0100] at /usr/src/app/node_modules/async/lib/async.js:44:16
04.03.16 10:39:43 [+0100] at /usr/src/app/node_modules/async/lib/async.js:723:17
04.03.16 10:39:43 [+0100] at /usr/src/app/node_modules/async/lib/async.js:167:37
04.03.16 10:39:43 [+0100] at null._onTimeout (/usr/src/app/node_modules/async/lib/async.js:660:25)
04.03.16 10:39:43 [+0100] at Timer.listOnTimeout [as ontimeout] (timers.js:121:15)

When I check the os.networkInterfaces() I get only the eth0 :

{ lo:
04.03.16 10:39:43 [+0100] [ { address: '127.0.0.1', family: 'IPv4', internal: true },
04.03.16 10:39:43 [+0100] { address: '::1', family: 'IPv6', internal: true } ],
04.03.16 10:39:43 [+0100] eth0:
04.03.16 10:39:43 [+0100] [ { address: '192.168.0.22', family: 'IPv4', internal: false },
04.03.16 10:39:43 [+0100] { address: 'fe80::ba27:ebff:fe5b:a761',
04.03.16 10:39:43 [+0100] family: 'IPv6',
04.03.16 10:39:43 [+0100] internal: false } ] }

Any idea ? It's the first time I launch the app and the dongle has never been connected to the wifi. Plus, I downloanded and installed the resin.io basic image with ethernet in the RPi 2 without the wifi.

Unhandled rejection Error: org.freedesktop.DBus.Error.NoReply

Raspberry Pi 3
Resin OS 2.0.0+rev2
Modem Ralink RT5370

The error happens from time to time.
Output of lsusb shows the modem is correctly detected and lsmod show the drivers are correctly loaded but ifconfig does not show any wlan interface.

I am using a good quality power adapter with plenty of current.

Has anyone experimented such an issue ?

No Retry On Authentication After Entering Password.

After entering as password in the captive portal, it seems that there is only one try to associate. If there is a comms error like a 3=DEAUTH_LEAVING rather than a password error it still restarts the AP. A retry would have connected.

The 'Trying to join known networks' path does have 3 retries and will connect in that particular case.
I have seen the NUC wifi take a bit of time to settle down when any of its modes have changed.

-Andy

Runtime deprectaion errors for body-parser

When running the project these warnings appear in the logs. We should update to the latest version to get rid of them

> 14.06.16 14:34:03 [-0700] body-parser deprecated bodyParser: use individual json/urlencoded middlewares app.js:148:15
> 14.06.16 14:34:05 [-0700] body-parser deprecated undefined extended: provide extended option ../node_modules/body-parser/index.js:105:29

Doesn't work on edison with resinOS 2.0.5

Tested the master branch on the latest resinOS 2.0.5 edison release.
resin-wifi-connect sets up the AP correctly and shows a list of scanned Access points, I entered the correct credentials, but the device never gets connected to the network.

It seems that the modprobe to reload the firmware fails or something like that, since when i looked into the device on serial, ifconfig didn't list wlan0 anymore.

Support connecting to networks that have a captive portal

Probably a tricky one, but we could either support:

  • Using WISPr to authenticate with portals that support it, or
  • Having a simple web crawler that enters the credentials into the correct fields. Maybe the field names can be specified (with env vars?) and instead of a crawler we just do a simple HTTP request to authenticate.

Clean install not working

Hard: RPi2
Error is:

Error while processing push: Error: lstat .bowerrc: no such file or directory

I had to remove this .bowerrc from the COPY in line 25 of the Dockerfile.template

wlan0 does not exist anymore

I was following this guide - http://andrewnicolaou.co.uk/posts/2015/resin-wifi-connect-without-docker.

And there was a command
sudo ./provision iptables node wifi-connect
After running this, it did something to the iptables but couldn't download node or wifi-connect.

Problem was after this my Pi3 does not connect to wifi anymore.
After that point doing ifconfig wlan0 prompted wlan0 does not exist. Nor sudo ifup wlan0 helped.
So I decided to reflash the SD card but the problem has persisted.

Before the iptables thing, when running sudo wpa_supplicant -Dn180211 -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf earlier it showed something about the driver.

But after that iptables thing, running that command simply said the driver was unsupported and this persisted even after reflashing the SD card.

Can you help me out, please? Why is it showing the driver being unsupported?

npm start fails

Hey @pcarranzav, I just tried this out, clone and pushed on first container load and npm start fails. Am I missing something? or has something broken?

18.08.15 16:08:41 [+0100] events.js:196
18.08.15 16:08:41 [+0100] throw TypeError('listener must be a function');
18.08.15 16:08:41 [+0100] ^
18.08.15 16:08:41 [+0100] TypeError: listener must be a function
18.08.15 16:08:41 [+0100] at TypeError (<anonymous>)
18.08.15 16:08:41 [+0100] at removeListener (events.js:196:11)
18.08.15 16:08:41 [+0100] at onChange (/usr/src/app/node_modules/connman-simplified/lib/WiFi.js:250:32)
18.08.15 16:08:41 [+0100] at emit (events.js:98:17)
18.08.15 16:08:41 [+0100] at null.<anonymous> (/usr/src/app/node_modules/connman-simplified/node_modules/connman-api/lib/service.js:87:12)
18.08.15 16:08:41 [+0100] at emit (events.js:117:20)
18.08.15 16:08:41 [+0100] at null.<anonymous> (/usr/src/app/node_modules/connman-simplified/node_modules/connman-api/node_modules/dbus/lib/bus.js:43:22)
18.08.15 16:08:41 [+0100] at emit (events.js:106:17)
18.08.15 16:08:41 [+0100] at /usr/src/app/node_modules/connman-simplified/node_modules/connman-api/node_modules/dbus/lib/dbus.js:70:42

rpi3 NetworkManager error

I'm trying to use the resin-wifi-connect with resinos 2.0.0.beta with raspberry pi 3.
I always get the following error after saving the conenction password:

Saving connection
{ '802-11-wireless': { ssid: [ 70, 82, 73, 84, 90, 33, 66, 111, 120, 32, 55, 52, 57, 48 ] },
connection: { id: 'xxxxxxxxxxx', type: '802-11-wireless' },
'802-11-wireless-security':
{ 'auth-alg': 'open',
'key-mgmt': 'wpa-psk',
psk: 'xxxxxxxxxxxxxxxxx' } }
Error: org.freedesktop.NetworkManager.Settings.Failed
at Error (native)
Retrying

I'm using the FROM resin/raspberrypi3-node:6 in my Docker file and everything else is mostly copy and paste from the https://github.com/resin-io-projects/resin-wifi-connect-example

Is it any problem with the resinos v2?
Hoping for some good advice, thanks!

Super simple rust binary

Create a simple rust binary that follows the flowchart below and makes use of the network_manager module we have written. The idea is that users can wrap this binary in their own code to get the various behaviors they need.

screenshot_2017-04-05_14-13-29_ 0100

Wifi dongle wu710n

Hello,

Is the Wifi dongle wu710n will work for the hotspot mode ? because I'm getting Cannot read property '0' of undefined too.

Thanks.

Need environment variable to work with systemd

When systemd is enabled (ENV INITSYSTEM on), the dbus socket will be overwritten by the container's dbus. We need to start the node app with DBUS_SYSTEM_BUS_ADDRESS=unix:path=/host_run/dbus/system_bus_socket. We also need to RUN systemctl disable connman in Dockerfile.template.

AP OK but not the captive portal

Hello,

I'm trying to create a AP with my Rpi2, everything is working well : I can see the AP in my wifi list and connect to it. But the captive portal won't open automatically.

I need to type the ip address in the browser to see the captive portal. By the way the Rpi2 internal IP 192.168.5.1 (dynamic) is different from 192.168.0.1 (which we have in the db.catchall file)

how the captive portal can be open after the connection to the AP ?
Do I need to change the db.catchall to update the IP after each reboot ?

any clue ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.