RP3 - Unhandled Exception when connecting to Wifi

Hi there. I get an “unhandled exception error” whenever I try to connect via wifi to my Raspberry Pi 3.
I have verified that my password is correct. I tried to connect to a hotspot from my phone, and got the same message. Wired connection works fine.

I had originally uploaded logs, but have removed them for privacy reasons. The logs tell me that my psk string is wrong, and in the logs, I can see the password. But it’s wrong. I’ve verified that I’m typing it in correctly, and have even bypassed the keyboard and used the onscreen keyboard. It’s not displaying certain characters, namely “1” and “*”. I got this same error when I used my phone hotspot. The password I created for that temporary hotspot was just “hellohello”, so there’s no reason that would’ve have worked.

I’m not 100% Linux savvy, but let me know if there is any info you need about this issue. Thanks!

To get a better understanding of the problem you are experiencing we need more information from you. The best way to get this information is for you to upload logs that demonstrate your problem. You can learn more about how to submit a useful support request here.

Thanks for your understanding. We hope that we can help you get up and running again shortly.

Ok, below is a snapshot of the code relating to wifi. I notice that this code does not include my password, so must have happened before I entered my password. The errors indicate that something is happening before I even enter the password:

– Logs begin at Tue 2017-04-04 14:07:27 EDT, end at Tue 2017-04-04 14:29:22 EDT. –
Apr 04 14:07:27 Pi2 connmand[303]: wlan0 {TX} 13943 packets 2293378 bytes
Apr 04 14:07:27 Pi2 connmand[303]: wlan0 {update} flags 36867
Apr 04 14:07:27 Pi2 connmand[303]: wlan0 {newlink} index 3 address B8:27:EB:9E:5A:E0 mtu 1500
Apr 04 14:07:27 Pi2 connmand[303]: wlan0 {newlink} index 3 operstate 2
Apr 04 14:07:27 Pi2 connmand[303]: ipconfig state 7 ipconfig method 1
Apr 04 14:07:27 Pi2 preseed[465]: DBusException Raised: net.connman.Error.OperationAborted: Operation aborted
Apr 04 14:07:27 Pi2 dbus[265]: [system] Rejected send message, 4 matched rules; type=“method_return”, sender=“:1.22” (uid=0 pid=542 comm=“/usr/bin/python /usr/bin/preseed-agent fromfile “) interface=”(unset)” member=“(unset)” error name=“(unset)” requested_reply=“0” destination=“:1.4” (uid=0 pid=303 comm=“/usr/sbin/connmand -n --nodnsproxy --config=/etc/c”)
Apr 04 14:07:27 Pi2 connmand[303]: Skipping disconnect of 4c69627261727920536563757265_managed_psk, network is connecting.
Apr 04 14:07:27 Pi2 connmand[303]: ipconfig state 2 ipconfig method 1
Apr 04 14:07:27 Pi2 wpa_supplicant[389]: wlan0: Trying to associate with 00:25:00:ff:a6:6f (SSID=‘xxxxxxxx’ freq=2437 MHz)
Apr 04 14:07:27 Pi2 connmand[303]: wlan0 {RX} 117171 packets 21436335 bytes
Apr 04 14:07:27 Pi2 connmand[303]: wlan0 {TX} 13943 packets 2293378 bytes
Apr 04 14:07:27 Pi2 connmand[303]: wlan0 {update} flags 102403 <UP,LOWER_UP>
Apr 04 14:07:27 Pi2 connmand[303]: wlan0 {newlink} index 3 address B8:27:EB:9E:5A:E0 mtu 1500
Apr 04 14:07:27 Pi2 connmand[303]: wlan0 {newlink} index 3 operstate 5
Apr 04 14:07:27 Pi2 wpa_supplicant[389]: wlan0: Associated with 00:25:00:ff:a6:6f
Apr 04 14:07:27 Pi2 wpa_supplicant[389]: wlan0: CTRL-EVENT-DISCONNECTED bssid=00:25:00:ff:a6:6f reason=0 locally_generated=1
Apr 04 14:07:27 Pi2 wpa_supplicant[389]: wlan0: WPA: 4-Way Handshake failed - pre-shared key may be incorrect
Apr 04 14:07:27 Pi2 wpa_supplicant[389]: wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=1 ssid=“xxxxxxxx” auth_failures=1 duration=10 reason=WRONG_KEY
Apr 04 14:07:27 Pi2 wpa_supplicant[389]: wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=1 ssid=“xxxxxxxx” auth_failures=2 duration=20 reason=CONN_FAILED

