Difference between revisions of "WiFi"
Line 4: | Line 4: | ||
Please note this is an '''advanced''' and '''experimental''' feature, currently requiring knowledge of command-line. | Please note this is an '''advanced''' and '''experimental''' feature, currently requiring knowledge of command-line. | ||
− | === | + | === Steps === |
− | + | # Power on the unit | |
+ | # Connect it to a PC via USB cable | ||
+ | # Plug the WiFi USB adapter/stick on the back of the unit | ||
+ | # SSH into the device | ||
+ | # Create and edit the file '''/data/wpa_supplicant.conf''' (this can be done with '''nano /data/wpa_supplicant.conf''' or vi '''/data/wpa_supplicant.conf''' as you prefer), | ||
+ | Inside this file, write the following contents: | ||
− | === | + | <source> |
+ | ctrl_interface=/run/wpa_supplicant | ||
+ | update_config=1network={ | ||
+ | ssid="MyWiFiSSID" | ||
+ | psk="password-goes-here" | ||
+ | } | ||
+ | </source> | ||
− | + | # Modify "MyWiFiSSID" and "password" as needed for your network (NOTE: the quotes are necessary) | |
− | ( | + | # Run '''systemctl restart wpa-supplicant-wlan0 dhcpcd-wlan0''' to activate WiFi services (not needed on subsequent boots) |
+ | # Run '''systemctl status wpa-supplicant-wlan0''' to verify that service is running correctly. if you see "Active: active (running)" then all is fine, WiFi is working; otherwise continue to the firmware deploy steps. (edited) | ||
− | + | === Custom firmware deploy === | |
− | + | In case it might be needed custom firmware (which MOD Devices does not ship), we need to find out which firmware to install. | |
− | + | Here are the steps: | |
− | <source | + | # Run '''dmesg | tail''' and look for an error message like this; |
− | + | ||
− | + | <source> | |
+ | [ 293.903337] ieee80211 phy0: rt2x00lib_request_firmware: Error - Failed to request Firmware | ||
+ | [ 293.909338] ieee80211 phy0: rt2x00lib_request_firmware: Info - Loading firmware file 'rt2870.bin' | ||
</source> | </source> | ||
− | + | 2. note what is the firmware you need, in this example case it is 'rt2870.bin' | |
+ | 3. download the firmware (for example, from the linux-firmware project using https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/snapshot/linux-firmware-20200918.tar.gz or similar) | ||
+ | 4. create the firmware folder inside the SSH session, by running mkdir /data/firmware | ||
+ | 5. copy the firmware over SSH to this new folder, using something like scp /path/to/firmware.bin root@192.168.51.1:/data/firmware/ | ||
+ | 6. unplug and replug the WiFi usb stick | ||
+ | |||
+ | === Finalizing === | ||
+ | |||
+ | We can verify that everything is working by running '''dmesg''' inside the SSH session and checking the latest messages. | ||
+ | If all is ok, you should see something like this: | ||
− | === | + | <source> |
+ | [ 1321.759528] wlan0: authenticate with 00:06:91:64:12:a0 | ||
+ | [ 1321.801547] wlan0: send auth to 00:06:91:64:12:a0 (try 1/3) | ||
+ | [ 1321.804295] wlan0: authenticated | ||
+ | [ 1321.805147] wlan0: associate with 00:06:91:64:12:a0 (try 1/3) | ||
+ | [ 1321.808800] wlan0: RX AssocResp from 00:06:91:64:12:a0 (capab=0x1411 status=0 aid=4) | ||
+ | [ 1321.815169] wlan0: associated | ||
+ | </source> | ||
− | + | ==== Finding IP address ==== | |
− | + | After the unit connects to the WiFi, you can know the IP address by running ifconfig | |
− | + | On the "wlan0" section you see the IP, like this: | |
− | |||
− | + | <source> | |
− | + | wlan0 Link encap:Ethernet HWaddr B8:A3:86:02:18:62 | |
− | + | inet addr:192.168.1.126 Bcast:192.168.1.255 Mask:255.255.255.0 | |
− | |||
</source> | </source> | ||
− | Useful resources | + | Bonus: if your OS and WiFi network supports zeroconf/mDNS, you can now at this point remove the USB cable and connect to the unit via http://modduo.local/ or http://modduox.local/. |
+ | This allows to keep using the plugin store and software updates. (which is blocked when using the WiFi IP directly) | ||
+ | |||
+ | ==== Useful resources ==== | ||
+ | |||
# https://wiki.archlinux.org/index.php/Wpa_supplicant | # https://wiki.archlinux.org/index.php/Wpa_supplicant | ||
# https://wiki.archlinux.org/index.php/Network_configuration/Wireless#iw | # https://wiki.archlinux.org/index.php/Network_configuration/Wireless#iw | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Revision as of 17:43, 30 October 2020
Starting from v1.10, it is possible to connect a MOD unit to a wireless network. We can achieve this by using a WiFi USB dongle, connected on the back of the unit.
Please note this is an advanced and experimental feature, currently requiring knowledge of command-line.
Steps
- Power on the unit
- Connect it to a PC via USB cable
- Plug the WiFi USB adapter/stick on the back of the unit
- SSH into the device
- Create and edit the file /data/wpa_supplicant.conf (this can be done with nano /data/wpa_supplicant.conf or vi /data/wpa_supplicant.conf as you prefer),
Inside this file, write the following contents:
ctrl_interface=/run/wpa_supplicant
update_config=1network={
ssid="MyWiFiSSID"
psk="password-goes-here"
}
- Modify "MyWiFiSSID" and "password" as needed for your network (NOTE: the quotes are necessary)
- Run systemctl restart wpa-supplicant-wlan0 dhcpcd-wlan0 to activate WiFi services (not needed on subsequent boots)
- Run systemctl status wpa-supplicant-wlan0 to verify that service is running correctly. if you see "Active: active (running)" then all is fine, WiFi is working; otherwise continue to the firmware deploy steps. (edited)
Custom firmware deploy
In case it might be needed custom firmware (which MOD Devices does not ship), we need to find out which firmware to install. Here are the steps:
- Run dmesg | tail and look for an error message like this;
[ 293.903337] ieee80211 phy0: rt2x00lib_request_firmware: Error - Failed to request Firmware
[ 293.909338] ieee80211 phy0: rt2x00lib_request_firmware: Info - Loading firmware file 'rt2870.bin'
2. note what is the firmware you need, in this example case it is 'rt2870.bin' 3. download the firmware (for example, from the linux-firmware project using https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/snapshot/linux-firmware-20200918.tar.gz or similar) 4. create the firmware folder inside the SSH session, by running mkdir /data/firmware 5. copy the firmware over SSH to this new folder, using something like scp /path/to/firmware.bin root@192.168.51.1:/data/firmware/ 6. unplug and replug the WiFi usb stick
Finalizing
We can verify that everything is working by running dmesg inside the SSH session and checking the latest messages. If all is ok, you should see something like this:
[ 1321.759528] wlan0: authenticate with 00:06:91:64:12:a0
[ 1321.801547] wlan0: send auth to 00:06:91:64:12:a0 (try 1/3)
[ 1321.804295] wlan0: authenticated
[ 1321.805147] wlan0: associate with 00:06:91:64:12:a0 (try 1/3)
[ 1321.808800] wlan0: RX AssocResp from 00:06:91:64:12:a0 (capab=0x1411 status=0 aid=4)
[ 1321.815169] wlan0: associated
Finding IP address
After the unit connects to the WiFi, you can know the IP address by running ifconfig On the "wlan0" section you see the IP, like this:
wlan0 Link encap:Ethernet HWaddr B8:A3:86:02:18:62
inet addr:192.168.1.126 Bcast:192.168.1.255 Mask:255.255.255.0
Bonus: if your OS and WiFi network supports zeroconf/mDNS, you can now at this point remove the USB cable and connect to the unit via http://modduo.local/ or http://modduox.local/. This allows to keep using the plugin store and software updates. (which is blocked when using the WiFi IP directly)