Difference between revisions of "WiFi"
Line 23: | Line 23: | ||
# Modify "MyWiFiSSID" and "password" as needed for your network (NOTE: the quotes are necessary) | # Modify "MyWiFiSSID" and "password" as needed for your network (NOTE: the quotes are necessary) | ||
− | # Run '''systemctl restart wpa-supplicant-wlan0 dhcpcd-wlan0 mod-hotspot''' to activate WiFi services (not needed on subsequent boots) | + | # Run '''systemctl restart wpa-supplicant-wlan0 dhcpcd-wlan0 mod-hotspot''' to activate WiFi services (not needed on subsequent boots)<br><small>(mod-hotspot does not seem to be present everywhere, ignore error around it if reported)</small> |
# Reconnect the WiFi USB dongle and wait a few seconds | # Reconnect the WiFi USB dongle and wait a few seconds | ||
# Run '''systemctl status wpa-supplicant-wlan0''' to verify that service is running correctly.<br> | # Run '''systemctl status wpa-supplicant-wlan0''' to verify that service is running correctly.<br> |
Latest revision as of 13:06, 25 April 2024
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=1
network={
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 mod-hotspot to activate WiFi services (not needed on subsequent boots)
(mod-hotspot does not seem to be present everywhere, ignore error around it if reported) - Reconnect the WiFi USB dongle and wait a few seconds
- 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 custom firmware deploy steps.
Custom firmware deploy
In case custom firmware is needed (which MOD Devices does not ship), first we will 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'
- Note what is the firmware you need, in this example case it is rt2870.bin
- Download the firmware (for example, from the linux-firmware project using https://cdn.kernel.org/pub/linux/kernel/firmware/linux-firmware-20221109.tar.gz or similar)
- Create the firmware folder inside the SSH session, by running ssh root@192.168.51.1 mkdir /data/firmware
- Copy the firmware file over SSH to this new folder, using something like scp /path/to/firmware.bin root@192.168.51.1:/data/firmware/name_of_the_kernel_driver/firmware.bin
- 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
If you can't connect to the device with USB or bluetooth (typically when you're on stage...) you can :
- connect to the wifi network with your smartphone/tablet (on the same network your MODdevice is connected to)
- scan the local network your with an android app like Ning (f-droid) or Net Scan (google play without ad)
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/, http://modduox.local/ or http://moddwarf.local/ depending on your unit model.
This allows to keep using the plugin store and software updates. (which is blocked when using the WiFi IP directly)