As @ActionA wrote, we need full debug-enabled logs, please.

If it’s simply because of the password, you should obfuscate the real password or replace it with xxxxxxxxx placeholders. Just make it clear that you’ve done so.

Without a debug-enabled log file, it will be nigh on impossible to help you.

my wifi password is all upper case letters and my osmc will only connect if i input the password in lower case

Thanks to everyone for all your help. I apologise for the privacy paranoia, but for business reasons I need to remove anything that might be easily identifiable. I have replaced the SSID with a series like “xxxxxxxx”, but it is similar to the phrase “Business Secure”. My password has also been changed to “xxxxx”, but it contains the same letters as “1&legt". Because I’m in a business environment changing the password or SSID is a big deal and not going to happen. As I said above, from my non-expert perspective the logs reveal that my password, assuming it’s the same as I posted above, is not inputting correctly. So if it were "1&legt”, it’s inputting instead as something like “&legt*”, despite the number of times I’ve made sure that I’m typing it correctly.

Full debug logs are here: Logs

Thanks for your time.

Hi. Thanks for the log.

I see you’re using an HP Multimedia USB keyboard connected directly to the Pi2. It’s possible that the keyboard mapping is incorrect or the keyboard isn’t 100% electrically compatible with the Pi2.

Since you’ve given us the log file, I’m guessing you’ve probably connected the Pi2 to the router via an ethernet cable. If possible, i’d like you to SSH into the Pi2 from another computer, ie one that we know has the correct keyboard mapping. (On Windows you’ll probably use Putty and on Linux ssh is already there.)

Once you’re logged on run the following commands:

cd /var/lib/connman
sudo su
cd wifi_(long series of numbers and letters ending with managed_psk)

Using your editor of choice (probably nano) edit file settings.

Amongst other things, you’ll see Name=xxxxx, SSID=yyyyyyyy and Passphrase=zzzzzzzz

Using a known good keyboard, correct (if necessary) Name= and Passphrase=, and place a # character before SSID= (We’ll come back to that later.) The fact that your SSID name contains a space might complicate things - or it might not. (A space is theoretically permitted, AFAIK.)

Save the file and type reboot

Report back.

Hi dillthedog,
I was with you up until the cd wifi_(…) managed_psk part. I found what you were referring to in the logs, and I copied that into Putty, and followed the code you pasted above. I am assuming that the wifi_(…)managed_psk is a folder, which should contain a file called “settings”, that I am to edit? There is no “settings” file, only one called “data”, which of course doesn’t display readable text in nano. Should I make a file called “settings”, and if I do, what should I put as “name” - the name I’ve given to the Pi? Thanks.

Curious… Of course, having the redacted debug file complicates matters, so you’ll need to tell us whether it mentions the correct SSID. If so, I think @sam_nazarko or one of the devs will need to explain how it’s (partially) working without there being a settings file.

Here’s my own settings file, suitable redacted, naturally :wink:

Name=xxxxxxxx
SSID=xxxxxxxx
Frequency=2412
Favorite=true
AutoConnect=true
Modified=2017-03-31T11:53:11.063163Z
Passphrase=xxxxxxxx
IPv4.method=dhcp
IPv6.method=off
IPv6.privacy=disabled
IPv4.DHCP.LastAddress=192.168.xxx.xxx

