#Configuring wifi for WPA2-Enterprise network
1 messages · Page 1 of 1 (latest)
Any more details? (e.g. what you tried doing, what does not work etc.)
Oxide only can handle open WiFi networks, or WiFi networks that you've already registered in xochitl so far. You would need to write a script that injects the network configuration into wpa_supplicant after it starts up using DBus to have it play nice with oxide and xochitl.
@crisp patrol so far I've tried following the setup instructions from the provider, which specify TTLS authentication and PAP inner authentication. I get an EAP authentication failure, here are the logs. It seems like @ornate jewel unfortunately has the answer here, I was hoping there was something easier
That worked! It doesn't seem to be playing nicely with Xochitl just yet-- wpa_supplicant looks to have been disabled before I enabled it, and Xochitl seems to be periodically disabling and reenabling the connection. What's that dbus step I am missing @ornate jewel ?
You need to use dbus to configure the network dynamically when wpa_supplicant is started up
xochitl doesn't load wpa_supplicant in a way that it loads any configuration from disk, instead it uses the dbus API to load networks in from it's own configuration file
Oxide mimics this as well
I've never dealt with dbus before, would the Oxide repo be a good place to look for how to do that, or is there a forum post I've missed?
You can look at how oxide interacts as an example, but for how to actually make dbus calls, it depends on what you write your code in. You can make dbus calls from with the dbus-send command line tool as well
Oh so this isn't something I'm gonna be able to write into a bash script, throw into a directory, and put some sort of hook on?
Correct
If there's any prayer you have the spare time to help me get this done I'd appreciate it; I can work in whatever language except Perl
Definition of the dbus API that oxide is using, you can find further documenation on the calls online: https://github.com/Eeems-Org/oxide/blob/master/applications/system-service/fi.w1.wpa_supplicant1.xml
It's used to generate the following C++ class: https://github.com/Eeems-Org/oxide/blob/master/applications/system-service/wpa_supplicant.h https://github.com/Eeems-Org/oxide/blob/master/applications/system-service/wpa_supplicant.cpp
You can see some of how it's used by looking at uses of m_interface here: https://github.com/Eeems-Org/oxide/blob/master/applications/system-service/wlan.cpp and supplicant here: https://github.com/Eeems-Org/oxide/blob/master/applications/system-service/wifiapi.cpp
Here is how oxide starts wpa_supplicant: https://github.com/Eeems-Org/oxide/blob/e32a6c997405b247626f61b27b77f1aea39e1c8d/applications/system-service/wifiapi.cpp#L699-L720
Here is how oxide loads the networks from disk that xochitl has registered: https://github.com/Eeems-Org/oxide/blob/e32a6c997405b247626f61b27b77f1aea39e1c8d/applications/system-service/wifiapi.cpp#L722-L761
Seems like the path of least resistance would be to add a step there to load configs from /etc/wpa_supplicant, but will Xochitl play nice with that?
Not really, it loads networks in the same way oxide does
You may be able to get it to play nice by overriding the service to load from that config file, but I'm not sure what it will do to configuration while it loads
Especially if you have had issues with the configuration being cleared already
I've rewritten the service, and it's not that it's clearing the config, it's that it's kinda connecting and disconnecting with a period of every second or two
Since xochitl doesn't know about the network, that might be part of the issue
I don't know too much about how it manages the networks internally, I've only sorted out that how it's registering them into wpa_supplicant is over dbus, and where it stores it's settings
Also, I do recommend against rewriting services that come with the OS, and instead writing override files
It makes your changes much more explicit and transferrable
systemctl edit wpa_supplicant will create an override file for you by default
I think that Xochitl not knowing about the network is the biggest issue
I do have another idea though-- the thing that made the network work was using the default proto, do Remarkable's settings expose that at all?
The config that got a successful connection is
network={
ssid="CICS"
key_mgmt=WPA-EAP
eap=TTLS
identity="[cics_username]"
password="[cics_password]"
phase2="auth=PAP"
}
Take a look at your xochitl.conf file to see how it stores settings
It looks to be encoded in... some way
This is the constructor you use
WifiNetworks XochitlSettings::wifinetworks(){
beginGroup("wifinetworks");
QMap<QString, QVariantMap> wifinetworks;
for(const QString& key : allKeys()){
QVariantMap network = value(key).toMap();
wifinetworks[key] = network;
}
endGroup();
return wifinetworks;
}
Ah right, QMap<QString, QVariantMap>
Where QString is the name of the network, and then it's a QVariantMap of the values
You can think of QVariantMap as a dict in python, or a {} in JavaScript
And I'm guessing that one of the various QT libraries has some sort of parser that I could use to read it
The file is parsed by QSettings
I can't remember if I exposed any of this with rot into a json format
But it wouldn't be too difficult to write something that takes the values and spits out json
https://github.com/Eeems-Org/oxide/blob/master/applications/system-service/network.cpp has some code dealing with trying to read and normalize the values into something wpa_supplicant needs
I do not
I'm using a modified version of this script: https://github.com/pascalw/remarkable-wifi-conf/blob/master/remarkable_wifi_conf.py
I've just added the settings (peap etc.) and a prompt for the username - then I get an encoded version of the settings that I can add to xochitl.conf. It probably depends on your network, how this works, but for me on a wpa enterprise network, I nly have to do this (no changes to wpa_supplicant etc.).
Do you need to manually set any of these settings?
The code would probably be pretty close to the following:
#include <QTextStream>
#include <liboxide.h>
using namespace Oxide::JSON;
int main(int argc, char* argv){
QTextStream qStdOut(stdout, QIODevice::WriteOnly);
qStdOut << toJson(xochitlSettings.wifinetworks()).toStdString().c_str() << Qt::endl;
return 0;
}
If only that repo wasn't all rights reserved
Well it's based on this https://github.com/Evidlo/examples/blob/b5305ee8db00e4b0b43bd35a6b01228290172502/python/xochitl_conf.py
It also looks like that only supports psk, so it would not work for this
@ornate jewel , I know, that's why I don't share my modified script - but nobody can stop us from being inspired by the publically available script. I'm using the following json-snippet for my enterprise network:
'eap': 'PEAP',
'identity': identity,
'password': password,
'phase2': 'MSCHAPv2',
'protocol': 'eap',
'ssid': ssid
If only someone would open a PR to add support for this kind of thing to oxide 😦
I don't have a network like this to test with
If I ever finish up this paper I've been working on for the past year then I'll volunteer to do that
Wifi support in oxide basically is only known to work with psk authentication
as that's all I've tested with
Any idea if there's a key corresponding to encryption type anywhere in there?
eh whatever I'll try this
I'm reading the value from the QSettings object and unfortunately it all looks kosher, I really wonder what the space of possible keys that it can have are
I do wish they used a standard format for storing these values so we can just use whatever wpa_supplicant uses