Spondoolies-Tech / minepeon

Miner UI
GNU General Public License v2.0
0 stars 3 forks source link

WiFi API #41

Open SyRenity opened 10 years ago

SyRenity commented 10 years ago

As per our talk on Thursday, I need an "API", allowing to do the following:

SyRenity commented 10 years ago

@goytin Latest image doesn't find the plugged in dongle (that you left me).

For example: 1) Plugin in the dongle generates the following:

<7>[ 158.517636] usb usb1: usb wakeup-resume <7>[ 158.517719] usb usb1: usb auto-resume <7>[ 158.517740] hub 1-0:1.0: hub_resume <7>[ 158.517775] hub 1-0:1.0: port 1: status 0101 change 0001 <7>[ 158.619834] hub 1-0:1.0: state 7 ports 1 chg 0002 evt 0000 <7>[ 158.619877] hub 1-0:1.0: port 1, status 0101, change 0000, 12 Mb/s <6>[ 158.725286] usb 1-1: new high-speed USB device number 3 using musb-hdrc <7>[ 158.867230] usb 1-1: default language 0x0409 <7>[ 158.872513] usb 1-1: udev 3, busnum 1, minor = 2 <6>[ 158.872535] usb 1-1: New USB device found, idVendor=7392, idProduct=7718 <6>[ 158.879741] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0 <6>[ 158.888573] usb 1-1: Product: 802.11 n WLAN <6>[ 158.894342] usb 1-1: Manufacturer: Ralink <7>[ 158.914833] usb 1-1: usb_probe_device <7>[ 158.914860] usb 1-1: configuration #1 chosen from 1 choice <7>[ 158.914972] usb 1-1: adding 1-1:1.0 (config #1, interface 0) <7>[ 158.921832] hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0002 <7>[ 158.921875] hub 1-0:1.0: port 1 enable change, status 00000503 2) ifconfig eth0 Link encap:Ethernet HWaddr 88:33:14:FA:7F:C4 inet addr:10.0.0.19 Bcast:10.0.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:977 errors:0 dropped:36 overruns:0 frame:0 TX packets:1121 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:155127 (151.4 KiB) TX bytes:422508 (412.6 KiB) Interrupt:56 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:65536 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) 3) iwlist wlan0 scan wlan0 Interface doesn't support scanning. ideas?
SyRenity commented 10 years ago

wifi-conf-create.sh does not work:

These combinations:

Always return: Create wpa_supplicant configuration file. Usage: ESSID="" KEY_MGMT= PROTO=\ PAIRWISE_CIPHERS="" GROUP_CIPHERS="" /usr/local/bin/wifi-conf-create.sh

ghost commented 10 years ago

Use wifi-conf-create.sh as follows:

ESSID="spontech" KEY_MGMT="WPA-PSK" PROTO="WPA2" PAIRWISE_CIPHERS="CCMP" GROUP_CIPHERS="CCMP" /usr/local/bin/wifi-conf-create.sh

Note, that the 1st parameter is called "ESSID", not "SSID". wifi-conf-create.sh then waits on the standard input for password.

ghost commented 10 years ago

In order to get wireless network to which our system is connected please use command:

    iwgetid wlan0 --raw

This returns something like

    spontech
ghost commented 10 years ago

In order to see wireless LAN interface please use command

    ifconfig -a

This command shows all interfaces: both active and inactive. Command "ifconfig" without parameters shows only active interfaces.

SyRenity commented 10 years ago

@goytin What happens if we have 2 or more WiFi networks with same name, and connected to one of them?

ghost commented 10 years ago

In order to receive BSSID of the connected network use command:

    iwgetid wlan0 --raw --ap

The sample output:

    CC:B2:55:E7:7E:8D
SyRenity commented 10 years ago

@goytin In case of non-secured network, the wifi-conf-create command does not work: ESSID="TELGUEST" KEY_MGMT="" PROTO="" PAIRWISE_CIPHERS="" GROUP_CIPHERS="" /usr/local/bin/wifi-conf-create.sh

ghost commented 10 years ago

Fixed in commit 9f5b7a0. In order to create a configuration file for a non-secured network call wifi-conf-create.sh with only 2 parameters: ESSID and KEY_MGMT:

    ESSID="TELGUEST" KEY_MGMT="NONE" /usr/local/bin/wifi-conf-create.sh

Note, in case of non-secured network no password should be provided.

SyRenity commented 10 years ago

Connection to non-secured network works fine with the syntax above.

SyRenity commented 10 years ago

As we talked, remaining is only route commands to temporary switch to WLAN connection and test it before a confirmation

SyRenity commented 10 years ago

@goytin Following use cases testing, I found out the following critical issue - in case the dongle is plugged out, after reboot the unit will not be available anymore via network, and following message will repeatedly appear:

May 13 01:48:54 miner user.debug kernel: [ 91.003205] usb 1-1: kworker/u:0 timed out on ep0in len=0/4

Also when this message appears, the standard console commands (reboot, ifconfig) do not have any effect, and the only way to reboot the unit is to power-cycle it.

Last but not least, after the dongle is pulled (but before the 1st reboot rendering the unit inaccessible via network), the unit is still accessible via WiFi address, which should not happen. It's like the IP floats to Eth connection.

In nutshell, it means that any user loosing his dongle will loose the unit as well, and this issue is a major blocker of the functionality.

I've set unit .20 with this issue, please check it once you here next.

ghost commented 10 years ago

@SyRenity: please describe in details the setup you used to see the problem and the exact order of actions. Currently on my setup - Mgmt board only, Ethernet connection, WiFi dongle, boot from eMMC - I do not see the problem. After I pull out WiFi dongle and reboot the system Ethernet works as expected. Also please make sure you use the latest software.