Edit: Check out this post. It uses connmanctl to enter the SSID and passphrase.

I wonder if I have a problem with Connman? That would be weird. This is a fresh install of OSMC - no changes made.
Check out this screenshot of what happened when I tried to play with connman as per the instructions you linked me to.

Well at least you have a path problem. What is the output of which connmanctl
The output should be /usr/bin/connmanctl

You have to run connmanctl as root:

$ sudo connmanctl

Thanks dillthedog. On the forum thread you linked me too, a user reinstalled OSMC and opted for “wired connection” during the installation process. He said that “the problem is in OSMC installer” and sam_nazarko called him out and said that was “an unfounded statement.” But, whatever is going on, that worked for me. I’m connecting to wireless fine now. Thanks for your help.

Not aware of any bugs in the installer.
But without any logs – there’s nothing for us to look into.

I read the post but it was a bit thin on the evidence and, TBH, there are just too many variables involved. I’m also unclear what was meant by “installer”. Was it the program that partitions and writes to the SD card or the initial configuration screens?

For my part, I’ve always installed/configured a wired set-up, so have no practical experience of starting with a wireless set-up.

Whatever the ins and outs of the wireless problems other people have experienced, your own problem seemed to involve an “unconventional” $PATH variable or perhaps some kind of filesystem corruption. To me, it just emphasises the importance of using a high quality SD card when it’s holding an operating system like Linux, as opposed to, say, saving photos from your camera. Not all SD cards are equal and some are positively awful. IMO, it’s worth paying a bit extra to get a top-branded name like Samsung or SanDisk.

I agree. I don’t know what’s going on, all I know is that he had the same issue as me, and his “fix” worked for me. I can’t speak for that guy, but the installer I used was the OSMC Windows installer application that installs onto the SD card from Windows. I remember during my first install I wasn’t sure if I’d entered the wireless key correctly, but thought I’d be able to fix it up after install. I guess that was a mistake!

As for the SD cards - I’m using a SanDisk Ultra 8GB MicroSD.

Mine was the Ubuntu installer, though I only needed it for the Pi 3, since my subsequent Vero 4K came pre-loaded (better not to say pre-installed :wink: ).

I just wasted a couple of hours trying to work around the wifi setup bug.
I had put in my wifi info into the sd card formatting tool for osmc. It didn’t “just work” sadly, so I re-entered the password in the first time setup UI on the pi itself, but that just said unhandled exception was logged.
Even after pressing the upload logs button I couldn’t easily find which file contained the relevant log. I also couldn’t fix the issue in connmanctl because my connection was listed with an “a” next to it like it was trying to authenticate already, probably OSMC enthusiastically retrying the wrong password, or with some other incorrect setting.

Workaround I used: Just reformat the SD card saying you want a wired connection, plug it in with ethernet, then SSH and set up the wifi with connmanctl:

sudo su
connmanctl
enable wifi
services
connect [the id outputted next to your network name by the previous command]

Note, if you are trying to enter the password in the UI with a keyboard beware of hitting enter at the end. That will actually type whichever character is highlighted on-screen. Since there’s no “show-password” feature it’s pretty easy to mess this up, and I wonder whether osmc just can’t ever recover from an incorrect password perhaps because I’m pretty certain I was getting it right after discovering this.

It’s possible to fix an incorrectly entered WiFi password but you need to access the device via ethernet/SSH. Assuming wifi is already switched on:

connmanctl
services
agent on
connect wifi_b827ebffffff_zzzzzzzz_managed_psk

If the password is incorrect - and it knows it has never successfully connected - it should prompt you for the passphrase, eg:

Passphrase = [ Type=psk, Requirement=mandatory ]
PreviousPassphrase = [ Type=psk, Requirement=informational, Value=akakakak ]

In situations where the passphrase was correct but has changed, you need to remove the service name:

config wifi_b827ebffffff_zzzzzzzz_managed_psk --remove

and connect to it again, as detailed above.