Merge ~snappy-hwe-team/snappy-hwe-snaps/+git/wifi-connect:docs-0.11 into ~snappy-hwe-team/snappy-hwe-snaps/+git/wifi-connect:master

Proposed by Kyle Nitzsche
Status: Merged
Approved by: Kyle Nitzsche
Approved revision: 21413851075237a74e2edf765ce41f1fc51a58a6
Merged at revision: 0934f5875b07a1851f37586ef40a2c60860b4444
Proposed branch: ~snappy-hwe-team/snappy-hwe-snaps/+git/wifi-connect:docs-0.11
Merge into: ~snappy-hwe-team/snappy-hwe-snaps/+git/wifi-connect:master
Diff against target: 715 lines (+407/-141)
11 files modified
dev/null (+0/-70)
docs/configure.md (+174/-0)
docs/faq.md (+22/-2)
docs/features.md (+36/-0)
docs/how_it_works.md (+31/-0)
docs/index.md (+17/-10)
docs/installation.md (+19/-54)
docs/metadata.yaml (+9/-3)
docs/normal_use.md (+91/-0)
docs/revisions.md (+6/-0)
hooks/configure.go (+2/-2)
Reviewer Review Type Date Requested Status
System Enablement Bot continuous-integration Approve
Review via email: mp+337022@code.launchpad.net

Description of the change

Docs for wifi-connect 0.11. Reviews appreciated.

Review should be done on built docs:

* cd to docs/
* execute documentation-builder (installed as a snap).
* Open docs/build/index.html

See it here: https://private-fileshare.canonical.com/~knitzsche/wifi-connect/0.11-MR/index.html

You can also get it here: https://private-fileshare.canonical.com/~knitzsche/wifi-connect/wifi-connect-0.11-mr-docs.tar.gz

To post a comment you must log in.
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :

PASSED: Successfully build documentation, rev: 6f4d7ec6e73d43ea3008cd048d9d8e8a7946d325

Generated documentation is available at https://jenkins.canonical.com/system-enablement/job/snappy-hwe-snaps-snap-docs/1010/

Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :

PASSED: Successfully build documentation, rev: 21413851075237a74e2edf765ce41f1fc51a58a6

Generated documentation is available at https://jenkins.canonical.com/system-enablement/job/snappy-hwe-snaps-snap-docs/1011/

Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :

PASSED: Successfully build documentation, rev: 6f4d7ec6e73d43ea3008cd048d9d8e8a7946d325

Generated documentation is available at https://jenkins.canonical.com/system-enablement/job/snappy-hwe-snaps-snap-docs/1012/

Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :

PASSED: Successfully build documentation, rev: 21413851075237a74e2edf765ce41f1fc51a58a6

