{"action":"created","issue":{"url":"https://api.github.com/repos/resin-io/resin-wifi-connect/issues/212","repository_url":"https://api.github.com/repos/resin-io/resin-wifi-connect","labels_url":"https://api.github.com/repos/resin-io/resin-wifi-connect/issues/212/labels{/name}","comments_url":"https://api.github.com/repos/resin-io/resin-wifi-connect/issues/212/comments","events_url":"https://api.github.com/repos/resin-io/resin-wifi-connect/issues/212/events","html_url":"https://github.com/resin-io/resin-wifi-connect/issues/212","id":319656215,"number":212,"title":"Multiple (4) IP's after installing wifi-connect","user":{"login":"jgentes","id":1149470,"avatar_url":"https://avatars1.githubusercontent.com/u/1149470?v=4","gravatar_id":"","url":"https://api.github.com/users/jgentes","html_url":"https://github.com/jgentes","followers_url":"https://api.github.com/users/jgentes/followers","following_url":"https://api.github.com/users/jgentes/following{/other_user}","gists_url":"https://api.github.com/users/jgentes/gists{/gist_id}","starred_url":"https://api.github.com/users/jgentes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgentes/subscriptions","organizations_url":"https://api.github.com/users/jgentes/orgs","repos_url":"https://api.github.com/users/jgentes/repos","events_url":"https://api.github.com/users/jgentes/events{/privacy}","received_events_url":"https://api.github.com/users/jgentes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-05-02T18:07:24Z","updated_at":"2018-05-03T04:05:13Z","closed_at":null,"author_association":"NONE","body":"We've added the resin-wifi-connect container to our device (alongside our node app in another container) and we now see multiple IP's being reserved by the device, even when it's not broadcasting a wifi network:\r\n\r\n![image](https://user-images.githubusercontent.com/1149470/39540712-560ee31e-4df8-11e8-803d-c7b905987571.png)\r\n\r\nHere's the output of `ifconfig` on the Host OS.. it's odd that I don't see 3 of the 4 IP's listed here, and they aren't in the other containers either:\r\n```\r\nbalena0   Link encap:Ethernet  HWaddr 02:42:20:F0:2E:99\r\n          inet addr:10.114.101.1  Bcast:0.0.0.0  Mask:255.255.255.0\r\n          UP BROADCAST MULTICAST  MTU:1500  Metric:1\r\n          RX packets:0 errors:0 dropped:0 overruns:0 frame:0\r\n          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0\r\n          collisions:0 txqueuelen:0\r\n          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)\r\n\r\nbr-a1a6432c9c16 Link encap:Ethernet  HWaddr 02:42:3D:E4:0A:8B\r\n          inet addr:172.19.0.1  Bcast:0.0.0.0  Mask:255.255.0.0\r\n          inet6 addr: fe80::42:3dff:fee4:a8b%resin-vpn/64 Scope:Link\r\n          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1\r\n          RX packets:8224 errors:0 dropped:0 overruns:0 frame:0\r\n          TX packets:9715 errors:0 dropped:0 overruns:0 carrier:0\r\n          collisions:0 txqueuelen:0\r\n          RX bytes:2470830 (2.3 MiB)  TX bytes:844074 (824.2 KiB)\r\n\r\neth0      Link encap:Ethernet  HWaddr B8:27:EB:43:64:C4\r\n          inet addr:192.168.1.93  Bcast:192.168.1.255  Mask:255.255.255.0\r\n          inet6 addr: fe80::c18f:6f83:f9c9:61e%resin-vpn/64 Scope:Link\r\n          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1\r\n          RX packets:237555 errors:0 dropped:121 overruns:0 frame:0\r\n          TX packets:132053 errors:0 dropped:0 overruns:0 carrier:0\r\n          collisions:0 txqueuelen:1000\r\n          RX bytes:47422517 (45.2 MiB)  TX bytes:54382182 (51.8 MiB)\r\n\r\nlo        Link encap:Local Loopback\r\n          inet addr:127.0.0.1  Mask:255.0.0.0\r\n          inet6 addr: ::1%15/128 Scope:Host\r\n          UP LOOPBACK RUNNING  MTU:65536  Metric:1\r\n          RX packets:8105 errors:0 dropped:0 overruns:0 frame:0\r\n          TX packets:8105 errors:0 dropped:0 overruns:0 carrier:0\r\n          collisions:0 txqueuelen:1\r\n          RX bytes:994935 (971.6 KiB)  TX bytes:994935 (971.6 KiB)\r\n\r\nresin-dns Link encap:Ethernet  HWaddr FA:12:AC:4B:CF:7B\r\n          inet addr:10.114.102.1  Bcast:0.0.0.0  Mask:255.255.255.0\r\n          inet6 addr: fe80::f812:acff:fe4b:cf7b%resin-vpn/64 Scope:Link\r\n          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1\r\n          RX packets:0 errors:0 dropped:0 overruns:0 frame:0\r\n          TX packets:54 errors:0 dropped:0 overruns:0 carrier:0\r\n          collisions:0 txqueuelen:1000\r\n          RX bytes:0 (0.0 B)  TX bytes:6436 (6.2 KiB)\r\n\r\nresin-vpn Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00\r\n          inet addr:10.240.51.60  P-t-P:52.4.252.97  Mask:255.255.255.255\r\n          inet6 addr: fe80::5507:5ffa:52fe:edad%resin-vpn/64 Scope:Link\r\n          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1\r\n          RX packets:608 errors:0 dropped:0 overruns:0 frame:0\r\n          TX packets:643 errors:0 dropped:0 overruns:0 carrier:0\r\n          collisions:0 txqueuelen:100\r\n          RX bytes:66982 (65.4 KiB)  TX bytes:69850 (68.2 KiB)\r\n\r\nsupervisor0 Link encap:Ethernet  HWaddr 02:42:8A:97:A2:02\r\n          inet addr:172.17.0.1  Bcast:0.0.0.0  Mask:255.255.0.0\r\n          inet6 addr: fe80::42:8aff:fe97:a202%resin-vpn/64 Scope:Link\r\n          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1\r\n          RX packets:15 errors:0 dropped:0 overruns:0 frame:0\r\n          TX packets:69 errors:0 dropped:0 overruns:0 carrier:0\r\n          collisions:0 txqueuelen:0\r\n          RX bytes:1052 (1.0 KiB)  TX bytes:8196 (8.0 KiB)\r\n\r\nveth768a3f4 Link encap:Ethernet  HWaddr 66:56:E1:FF:1D:AF\r\n          inet6 addr: fe80::6456:e1ff:feff:1daf%resin-vpn/64 Scope:Link\r\n          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1\r\n          RX packets:3 errors:0 dropped:0 overruns:0 frame:0\r\n          TX packets:55 errors:0 dropped:0 overruns:0 carrier:0\r\n          collisions:0 txqueuelen:0\r\n          RX bytes:158 (158.0 B)  TX bytes:5554 (5.4 KiB)\r\n\r\nveth9ec9144 Link encap:Ethernet  HWaddr CE:1F:A8:94:92:3B\r\n          inet6 addr: fe80::cc1f:a8ff:fe94:923b%resin-vpn/64 Scope:Link\r\n          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1\r\n          RX packets:38 errors:0 dropped:0 overruns:0 frame:0\r\n          TX packets:82 errors:0 dropped:0 overruns:0 carrier:0\r\n          collisions:0 txqueuelen:0\r\n          RX bytes:3780 (3.6 KiB)  TX bytes:13811 (13.4 KiB)\r\n\r\nvethab60bef Link encap:Ethernet  HWaddr C2:96:6D:98:63:8B\r\n          inet6 addr: fe80::c096:6dff:fe98:638b%resin-vpn/64 Scope:Link\r\n          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1\r\n          RX packets:0 errors:0 dropped:0 overruns:0 frame:0\r\n          TX packets:51 errors:0 dropped:0 overruns:0 carrier:0\r\n          collisions:0 txqueuelen:0\r\n          RX bytes:0 (0.0 B)  TX bytes:5238 (5.1 KiB)\r\n\r\nwlan0     Link encap:Ethernet  HWaddr A6:09:AC:2C:DD:6D\r\n          UP BROADCAST MULTICAST  MTU:1500  Metric:1\r\n          RX packets:392 errors:0 dropped:10 overruns:0 frame:0\r\n          TX packets:481 errors:0 dropped:0 overruns:0 carrier:0\r\n          collisions:0 txqueuelen:1000\r\n          RX bytes:55101 (53.8 KiB)  TX bytes:363650 (355.1 KiB)\r\n```\r\n\r\nIt's worth noting that I installed `network-manager` as part of the Dockerfile.template in order to allow `nmcli g` to work in the start script. `nmcli` is not installed otherwise. Here's the dockerfile:\r\n\r\n```\r\nFROM resin/%%RESIN_MACHINE_NAME%%-debian\r\n\r\nENV INITSYSTEM on\r\n\r\nRUN apt-get update \\\r\n    && apt-get install -y dnsmasq wireless-tools network-manager \\\r\n    && apt-get clean \\\r\n    && rm -rf /var/lib/apt/lists/*\r\n\r\nWORKDIR /usr/src/app\r\n\r\nRUN curl https://api.github.com/repos/resin-io/resin-wifi-connect/releases/latest -s \\\r\n    | grep -hoP 'browser_download_url\": \"\\K.*%%RESIN_ARCH%%\\.tar\\.gz' \\\r\n    | xargs -n1 curl -Ls \\\r\n    | tar -xvz -C /usr/src/app/\r\n\r\nCOPY start.sh .\r\nCOPY ui ui\r\n\r\nCMD [\"bash\", \"start.sh\"]\r\n```\r\n\r\nAnd here's the start script:\r\n\r\n```\r\n#!/usr/bin/env bash\r\n\r\nexport DBUS_SYSTEM_BUS_ADDRESS=unix:path=/host/run/dbus/system_bus_socket\r\n\r\n# Choose a condition for running WiFi Connect according to your use case:\r\n\r\n# 1. Is there a default gateway?\r\n# ip route | grep default\r\n\r\n# 2. Is there Internet connectivity?\r\nnmcli -nocheck g | grep full\r\n\r\n# 3. Is there Internet connectivity via a google ping?\r\n# wget --spider http://google.com 2>&1\r\n\r\nif [ $? -eq 0 ]; then\r\n    printf 'Internet detected, skipping WiFi Connect\\n'\r\nelse\r\n    printf 'No internet detected, checking wifi..\\n'\r\n    # 4. Is there an active WiFi connection?\r\n    iwgetid -r\r\n    \r\n    if [ $? -eq 0 ]; then\r\n        printf 'Wifi connection already live, skipping WiFi Connect\\n'\r\n    else\r\n        printf 'Starting WiFi Connect\\n'\r\n        ./wifi-connect --portal-ssid \"Tend Cellmate\"\r\n    fi\r\nfi\r\n```\r\n\r\nAny ideas?"},"comment":{"url":"https://api.github.com/repos/resin-io/resin-wifi-connect/issues/comments/386186408","html_url":"https://github.com/resin-io/resin-wifi-connect/issues/212#issuecomment-386186408","issue_url":"https://api.github.com/repos/resin-io/resin-wifi-connect/issues/212","id":386186408,"user":{"login":"majorz","id":188837,"avatar_url":"https://avatars1.githubusercontent.com/u/188837?v=4","gravatar_id":"","url":"https://api.github.com/users/majorz","html_url":"https://github.com/majorz","followers_url":"https://api.github.com/users/majorz/followers","following_url":"https://api.github.com/users/majorz/following{/other_user}","gists_url":"https://api.github.com/users/majorz/gists{/gist_id}","starred_url":"https://api.github.com/users/majorz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/majorz/subscriptions","organizations_url":"https://api.github.com/users/majorz/orgs","repos_url":"https://api.github.com/users/majorz/repos","events_url":"https://api.github.com/users/majorz/events{/privacy}","received_events_url":"https://api.github.com/users/majorz/received_events","type":"User","site_admin":false},"created_at":"2018-05-03T04:05:13Z","updated_at":"2018-05-03T04:05:13Z","author_association":"COLLABORATOR","body":"Yes, this is correct. Also you won't need `wireless-tools` if you don't use `iwgetid`.\r\n\r\nHere is a sample `docker-compose.yml` file with WiFi Connect: https://github.com/resin-io-projects/resin-wifi-connect-api/blob/master/docker-compose.yml "}}
{"actor":{"display_login":"majorz"}}