RACHEL-Kolibri on Linux Mint

Hi James

I made the changes as suggested but it still looks no-go:

user1@rachel:/etc$ sudo nano dhcpcd.conf
user1@rachel:/etc$ sudo nano dnsmasq.conf
user1@rachel:/etc$ sudo nano /hostapd/hostapd.conf
user1@rachel:/etc$ cd hostapd
user1@rachel:/etc/hostapd$ sudo nano hostapd.conf
user1@rachel:/etc/hostapd$ cd /
user1@rachel:/$ sudo systemctl start hostapd
Job for hostapd.service failed because the control process exited with error code.
See “systemctl status hostapd.service” and “journalctl -xe” for details.
user1@rachel:/$

'Fraid I’m off to bed now as it is nearly midnight but I wanted to try the fixes for you.

Regards
Andrew

Hi Andrew,

Thanks for trying. I think I’ll need to see the output of “sudo systemctl status hostapd” when you get a chance. Then I can see why it failed to start.

James

Hi James

I shut the X240 down overnight and then ran your commands as follows:-
~
user1@rachel:~$ sudo systemctl start hostapd
user1@rachel:~$ sudo systemctl status hostapd
● hostapd.service - Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator
Loaded: loaded (/lib/systemd/system/hostapd.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2020-06-14 11:46:34 BST; 11min ago
Process: 981 ExecStart=/usr/sbin/hostapd -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF} (code=exited, status=0/
Main PID: 1021 (hostapd)
Tasks: 1 (limit: 4265)
CGroup: /system.slice/hostapd.service
└─1021 /usr/sbin/hostapd -P /run/hostapd.pid -B /etc/hostapd/hostapd.conf

Jun 14 11:46:33 rachel systemd[1]: Starting Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator…
Jun 14 11:46:34 rachel hostapd[981]: Configuration file: /etc/hostapd/hostapd.conf
Jun 14 11:46:34 rachel hostapd[981]: Using interface wlp3s0 with hwaddr cc:3d:82:4e:e9:cc and ssid “RACHEL-Pi”
Jun 14 11:46:34 rachel hostapd[981]: wlp3s0: interface state UNINITIALIZED->ENABLED
Jun 14 11:46:34 rachel hostapd[981]: wlp3s0: AP-ENABLED
Jun 14 11:46:34 rachel systemd[1]: Started Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator.
Jun 14 11:51:42 rachel hostapd[1021]: wlp3s0: STA 00:1d:aa:71:c0:59 IEEE 802.11: disassociated due to inactivity
Jun 14 11:51:43 rachel hostapd[1021]: wlp3s0: STA 00:1d:aa:71:c0:59 IEEE 802.11: deauthenticated due to inactivity (t
lines 1-17/17 (END)

So the start command just came back to the prompt with no message. The status one was as above.

FYI there is no relevant SSID displaying on my phone WiFi scan - I don’t know if you expected that it should yet?

Regards
Andrew

Hi Andrew,

That actually looks like it’s running! I would expect there to be a RACHEL-Pi SSID at that point so I’m now wondering why it’s not broadcasting. Can you try adding the following line to /etc/hostapd/hostapd.conf

ignore_broadcast_ssid=0

That should force it to broadcast in case the default is to not broadcast on Mint. The other thing that might be helpful is the output of an “iwconfig” command.

James

Hi James

OK so hostapd.conf now reads:-

interface=wlp3s0
driver=nl80211
ssid=RACHEL-Pi
ignore_broadcast_ssid=0
hw_mode=g
channel=1
auth_algs=1
wmm_enabled=0

I have just run iwconfig and realised that Wifi is connected to my own guest network. That is probably not helping!

user1@rachel:/etc/hostapd$ iwconfig
lo no wireless extensions.

wlp3s0 IEEE 802.11 ESSID:“DrayTek17Guest”
Mode:Managed Frequency:2.462 GHz Access Point: 00:1D:AA:71:C0:59
Bit Rate=144.4 Mb/s Tx-Power=22 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Power Management:on
Link Quality=57/70 Signal level=-53 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:8 Missed beacon:0

enp0s25 no wireless extensions.

user1@rachel:/etc/hostapd$

I’m not sure how the wireless adaptor should be set as presumably we want it to act as an AP in Infrastructure mode or some such, so I have just tried Method as Shared to Other Computers to break its connection to my Draytek17Guest on my router.
I have also set it to Use as Hotspot. That prompts it to try and share as SSID “rachel” but then I get Network: Connection failed (or some such) flash up briefly.

Now I get:

user1@rachel:/etc/hostapd$ iwconfig
lo no wireless extensions.

wlp3s0 IEEE 802.11 ESSID:off/any
Mode:Managed Access Point: Not-Associated Tx-Power=22 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Power Management:on

enp0s25 no wireless extensions.

user1@rachel:/etc/hostapd$

It feels as if we are nearly there, but I need some help to configure it!

Regards
Andrew

Hi Andrew,

Yes it seems like we’re very close indeed! We definitely want the adapter in access point mode so it shouldn’t be connected to any networks as a client as you mentioned.

  • “sudo rfkill list” - This may not return any results but it may list any blocked interfaces.
  • “sudo rfkill unblock wifi” - This will unblock wifi if it is blocked by rfkill
  • “sudo systemctl restart network-manager” - This will disconnect you temporarily from any networks
  • Right click the network icon in the taskbar and see if wireless is enabled there. Enable it if it isn’t.
  • “sudo nano /var/lib/NetworkManager/NetworkManager.state” - if you see WifiEnabled=False change it to WifiEnabled=True
  • “sudo systemctl stop wpa_supplicant”

You can also try these three steps

  • sudo iwconfig wlp3s0 down
  • sudo iwconfig wlp3s0 mode monitor
  • sudo iwconfig wlp3s0 up

One of these things might work. It may also require a reboot upon any changes. The other option is we might need to find a command for that specific chipset to force it into access point mode but we’ll see how this goes first.

This is what the output of sudo iwconfig looks like on the pi when the hotspot is up and working

pi iwconfig

James

Hi James

I will post below the results of all your commands before rebooting the machine but so far no SSID appears on the phone after any of them.

NetworkManager.state contains three lines after [main],
[main]
NetworkingEnabled=true
WirelessEnabled=true
WWANEnabled=true

user1@rachel:/etc/hostapd$ sudo rfkill list
[sudo] password for user1:
0: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
1: tpacpi_bluetooth_sw: Bluetooth
Soft blocked: no
Hard blocked: no
2: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
user1@rachel:/etc/hostapd$ sudo rfkill unblock wifi
user1@rachel:/etc/hostapd$ sudo systemctl restart network-manager
user1@rachel:/etc/hostapd$ sudo nano /var/lib/NetworkManager/NetworkManager.state
user1@rachel:/etc/hostapd$ sudo systemctl stop wpa_supplicant
user1@rachel:/etc/hostapd$
user1@rachel:/etc/hostapd$ sudo nano /var/lib/NetworkManager/NetworkManager.state
user1@rachel:/etc/hostapd$

user1@rachel:/etc/hostapd$ sudo iwconfig wlp3s0 down
iwconfig: unknown command “down”
user1@rachel:/etc/hostapd$ sudo iwconfig wlp3s0 mode monitor
Error for wireless request “Set Mode” (8B06) :
SET failed on device wlp3s0 ; Device or resource busy.
user1@rachel:/etc/hostapd$ sudo iwconfig wlp3s0 up
iwconfig: unknown command “up”
user1@rachel:/etc/hostapd$

Wireless in the network icon bottom right is now showing as unavailable (it was previously Enabled)

That’s it. Going to reboot now but will only post if that results in any change.

Regards
Andrew

I think because you got

Error for wireless request “Set Mode” (8B06) :
SET failed on device wlp3s0 ; Device or resource busy.

this means it’s probably still used by something else. Maybe we can try disabling wpa_supplicant and then rebooting

sudo service wpa_supplicant stop
sudo systemctl mask wpa_supplicant.service
sudo reboot now

Sorry this is a bit like shooting in the dark right now. I anticipated this part wouldn’t be fun :smiley:.

James

Hi James

Sorry this is a bit like shooting in the dark right now. I anticipated this part wouldn’t be fun
No worries! I’m just pleased that you can spend the time to help.

Tried those 3 commands disabling wpa_supplicant, to no avail.
FWIW the network icon still shows wireless as unavailable.

Network Connections shows 2 wireless connections:-
Auto Draytek17Guest Last used 1 day ago
Hotspot Never

I tried deleting these two connections in case one of them was using the adaptor. No Joy.

The Network icon reports always that Wireless is unavailable now and nothing I have done seems to allow it to be re-enabled!

I’ll have a play around with Hotspot settings while you are getting some Zs. :slight_smile:

Regards
Andrew

James

I just rebooted again and Wireless adaptor is back with my local SSIDs available. Whoopee!

Thought I should also add that I have Timeshift running at 1900 hrs every day so if all else fails I can go back to 13th June and restore the system to the point (I think) before we started messing around with the adaptor settings.

Let me know if you want to try anything else but it occurs to me that using the standard Hotspot option (which I have never used on this O/S) might achieve what we want?

Regards
Andrew

Hi Andrew,

That’s great that it’s back. So in the past when I wanted to switch from managed mode and into AP mode I would turn off the wpa_supplicant service and enable hostapd. Hostapd is what provides the hotspot. The other thing is that in Mint the Network Manager is also in control of the device being enabled or disabled so maybe that was changing the state.

What we want is the hostapd service to start at boot and provide the hotspot because all of the settings are set for it. The best thing we can do is figure out what state it’s in and why by using “sudo systemctl status hostapd” “sudo systemctl status wpa_supplicant” “sudo systemctl status network-manager” and “sudo iwconfig” and looking at the output of each to see what it’s doing. If the adapter is showing as unavailable it may be blocked by rfkill for some reason so “sudo rfkill list” will show that. Generally, starting hostapd should switch the adapter into access point mode but I think there is something else going on here.

I would get the status of each and if hostapd is not active ( running ), run “sudo systemctl restart hostapd” again and then check the output of sudo iwconfig and hostapd status. If it’s still not available I think we’re going to have to look at a command to specifically put the device into AP mode.

James

@andrewc, just a bit of info. I looked around about the Intel N7260 cards. These can be put into AP mode in the 2.4ghz range so it should work. It doesn’t allow 5ghz AP mode, but if the channel is set from 1-11 in hostapd.conf it should be fine. Something else might be interfering.

Hi James

So the SSID was still not showing on my phone after booting up this evening. I tried switching on the WiFi Hotspot in the GUI - Turn On. It gives
Network Name rachel
Security Type WPA
Password *******
Then after a few seconds
Network Failed: Activation of network connection failed
Disconnected - Wireless Network

So it looks as if it is at least trying to work but something is stopping it.
I ran your various status commands as follows and got these results:-

sudo systemctl status hostapd
● hostapd.service - Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator
Loaded: loaded (/lib/systemd/system/hostapd.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2020-06-16 19:18:56 BST; 18min ago
Process: 954 ExecStart=/usr/sbin/hostapd -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF} (code=exited, status=0/SUCCESS
Main PID: 997 (hostapd)
Tasks: 1 (limit: 4265)

user1@rachel:~$ sudo systemctl status wpa_supplicant
● wpa_supplicant.service - WPA supplicant
Loaded: loaded (/lib/systemd/system/wpa_supplicant.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2020-06-16 19:18:52 BST; 19min ago
Main PID: 809 (wpa_supplicant)
Tasks: 1 (limit: 4265)
CGroup: /system.slice/wpa_supplicant.service
└─809 /sbin/wpa_supplicant -u -s -O /run/wpa_supplicant

Jun 16 19:23:58 rachel wpa_supplicant[809]: Note: nl80211 driver interface is not designed to be used with ap_scan=2; this c
Jun 16 19:23:58 rachel wpa_supplicant[809]: wlp3s0: Failed to start AP functionality
Jun 16 19:23:58 rachel wpa_supplicant[809]: wlp3s0: Failed to start AP functionality
Jun 16 19:24:44 rachel wpa_supplicant[809]: Note: nl80211 driver interface is not designed to be used with ap_scan=2; this c
Jun 16 19:24:48 rachel wpa_supplicant[809]: wlp3s0: Failed to start AP functionality
Jun 16 19:25:40 rachel wpa_supplicant[809]: Note: nl80211 driver interface is not designed to be used with ap_scan=2; this c
Jun 16 19:25:43 rachel wpa_supplicant[809]: wlp3s0: Failed to start AP functionality
Jun 16 19:25:47 rachel wpa_supplicant[809]: Note: nl80211 driver interface is not designed to be used with ap_scan=2; this c
Jun 16 19:25:47 rachel wpa_supplicant[809]: wlp3s0: Failed to start AP functionality
Jun 16 19:25:47 rachel wpa_supplicant[809]: wlp3s0: Failed to start AP functionality

CGroup: /system.slice/hostapd.service
└─997 /usr/sbin/hostapd -P /run/hostapd.pid -B /etc/hostapd/hostapd.conf

Jun 16 19:18:56 rachel hostapd[954]: Configuration file: /etc/hostapd/hostapd.conf
Jun 16 19:18:54 rachel systemd[1]: Starting Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator…
Jun 16 19:18:56 rachel hostapd[954]: Using interface wlp3s0 with hwaddr cc:3d:82:4e:e9:cc and ssid “RACHEL-Pi”
Jun 16 19:18:56 rachel hostapd[954]: wlp3s0: interface state UNINITIALIZED->ENABLED
Jun 16 19:18:56 rachel hostapd[954]: wlp3s0: AP-ENABLED
Jun 16 19:18:56 rachel systemd[1]: Started Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator.

● NetworkManager.service - Network Manager
Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2020-06-16 19:18:54 BST; 20min ago
Docs: man:NetworkManager(8)
Main PID: 833 (NetworkManager)
Tasks: 4 (limit: 4265)
CGroup: /system.slice/NetworkManager.service
├─ 833 /usr/sbin/NetworkManager --no-daemon
└─1077 /sbin/dhclient -d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /run/dhclient-enp0s25.pid -lf /var/lib/NetworkManager/dhclient-8f2d00e3-0d88-3

sudo systemctl status network-manager
Jun 16 19:25:47 rachel NetworkManager[833]: [1592331947.7144] Config: added ‘frequency’ value ‘2412’
Jun 16 19:25:47 rachel NetworkManager[833]: [1592331947.7146] Config: added ‘key_mgmt’ value ‘WPA-PSK’
Jun 16 19:25:47 rachel NetworkManager[833]: [1592331947.7148] Config: added ‘psk’ value ‘’
Jun 16 19:25:47 rachel NetworkManager[833]: [1592331947.7150] Config: added ‘proto’ value ‘RSN’
Jun 16 19:25:47 rachel NetworkManager[833]: [1592331947.7151] Config: added ‘pairwise’ value ‘CCMP’
Jun 16 19:25:47 rachel NetworkManager[833]: [1592331947.7153] Config: added ‘group’ value ‘CCMP’
Jun 16 19:26:13 rachel NetworkManager[833]: [1592331973.2215] device (wlp3s0): Activation: (wifi) Hotspot network creation took too long, failing activation
Jun 16 19:26:13 rachel NetworkManager[833]: [1592331973.2216] device (wlp3s0): state change: config -> failed (reason ‘supplicant-timeout’, sys-iface-state:
Jun 16 19:26:13 rachel NetworkManager[833]: [1592331973.2236] device (wlp3s0): Activation: failed for connection ‘Hotspot’
Jun 16 19:26:13 rachel NetworkManager[833]: [1592331973.2249] device (wlp3s0): state change: failed -> disconnected (reason ‘none’, sys-iface-state: 'manage

user1@rachel:~$ sudo rfkill list
0: tpacpi_bluetooth_sw: Bluetooth
Soft blocked: no
Hard blocked: no
1: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
2: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
user1@rachel:~$

So it looks to me as if the driver might be a problem here from the line:
Note: nl80211 driver interface is not designed to be used with ap_scan=2; this c

Note also the different SSIDs “RACHEL-Pi" and “rachel” mentioned

Any thoughts what to try here?

Regards
Andrew

Hi Andrew,

So it looks like both hostapd and NetworkManager are trying to create a hotspot. We can tell that NetworkManager is using it’s own settings that we didn’t change during RACHEL installation because it’s using WPA_PSK by default and the hostapd.conf we’re using has minimal settings without authentication. I may be wrong on this, but I think you’ll have to either disable hostapd or disable networkmanager to get one or the other working. If you’d like to maintain the GUI control over it, you’d probably want to disable hostapd but then I will probably need your help to automate the network settings in the installer for this.

Before you try that, the ap_scan=2 error is from a setting in /etc/wpa_supplicant/wpa_supplicant.conf. It’s mentioned on this page https://w1.fi/cgit/hostap/plain/wpa_supplicant/wpa_supplicant.conf that “ap_scan=1 is the only option working with nl80211”. Since that’s the driver we’re using, you should try “sudo nano /etc/wpa_supplicant/wpa_supplicant.conf” and then change ap_scan from 2 to 1. Once you change that try rebooting. If it works we can go from there.

If that didn’t work, try disabling hostapd with “sudo systemctl disable hostapd” “sudo systemctl stop hostapd” and we’ll see if the other hotspot can start after another reboot. Hopefully one of these things does something!

James

Hi James

Cracked it!

There isn’t actually a conf file at all at /wpa_supplicant/wpa_supplicant.conf - nano was going to create a new one - so I tried your other suggestion to disable hostapd and rebooted.

Success! I can now access the laptop hotspot on the SSID “rachel”.

So going from here we can use the Mint GUI to create the hotspot easily and you could just leave that bit out of your installer I guess?

What else do I need to do?

RACHEL menu displays OK with no modules. Trying to download the modules from RACHEL Admin
en-kolibri and
en-kolibri-index
both show failed after a few seconds.

Off to bed now but if you can post some further instructions I can give it a further go in the morning.

Regards
Andrew

Quick postnote…

The rachel hotspot allocates an ip in the 10.10.10.x range on both my phone and android tablet.

From both I can access 192.168.1.38 (the Mint laptop) and RACHEL menu fine but they can’t access the internet or any other machine over my network. I wonder why it is not routing?

Hey Andrew,

Great news! I think that makes sense that they were blocking each other. I can remove the hostapd portion of the installer and if you find the file that contains the settings for the NetworkManager hotspot in Mint we can add your customized file to the installer so it’s all set up automatically during the RACHEL install. That should be pretty straight forward. It’s also great that your device is getting an ip in the range we wanted.

Now that the hotspot is working we need to fix the iptables rules for internet forwarding to work so you get internet access on your phone through the hotspot. The current installer was using the wlan0 and eth0 names for the iptables rules as well. That needs to be changed to wlp3s0 and enp0s25. I also suspect that the iptables restore command didn’t run properly. That might not make sense but basically you can run the following commands to get it going.

1. sudo iptables -t nat -A POSTROUTING -o enp0s25 -j MASQUERADE
2. sudo iptables -A FORWARD -i wlp3s0 -o enp0s25 -j ACCEPT
3. sudo iptables -A FORWARD -i enp0s25 -o wlp3s0 -m state --state RELATED,ESTABLISHED -j ACCEPT
4. sudo iptables-save > /etc/iptables.ipv4.nat

that creates iptables rules that shares the internet connection from ethernet to the wifi hotspot interface and then saves them to a file called /etc/iptables.ipv4.nat. Now we need to make sure they’re restored every bootup.

  1. “sudo nano /etc/rc.local” and then go to the bottom of the file
  2. add “iptables-restore < /etc/iptables.ipv4.nat”
  3. add “exit 0” after the iptables restore line

Make sure there’s only one exit 0 and it’s at the end of the file. Now the wifi clients should get access to the ethernet connection and the internet. You will need to reboot to test this. The laptop itself should get internet if it’s connected via ethernet and be able to browse/install modules so if that’s not working something else is wrong that we’ll have to look for.

The other thing you mentioned is the en-kolibri-index not working. The one that’s on the RACHEL servers won’t work with this installation. I’ve uploaded the working ones here mint_modules.zip or you can use the ones from a RACHEL-Pi image. I will add these to the next installer. Sorry, forgot about that! You may need to do the following commands after transferring them to /var/www/modules with WinSCP or a similar program.

  1. sudo chown -R www-data:www-data /var/www/modules
  2. sudo chmod 755 /var/www/modules/en-file_share/uploads

Let me know how this goes. It seems we’re making some progress.

James

Hi James

OK - working my way through that lot… got to

sudo iptables-save > /etc/iptables.ipv4.nat
```bash: /etc/iptables.ipv4.nat: Permission denied

That file seems to have a Read-Only attribute set and is only Read & Write for root.  Its contents are:

Generated by iptables-save v1.6.1 on Sat Jun 13 17:06:02 2020
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A FORWARD -i wlan0 -o eth0 -j ACCEPT
-A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
COMMIT
# Completed on Sat Jun 13 17:06:02 2020
# Generated by iptables-save v1.6.1 on Sat Jun 13 17:06:02 2020
*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT
# Completed on Sat Jun 13 17:06:02 2020

then editing rc.local to add
iptables-restore < /etc/iptables.ipv4.nat

I have added that line but there were already 2 iptables-restore lines in there so I commented them out with a #.  Is that correct?

On the plus side I got the modules copied across using Mint Elevated Privileges and they now appear in the RACHEL menu.  I presume I now need to set up Kolibri from scratch?

Regards
Andrew

Hi @andrewc,

I made a bunch of changes and a lot of fixes to the installer and uploaded it. I also made a little interface that will be handy in the future as we can start adding options for different hardware and wifi interface names, etc.

  1. Download linux_mint_06_17_2020.zip
  2. Unzip the installer folder to the /var/tmp on your mint device
  3. “cd /var/tmp/installer”
  4. “sudo bash rachel”
  5. Update the system ( You may want to reboot at the end )
  6. Choose install
  7. When it completes, reboot the device for everything to work

That has hostapd removed, fixes to network interface naming, fixes iptables restore command, includes the content shell with some fixes for your device like showing the ip, includes the en-kolibri-index and en-file_share modules, fixes kiwix restart, and a few other things. I would suggest starting fresh with this one and seeing how it goes.

James

Hi James

Before I saw your last post just now I had managed to fix the iptables.ipv4.nat by changing its permissions and running your command so I’ll just reboot now and see where we are with it.

Jut for clarity do you then want me to roll back the system to before when we loaded your original installer (if I can) and run the new one from there?

EDIT: I rebooted but the Hotspot is only working locally and is not persistent.
Depending on your response to the above I will roll back everything tomorrow and try the new installer.