Title: [HowTo] Coindesk - Setup for encrypted wireless network Post by: Mork on May 01, 2014, 02:59:06 PM The coindesk seems to be prepared for open wireless networks out of the box, but my network is encrypted with WPA2-Personal/AES.
This does not work out of the box (or I'm really really stupid :) ), as it requires the wpa_supplicant binary which is not included. I found no package manager installed to install the binary and I also have not found a binary on the web, so I needed to cross compile it. To save anyone the hassle to do the same, I provide you with my compiled binary. I also cross-compiled the wlan-tools, which are helpful in checking if your wlan adapter works and to scan networks + get details about their settings. This is a condensed how-to, you might run into trouble somewhere and if you do, you need to know or find out how to solve it. I cannot give support for this, there are just too many things that can go wrong (in terms of: wlan not working). :) Note: As I have compiled the provided binaries from source, in theory I could have manipulated the source to do evil things with your miner. I guarantee that I did not, but I think that you should be aware of that such things are possible. :) Note2: I cannot be held responsible for any damage caused by my instructions or the files provided. It is extremely unlikely that any damage gets caused and nothing should void your warranty as this is nothing but moving a couple of binaries on the miner and reconfiguring the network, but be careful nonetheless. If at any time you happen to f**k the OS of the miner up to no rescue, which again is unlikely if you follow my steps, you can get a new sd-card flash file at bitmines website, so you should be somewhat safe. :) Prerequisites a) Mandatory
b) Optional
c) Known issues
Cross compiled binaries coindesk-wlan-package-1.0.tar.gz at (1,5 MB, @mega) (https://mega.co.nz/#!zgZQBYjK!mWqrQsK97CkNZgk9mM8qqP85jXxIr6SoUGYJUiYSEJw) Includes:
Binaries compiled using:
See at the bottom: "Helpful ressources - 4. Setup cross compiler for raspberry on linux" to get a starting point to compile everything on your own. Good luck. :) Optional step - wlan-tools: 1. Unzip package: root@raspberrypi:~# tar xvzf coindesk-wlan-package-1.0.tar.gz 2. Change to new dir root@raspberrypi:~# cd package 3. copy library to /usr/lib root@raspberrypi:~# cp libiw.so.29 /usr/lib 4. copy binaries to /usr/bin root@raspberrypi:~# cp iw* /usr/bin See "1. Quick overview on wifi-tools:" at the bottom for some basic info about the binaries. The most interesting would probably be: root@raspberrypi:~# iwlist scan root@raspberrypi:~# iwconfig Steps - connecting with WPA2 auth: 1. Unzip package: root@raspberrypi:~# tar xvzf coindesk-wlan-package-1.0.tar.gz 2. Change to new dir root@raspberrypi:~# cd package 3. Copy wpa_supplicant to /usr/bin root@raspberrypi:~# cp wpa_supplicant /usr/bin 4. Make sure it's executeable: root@raspberrypi:~# chmod +x /usr/bin/wpa_supplicant 5. Configure /etc/network/interfaces root@raspberrypi:~# vi /etc/network/interfaces (press insert to toggle between read, insert, replace mode. mode is displayed in bottom left (none, "I", "R") (when in read mode, write :q to exit, :wq to write and exit, :q! to exit without saving changes) There should be a wlan section at the top already. Change it to this: Code: # Wireless interfaces Replace YOUR_NETWORK_SSID with the SSID of your wireless network. Save changes and close editor. 6. Create your PSK key Get to a linux box with installed wpa_supplicant and run: user@boxwithwpa:~# wpa_passphrase YOUR_NETWORK_SSID YOUR_NETWORK_PASSWORD It should output something like this: Code: network={ 7. Create /etc/wpa_supplicant.conf root@raspberrypi:~# vi /etc/wpa_supplicant.conf Insert this: Code: network={ Replace the stuff in UPPERCASE. This is for WPA2/Personal with AES. If you have a different setting (check with wlan-tools: iwlist scan), you need to modify this. Check at the bottom "Helpful ressources - 2. Different configuration settings for different encryptions" to get an idea about the different settings. At this point you should be able to log in to your network and receive an IP with these steps: 1. shut down wlan0: root@raspberrypi:~# ifconfig wlan0 down 2. start wpa_supplicant: root@raspberrypi:~# wpa_supplicant -B -i wlan0 -D wext -c /etc/wpa_supplicant.conf (It will throw an warning/error about ioctl, don't care...) 3. start up wlan0: root@raspberrypi:~# ifup wlan0 udhcpc should start discovering your network, it then should receive an IP and you're in. Verify with: root@raspberrypi:~# ifconfig There should be a wlan0 interface that has an IP. For me this was not enought to make it start up on boot, I needed to add a if-pre-up script to make sure wpa_supplicant is up and running before udhcpc starts to fetch an IP. Copy the script provided in the package to /etc/network/if-pre-up.d/: root@raspberrypi:~# cp init-wlan /etc/network/if-pre-up.d/ Make sure it's executable: root@raspberrypi:~# chmod +x /etc/network/if-pre-up.d/init-wlan Leave the cable in, do a reboot and check with ifconfig if the wlan0 interface has started up and if it has an IP. If it does, write down the wlan0 IP, remove the cable, reboot and you're clear to go. Helpful ressources: 1. Quick overview on wifi-tools: https://rasspberrypi.wordpress.com/2012/09/09/wifi-tools-for-raspberry-pi/ (https://rasspberrypi.wordpress.com/2012/09/09/wifi-tools-for-raspberry-pi/) 2. Different configuration settings for different encryptions: http://ubuntuforums.org/showthread.php?t=318539 (http://ubuntuforums.org/showthread.php?t=318539) Note: Scroll down, there are multiple sections for various encryption types. Of interest are these lines: Quote wpa-proto XYZ To use the settings, remove the "wpa-" part and copy it to/replace it in your /etc/wpa_supplicant.conf.wpa-pairwise XYZ wpa-group XYZ wpa-key-mgmt XYZ 3. Explanation of wpa_supplicant (German) http://wiki.ubuntuusers.de/WLAN/wpa_supplicant (http://wiki.ubuntuusers.de/WLAN/wpa_supplicant) 4. Setup cross compiler for raspberry on linux http://stackoverflow.com/questions/19162072/installing-raspberry-pi-cross-compiler/19269715#19269715 (http://stackoverflow.com/questions/19162072/installing-raspberry-pi-cross-compiler/19269715#19269715) Updates Fix display of IP Backup minerosd.py, just in case. root@raspberrypi:~# cp /mineros/minerosd.py /mineros/minerosd.py.bck Edit minerosd.py: root@raspberrypi:~# vi /mineros/minerosd.py Change this: Code: def GetIP(): to this: Code: def GetIP(): If you're feeling fancy and know python, you could modify this part to first check for ethernet and then fall back to wireless. Don't touch the rest. Save, exit, reboot. Please let me know if this was helpful for you. And just in case that you're feeling generous: 1KZa4QediT8TUx5vF4UXzuJhqWPYAhd3P9 Good luck! :) Title: Re: [HowTo] Coindesk - Setup for encrypted wireless network Post by: gagalady on May 01, 2014, 03:24:09 PM Thanks for your guide, It took some time to get It clear for me but I finally did. Good guide.
|