Generated documentation is available at https://jenkins.canonical.com/system-enablement/job/snappy-hwe-snaps-snap-docs/1013/

Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/docs/configure.md b/docs/configure.md
2new file mode 100644
3index 0000000..67188f9
4--- /dev/null
5+++ b/docs/configure.md
6@@ -0,0 +1,174 @@
7+---
8+title: "Configuration"
9+table_of_contents: True
10+---
11+
12+# Configuration methods
13+
14+Various options can be configured using snapd variables for the wifi-connect snap.
15+
16+These options can be defined in a gadget snap. This approach is appropriate for those who want to integrate wifi-connect into an image.
17+
18+These options can also be set in terminal.
19+
20+## Preconfiguration in gadget.yaml
21+
22+When you pre-install wifi-connect snap into an image, you can use the gadget snap's [gadget.yaml](https://docs.ubuntu.com/core/en/reference/gadget) file to pre-configure certain options. You use the ```defaults``` section to set snapd variables for wifi-connect snap. When wifi-connect is installed, it's configure hook script reads the appropriate snapd variables (if any) and uses their values to set options accordingly.
23+
24+To use this approach, you need to know the snap-id of the wifi-connect snap. This can be obtained with ```snap info wifi-connect```.
25+
26+You also need the key name and the value for each configuration option the, as covered below.
27+
28+## Configuration from terminal
29+
30+In general, you can set these configuration options at runtime from terminal with:
31+
32+```bash
33+$ sudo snap set wifi-connect KEY=VALUE
34+```
35+
36+**Note**: In many cases, setting wifi-connect snapd variables does not take effect until wifi-connect is restarted. Restart it manually with:
37+
38+```bash
39+sudo snap restart wifi-connect
40+```
41+
42+**Note**: When the deamon starts, it logs any preconfigurations found and applied, for example:
43+
44+```bash
45+Jun 20 22:07:16 thehost snap[18004]: == wifi-connect/SetDefaults portal password being set
46+Jun 20 22:07:16 thehost snap[18004]: == wifi-connect/SetDefaults: reset creds requirement is now disabled
47+```
48+
49+# AP passphrase
50+
51+Normally the wifi-connect AP passphrase is randomly created by the wifi-ap snap.
52+
53+Preset the passphrase in the gadget.yaml ```defaults``` section with the following:
54+
55+ * snapd key: wifi.security-passphrase
56+ * value: the passhrase (8-13 characters, must start with a letter)
57+
58+For example:
59+
60+```bash
61+defaults:
62+ UGPDdo1mCPUIPOEH3CCCH1ykvB8S0OhB:
63+ wifi.security-passphrase: THISISTHENEWAPPASSPHRASE
64+```
65+
66+Note: long alpha-numeric string is the wifi-connect snapd-id (currently).
67+
68+You can set this from terminal as follows:
69+
70+```bash
71+$ sudo snap set wifi-connect wifi.security-passphrase=THISISTHENEWAPPASSPHRASE
72+```
73+
74+# AP SSID
75+
76+By default, the AP's SSID is (currently) "Ubuntu".
77+
78+You can set this from the terminal as follows:
79+
80+```bash
81+$ sudo wifi-connect passphrase THISISTHENEWAPPASSPHRASE
82+```
83+
84+This cannot currently be configured from the gadget.yaml.
85+
86+# Portal password
87+
88+To access any wifi-connect web page you need to enter the portal password.
89+
90+Note: the password must be 8 to 13 chars in length, and it must start with a letter.
91+
92+Preset the portal password in the gadget.yaml ```defaults``` section with the following:
93+
94+ * snapd key: portal.password
95+ * value: the password
96+
97+For example:
98+
99+```bash
100+defaults:
101+ UGPDdo1mCPUIPOEH3CCCH1ykvB8S0OhB:
102+ portal.password: THENEWPASSWORD
103+```
104+
105+You can set this from terminal as follows:
106+
107+```bash
108+$ sudo snap set wifi-connect portal-password=THENEWPORTALPASSWORD
109+```
110+
111+# Disable credential resetting
112+
113+Normally, the first user to access the Management web page is required to reset the wifi-connect AP passphrase and the portal password (used to access wifi-connect web pages). This is a useful security feature, especially for integrators that preset these credential in their image (because every image has the same passphrase and password).
114+
115+However, some integrators may want to disable this requirement.
116+
117+Disable the requirement to reset the AP passphrase and portal password on first use in the gadget.yaml ```defaults``` section with the following:
118+
119+ * snapd key: portal.no-reset-creds
120+ * value: true
121+
122+For example:
123+
124+```bash
125+defaults:
126+ UGPDdo1mCPUIPOEH3CCCH1ykvB8S0OhB:
127+ portal.no-reset-cred: true
128+```
129+
130+You can set this from terminal as follows:
131+
132+```bash
133+$ sudo snap set wifi-connect portal.no-reset-cred=true
134+```
135+
136+# Enble display of the Operational Portal
137+
138+The Operational portal can be enabled so that it is available when the device is connected to an external AP.
139+
140+It provides a button the user can click to disconnect from the external AP, which causes the system to switch to Unconnected mode. By default, the Operational portal is disabled. When the page is disabled one must use the terminal (or some other means) to direct the device to disconnect form the external AP.
141+
142+The Operational portal is disabled by default because using it requires entering the portal password and communications are http, not https.
143+
144+**Warning**: Enabling the Operational portal represents a potential security vulnerability because the portal password is conveyed in clear text in the http header.
145+
146+
147+Disable the Operational portal as follows:
148+
149+ * snapd key: portal.operational
150+ * value: true
151+
152+For example:
153+
154+```bash
155+defaults:
156+ UGPDdo1mCPUIPOEH3CCCH1ykvB8S0OhB:
157+ portal.operational: true
158+```
159+
160+You can set this from terminal as follows:
161+
162+```bash
163+$ sudo snap set wifi-connect portal.operational=true
164+```
165+
166+# Additional AP configurations
167+
168+You can set and set various AP configurations.
169+
170+View them all with:
171+
172+```bash
173+$ sudo wifi-ap.config get
174+```
175+
176+Set with:
177+
178+```bash
179+$ sudo wifi-ap.config set KEY=VAULE
180+```
181diff --git a/docs/faq.md b/docs/faq.md
182index ec8f87e..75cb029 100644
183--- a/docs/faq.md
184+++ b/docs/faq.md
185@@ -3,8 +3,28 @@ title: "Frequently asked questions"
186 table_of_contents: True
187 ---
188
189-# Restarting the wifi-connect daemon
190+# Where do I file a bug?
191+
192+https://bugs.launchpad.net/snappy-hwe-snaps
193+
194+Please add the follow **Tag** in **Extra Options**: "wifi-connect"
195+
196+# How do I request features?
197+
198+You may file a bus as described above.
199+
200+# How do I restarting the wifi-connect daemon?
201
202 ```bash
203-sudo systemctl restart snap.wifi-connect.daemon.service
204+sudo snap restart wifi-connect
205 ```
206+
207+# How do I view relevant log messages?
208+
209+```bash
210+$ sudo journalctl -f | grep wifi-connect
211+```
212+
213+# How do I use a different interface for Wi-Fi?
214+
215+The current hard coded default is wlan0.
216diff --git a/docs/features.md b/docs/features.md
217new file mode 100644
218index 0000000..1108429
219--- /dev/null
220+++ b/docs/features.md
221@@ -0,0 +1,36 @@
222+---
223+title: "Getting Started"
224+table_of_contents: True
225+---
226+
227+# First steps
228+
229+
230+
231+
232+Wifi-connect requires a passphrase to join the AP. This can be pre-configured in your system.
233+
234+
235+## C
236+
237+On first use,
238+
239+# Portal Password
240+
241+wifi-connect has web pages ("portals") that require a password.
242+
243+The normal
244+
245+# Disconnecting from external AP
246+
247+When the system is connected to an external AP, wifi-connect does nothing and leaves the connection alone.
248+
249+If the external AP connection disappears, wifi-connect takes control and puts up the local AP, which allows a user to join and use the web page to join a new external AP.
250+
251+There are two ways to disconnect from an external AP.
252+
253+## Operational portal
254+
255+The Opertaional portal is an optional web page wifi-connect can put up when the device is connected. This simple password
256+
257+
258diff --git a/docs/how_it_works.md b/docs/how_it_works.md
259new file mode 100644
260index 0000000..842a4c7
261--- /dev/null
262+++ b/docs/how_it_works.md
263@@ -0,0 +1,31 @@
264+---
265+title: "How it works"
266+table_of_contents: True
267+---
268+
269+# How it works
270+
271+## Connection to an external AP
272+
273+The wifi-connect daemon continuously checks Wi-Fi connected state.
274+
275+When there is no external WiFi connection, wifi-connect puts up its own Wi-Fi AP and web page. This is called "management" mode.
276+
277+You can join the device's AP and open a device web page that lists external APs.
278+
279+The web page URL is (by default) http://10.0.60.1:8080 (You can also access the page over Avahi as described elsewhere.)
280+
281+In ths management web page, you can select an AP and join it with a passphrase. The hosted AP is taken down. the wlan0 interface is put under control of Network Manager, and the device joins the speficied AP. If it cannot join, the daemon removes wlan0 from Network Manager's control and starts the device AP, at which point you can re-join, open the web page, and try again.
282+
283+![Overview](media/overview.png)
284+
285+## Disconnection from an external AP
286+
287+The wifi-connect daemon monitors whether there is any Wi-Fi connection. If it finds one, the daemon does nothing, and the system remains connected to the external AP. This is called "operational" mode.
288+
289+(If no external Wi-Fi connection is found, the daemon puts the system in Management mode, as described above.)
290+
291+You can disconnect the system from an external AP in various ways.
292+
293+* You can enable the Operational web page, displayed when you are connected to the external AP. This page has a Disconnect button. **Note**: the Operational portal is disabled by default. See [Configuration](configure.html).
294+* You can use Network Manager to disconnect (for example over DBus or using nmcli command). You can also use a wifi-connect command: this requires ssh to the system.
295diff --git a/docs/index.md b/docs/index.md
296index 679b180..c35cb83 100644
297--- a/docs/index.md
298+++ b/docs/index.md
299@@ -5,20 +5,27 @@ table_of_contents: True
300
301 # Overview
302
303-The wifi-connect snap allows you to connect your device to an external Wi-Fi access point. It does this by putting up its own Wi-Fi AP and web page. You join the AP and the web page lists external APs, which you can then select and join.
304+Wifi-connect is a solution for connecting an IoT device to an external Wi-Fi Access Point without any wired network connections.
305
306-Wifi-connect is appropriate for simple use cases where there is no other control of networking. Wifi-connect has a daemon that takes over networking and controls device state automatically:
307+It can be installed manually. It is also suitable for integration into Ubuntu Core images. Please contact Canonical for integration information.
308
309- * When there is no external AP connection, wifi-connect starts its own AP and the Management web page (which allows you to select and join external WiFI APs)
310- * When there is an external AP connection, wifi-connect ensures its own AP is down and puts up the Operational web page (which allows you to disconnect from the external AP)
311+## Use cases
312
313-Wifi-connect uses two other snaps:
314+Wifi-connect is a good match for many use cases typical of many IoT deployments.
315
316- * wifi-ap: provides the AP function
317- * network-manager: handles networking (as a part of installation, the device netplan is modified to make network-manager the renderer for all networking).
318+Wifi-connect takes control of some networking on the device, so you should verify expected functionality if other entities control networking to ensure they work well together.
319
320-Wifi-connect can be:
321+## Required snaps
322
323- * Installed at run time
324- * Integrated into an image, with options. See "Integrating into an Image" section
325+wifi-ap and network-manager snaps must be installed.
326+
327+Certain snapd interfaces must be connected, and other steps must be taken. See [Installation](installation.html).
328+
329+## Security
330+
331+To use the Management web page (described below), you have to join the AP first. The AP is passphase protected and the passphrase is not (by default) preset in the system (although you can preconfigre it at your descretion and risk).
332+
333+The Management web page itself is password protected, but the connection is currently http, thus the password is conveyed in clear text in the http header. You may consider this sufficient because the traffic is between you and the system over its own Wi-Fi network that requires a passphrase to join.
334+
335+The Operational web page is also password protected, and is disabled by default. If you enable it, ensure you understand that the password is sent to the device in clear text in the http header and through the external AP's Wi-Fi network.
336
337diff --git a/docs/installation.md b/docs/installation.md
338index deba1ec..f0693a9 100644
339--- a/docs/installation.md
340+++ b/docs/installation.md
341@@ -3,19 +3,22 @@ title: "Installation"
342 table_of_contents: True
343 ---
344
345-# Overview
346+# Options
347
348-The wifi-connect snap is currently publish in edge and beta channels.
349+You can install wifi-connect manually on a Core system over SSH.
350
351-## Install snaps
352+You can also integrate wifi-connect into an image. This typically requires connecting the specified snapd interfaces and preseeding the netplan file mentioned below. Please contact Canonical for additional information.
353+
354+# Install snaps
355
356 ```bash
357 snap install wifi-ap
358 snap install network-manager
359-snap install --edge|beta wifi-connect
360+snap install wifi-connect
361 ```
362+Note: If wifi-connect is not yet published in the stable channel, specify the channel at installation time.
363
364-## Connect interfaces
365+# Connect interfaces
366
367 ```bash
368 snap connect wifi-connect:control wifi-ap:control
369@@ -24,9 +27,7 @@ snap connect wifi-connect:network-bind core:network-bind
370 snap connect wifi-connect:network-manager network-manager:service
371 ```
372
373-## Set NetWorkManager to control all networking
374-
375-**Note**: This is a temporary manual step before network-manager snap provides a config option for this.
376+# Set NetWorkManager to control all networking
377
378 **Note**: Depending on your environment, after this you may need to use a new IP address to connect to the device.
379
380@@ -43,15 +44,16 @@ snap connect wifi-connect:network-manager network-manager:service
381 network:
382 renderer: NetworkManager
383
384-## Reboot
385+# Reboot
386
387-Rebooting addresses a potential content sharing interface issue.
388+Rebooting consolidates all networking into NetworkManager.
389
390-Rebooting also consolidates all networking into NetworkManager.
391+```bash
392+$sudo reboot
393+```
394
395-## Optionally configure wifi-ap SSID/passphrase
396+# Set the hosted AP's SSID and passphrase
397
398-If you skip these steps, the wifi-AP put up by the device has an SSID of "Ubuntu" and is unsecure (with no passphrase).
399
400 1. Set the wifi-ap AP SSID
401
402@@ -61,7 +63,7 @@ If you skip these steps, the wifi-AP put up by the device has an SSID of "Ubuntu
403
404 sudo wifi-connect passphrase MYPASSPHRASE
405
406-## Display the AP config
407+# Optionally display the AP config
408
409 ```bash
410 sudo wifi-connect show-ap
411@@ -72,7 +74,9 @@ sudo wifi-connect show-ap
412 dhcp.range-start: 10.0.60.2
413 dhcp.range-stop: 10.0.60.199
414
415-## Set the portal password
416+After connecting to the AP, you open its web page at the address just before the start of the dhcp-range, that is: 10.0.60.10 (on port 8080). So in your browser you enter 10.0.60.1:8080
417+
418+# Set the portal password
419
420 The portal password must be entered to access wifi-connect web pages.
421
422@@ -80,42 +84,3 @@ The portal password must be entered to access wifi-connect web pages.
423 sudo wifi-connect set-portal-password PASSWORD
424 ```
425
426-## Join the device AP
427-
428-When the device AP is up and available to you, join it.
429-
430-## Open the the Management portal web page
431-
432-This portal displays external wifi APs and let's you join them.
433-
434-After you connect to the device AP, you can open its http portal at the .1 IP address just before the start of the DHCP range (see previous steps) using port 8080:
435-
436- 10.0.60.1:8080
437-
438-You then need to enter the portal password to continue.
439-
440-### Avahi and hostname
441-
442-You can also connect to the device's web page using the device host name:
443-
444- http://HOSTNAME.local:8080
445-
446-Where HOSTNAME is the hostname of the device when it booted. (Changing hostname with the hostname command at run time is not sufficient.)
447-
448-**Note**: The system trying to open the web page must support Avahi. Android systems may not, for example.
449-
450-## Be patient, it takes minutes
451-
452-Wifi-connect pauses for about a minute at daemon start to allow any external AP connections to complete.
453-
454-## Disconnect from wifi
455-
456-When connected to an external AP, the Operational portal is available on the device IP address (assigned by the external AP). Open it using IP:8080, enter the portal password, and you may then disconnect with the "Disconnect from Wifi" button.
457-
458-You can also ssh to the device and:
459-
460- * Use `nmcli c` to display connections.
461- * Use `nmcli c delete CONNECTION_NAME` to disconnect and delete. This puts the device into management mode, bringing up the AP and portal.
462-
463-Disconnecting sets the device back in Management mode. Its AP is started and you can open the portal (as discussed above) to see external APs and connect to one.
464-
465diff --git a/docs/integrate.md b/docs/integrate.md
466deleted file mode 100644
467index b1cdd4f..0000000
468--- a/docs/integrate.md
469+++ /dev/null
470@@ -1,70 +0,0 @@
471----
472-title: "Integrating into an image""
473-table_of_contents: True
474----
475-
476-# Overview
477-
478-When you pre-install wifi-connect snap into an image, you can use the gadget snap's [gadget.yaml](https://forum.snapcraft.io/t/the-gadget-snap/696) file to pre-configure some options.
479-
480-Here we explain the snap key and value needed to preconfigure. Refer to the above like for details on how to set these in the gadget snap's gadget.yaml file.
481-
482-You may also set these at run time from terminal with:
483-
484-```bash
485-$ snap set wifi-connect KEY=VALUE
486-```
487-
488-To apply such run-time changes, see the Frequently asked questions page.
489-
490-**Warning**: These changes may create security risks. Only use take these steps if you are completely aware of take responsitbility for the potential risk.
491-
492-
493-**Note** When the deamon starts, it logs any preconfigurations found and applied, for example:
494-
495-```bash
496-Jun 20 22:07:16 thehost snap[18004]: == wifi-connect/SetDefaults portal password being set
497-Jun 20 22:07:16 thehost snap[18004]: == wifi-connect/SetDefaults: reset creds requirement is now disabled
498-```
499-
500-## AP passphrase
501-
502-Normally the wifi-conect AP's passphrase is randomly created by the wifi-ap snap. A normal part of the installation process is resetting this from the terminal. However, some integrators may want to preset the passphrase.
503-
504-Preset the passphrase with the following:
505-
506- * snapd key: wifi.security-passphrase
507- * value: the passhrase (8-13 characters, must start with a letter)
508-
509-## Portal password
510-
511-To access any wifi-connect web page you need to enter the portal password. A normal part of the installation process is setting this from the terminal. However, some integrators may want to preset the portal password.
512-
513-Preset the portal password with the following:
514-
515- * snapd key: portal.password
516- * value: the password (8-13 characters, must start with a letter)
517-
518-## Disable credential resetting
519-
520-Normally, the first user to access the Management portal is required to reset the wifi-connect AP passphrase and the portal password (used to access wifi-connect web pages). This is an important security feature, especially for integrators that preset these in their image because every image has the same passphrase and password.
521-
522-However, some integrators may want to disable this requirement.
523-
524-Disable the requirement to reset the AP passphrase and portal password on first use of the Management portal as follows:
525-
526- * snapd key: portal.no-reset-creds
527- * value: true
528-
529-## Disable display of the Operational Portal
530-
531-The Operational portal is available when the device is connected to an external AP. It provides a button the user can click to disconnect. Display of this page can be disabled. This is a normal part of wifi-connect. When the page is disabled one must use the terminal (or some other means) to direct the device to disconnect form the external AP.
532-
533-Disable the Operational portal as follows:
534-
535- * snapd key: portal.no-opertaional
536- * value: true
537-
538-
539-
540-
541diff --git a/docs/media/config.png b/docs/media/config.png
542new file mode 100644
543index 0000000..b8ddd8e
544Binary files /dev/null and b/docs/media/config.png differ
545diff --git a/docs/media/connect.png b/docs/media/connect.png
546new file mode 100644
547index 0000000..bf9134b
548Binary files /dev/null and b/docs/media/connect.png differ
549diff --git a/docs/media/disconnect.png b/docs/media/disconnect.png
550new file mode 100644
551index 0000000..6093a08
552Binary files /dev/null and b/docs/media/disconnect.png differ
553diff --git a/docs/media/mgmt.png b/docs/media/mgmt.png
554new file mode 100644
555index 0000000..f6146b6
556Binary files /dev/null and b/docs/media/mgmt.png differ
557diff --git a/docs/media/overview.png b/docs/media/overview.png
558new file mode 100644
559index 0000000..075dc7d
560Binary files /dev/null and b/docs/media/overview.png differ
561diff --git a/docs/media/portal_password.png b/docs/media/portal_password.png
562new file mode 100644
563index 0000000..ddb18dc
564Binary files /dev/null and b/docs/media/portal_password.png differ
565diff --git a/docs/metadata.yaml b/docs/metadata.yaml
566index 2fb6ea0..081b31f 100644
567--- a/docs/metadata.yaml
568+++ b/docs/metadata.yaml
569@@ -4,9 +4,15 @@ navigation:
570 - title: Introduction
571 location: index.md
572 children:
573+ - title: How it works
574+ location: how_it_works.md
575 - title: Installation
576 location: installation.md
577- - title: Integrating into an image
578- location: integrate.md
579- - title: Frequently asked questions
580+ - title: Configuration
581+ location: configure.md
582+ - title: Usage
583+ location: normal_use.md
584+ - title: FAQ
585 location: faq.md
586+ - title: About
587+ location: revisions.md
588diff --git a/docs/normal_use.md b/docs/normal_use.md
589new file mode 100644
590index 0000000..2e67d68
591--- /dev/null
592+++ b/docs/normal_use.md
593@@ -0,0 +1,91 @@
594+---
595+title: "Usage"
596+table_of_contents: True
597+---
598+
599+# Usage
600+
601+This section covers normal usage, including:
602+
603+* Joining the device AP
604+* Selecting and joining an external AP
605+* Disconnecting from the external AP
606+
607+# Join the device AP
608+
609+When the device AP is up and available to you, join it from your laptop, smartphone or similar.
610+
611+Use the SSID set previously (or the default of "Ubuntu"), and use the passphrase set previously (a prerequisite).
612+
613+# Open the the wifi-connect web page
614+
615+This page displays external Wi-Fi APs and let's you select and join one.
616+
617+After you connect to the device's AP, you can open its web page at the .1 IP address just before the start of the DHCP range (see previous steps) using port 8080:
618+
619+ 10.0.60.1:8080
620+
621+**Note**: The screenshots that follow use an Avahi address instead of the IP address, as explained next.
622+
623+Enter the portal password previously configured to continue.
624+
625+![portal password](media/portal_password.png)
626+
627+
628+## Connecting through Avahi and hostname
629+
630+You can also connect to the device's web page using the device host name when you are on the same IP subnet as the device:
631+
632+ http://HOSTNAME.local:8080
633+
634+Where HOSTNAME is the hostname of the device when it booted. (Changing hostname with the hostname command at run time is not sufficient.)
635+
636+**Note**: The system trying to open the web page must support Avahi. Android systems may not, for example.
637+
638+## Be patient, it takes minutes
639+
640+Wifi-connect pauses for about a minute at daemon start to allow any external AP connections to complete.
641+
642+# First run configuration
643+
644+On first use, the web page displays a configuration form that may require some input.
645+
646+**Note**: An automatic reboot may be required.
647+
648+![configuration page](media/config.png)
649+
650+# Select an AP to join
651+
652+The landing page displays external APs. Select one.
653+
654+![landing page](media/mgmt.png)
655+
656+# Enter Passphrase and join
657+
658+Enter the passphrase, and confirm to join it:
659+
660+![landing page](media/mgmt.png)
661+
662+
663+# Disconnect from Wi-Fi
664+
665+## Operational portal is off
666+
667+As noted elsewhere, any method can be be used do disconnect the Wi-Fi connection and wifi-connect recovers, returning to Management mode.
668+
669+For example: You can also ssh to the device and:
670+
671+ * Use `nmcli c` to display connections.
672+ * Use `nmcli c delete CONNECTION_NAME` to disconnect and delete. This puts the device into management mode, bringing up the AP and portal.
673+
674+You can also implement code that makes a DBus call to Network Manager to disconnect.
675+
676+## Operational portal is on
677+
678+When connected to an external AP, the Operational portal, if enabled, is available on the device IP address (assigned by the external AP), (or through Avahi when on the same IP subnet, as mentioned above).
679+
680+Open it using IP:8080, enter the portal password, and you may then disconnect with the **Disconnect from Wifi** button.
681+
682+Disconnecting sets the device backto starting mode. Its AP is started and you can join and open the web page (as discussed above) to see external APs and connect to one.
683+
684+![disconnect page](media/disconnect.png)
685diff --git a/docs/revisions.md b/docs/revisions.md
686new file mode 100644
687index 0000000..2d29b49
688--- /dev/null
689+++ b/docs/revisions.md
690@@ -0,0 +1,6 @@
691+---
692+title: "About"
693+table_of_contents: true
694+---
695+
696+This document is written for wifi-connect version 0.11
697diff --git a/hooks/configure.go b/hooks/configure.go
698index e34cd45..80cfe91 100644
699--- a/hooks/configure.go
700+++ b/hooks/configure.go
701@@ -117,12 +117,12 @@ func main() {
702
703 b, err := json.Marshal(preConfig)
704 if err != nil {
705- log(" Marshall error:" + err.Error())
706+ log("Marshall error: " + err.Error())
707 return
708 }
709
710 err = ioutil.WriteFile(daemon.PreConfigFile, b, 0644)
711 if err != nil {
712- log("configure error: " + err.Error())
713+ log("configure hook: " + err.Error())
714 }
715 }

Subscribers

People subscribed via source and target branches