Difference between revisions of "WiFi"

From MOD Wiki
Jump to navigation Jump to search
 
(16 intermediate revisions by 3 users not shown)
Line 10: Line 10:
 
# Plug the WiFi USB adapter/stick on the back of the unit
 
# Plug the WiFi USB adapter/stick on the back of the unit
 
# SSH into the device
 
# 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),
+
# 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:
 
Inside this file, write the following contents:
  
 
<source>
 
<source>
 
ctrl_interface=/run/wpa_supplicant
 
ctrl_interface=/run/wpa_supplicant
update_config=1network={
+
update_config=1
 +
network={
 
         ssid="MyWiFiSSID"
 
         ssid="MyWiFiSSID"
 
         psk="password-goes-here"
 
         psk="password-goes-here"
Line 22: 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''' 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>
# 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)
+
# Reconnect the WiFi USB dongle and wait a few seconds
 +
# Run '''systemctl status wpa-supplicant-wlan0''' to verify that service is running correctly.<br>
 +
If you see "Active: active (running)" then all is fine, WiFi is working; otherwise continue to the custom firmware deploy steps.
  
 
=== Custom firmware deploy ===
 
=== 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.
+
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:
 
Here are the steps:
  
Line 37: Line 40:
 
</source>
 
</source>
  
2.  note what is the firmware you need, in this example case it is 'rt2870.bin'
+
# 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)
+
# 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)
4.  create the firmware folder inside the SSH session, by running mkdir /data/firmware
+
# Create the firmware folder inside the SSH session, by running '''ssh root@192.168.51.1 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/
+
# 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/<em>name_of_the_kernel_driver</em>/firmware.bin'''
6.  unplug and replug the WiFi usb stick
+
# Unplug and replug the WiFi usb stick
  
 
=== Finalizing ===
 
=== Finalizing ===
Line 59: Line 62:
 
==== Finding IP address ====
 
==== Finding IP address ====
  
After the unit connects to the WiFi, you can know the IP address by running ifconfig
+
After the unit connects to the WiFi, you can know the IP address by running '''ifconfig'''.<br>
On the "wlan0" section you see the IP, like this:
+
On the '''wlan0''' section you see the IP, like this:
  
 
<source>
 
<source>
Line 67: Line 70:
 
</source>
 
</source>
  
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/.
+
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 [https://f-droid.org/en/packages/de.csicar.ning/ '''Ning''' (f-droid)] or [https://play.google.com/store/apps/details?id=com.wwnd.netmapper '''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.<br>
 
This allows to keep using the plugin store and software updates. (which is blocked when using the WiFi IP directly)
 
This allows to keep using the plugin store and software updates. (which is blocked when using the WiFi IP directly)
  

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

  1. Power on the unit
  2. Connect it to a PC via USB cable
  3. Plug the WiFi USB adapter/stick on the back of the unit
  4. SSH into the device
  5. 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"
}
  1. Modify "MyWiFiSSID" and "password" as needed for your network (NOTE: the quotes are necessary)
  2. 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)
  3. Reconnect the WiFi USB dongle and wait a few seconds
  4. 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:

  1. 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'
  1. Note what is the firmware you need, in this example case it is rt2870.bin
  2. 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)
  3. Create the firmware folder inside the SSH session, by running ssh root@192.168.51.1 mkdir /data/firmware
  4. 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
  5. 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 :


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)

Useful resources

  1. https://wiki.archlinux.org/index.php/Wpa_supplicant
  2. https://wiki.archlinux.org/index.php/Network_configuration/Wireless#iw