QR-code for a wifi access key displays unexpected characters

REPRODUCIBILITY: 100% (always)
OSVERSION: 4.4.0.72
HARDWARE: Sony Xperia 10 III - xqbt52 - xqbt52 - 1.0.0.176 - aarch64
UI LANGUAGE: German (user: de_DE, os: de_DE.utf8)
REGRESSION: no

DESCRIPTION:

Unfortunately SailfishOS cannot connect directly to a wifi network via a scanned QR code.
So I scan the QR code with the Camera and paste it into the input-field for the wlan key . After that I got the message: Login failed.

PRECONDITIONS:

The pasted text looks like that: WIFI:T:WPA;S:;P:1234567890./+DtHllkj54;H:false.(Don´t worry that is not my real code:-)).
After you past the text in the input-field you have to remove the unused text. In my Example the pasted code is: 1234567890./+DtHllkj54.
But the Problem is that the / whitch you see are NOT EXISTS in the WLAN-Key. On Android it is no problem.

STEPS TO REPRODUCE:

  1. Scan the QR code for the wifi you want to access using the SailfishOS camera app .
  2. Copy the text to clipboard and past it into the input-field for the Wlan-key.
  3. Delete all unused characters before and after the key before you tap the connect button.

EXPECTED RESULTS:

Paste the right W-Lan key: 1234567890.+DtHllkj54 (my Example)
Successful connection to the network

ACTUAL RESULTS:

Paste the false W-Lan key: 1234567890./+DtHllkj54 (my Example)
Connection to the network failed.

MODIFICATIONS:

  • Patchmanager: yes
  • OpenRepos: yes
  • Chum: yes
  • Other: no:

ADDITIONAL INFORMATION:

Device Owner User: defaultuser
Home Encryption: enabled


the initial version of this bug report was created using Bugger 0.9.8+git1

When you say the / is not “available” what do you mean?

You can input it with the keyboard, right?

2 Likes

What do you mean “not available in the wlan key”?
Is it not part of the wlan key, and you expect it to have been automatically removed?
Surely that is an allowed character… so why should it be?

1 Like

Yes, I can.

And Yes the Character is allowed.

Unfortunately I used the false word. I was going to write:
…/ whitch you see are NOT EXISTS in the WLAN-Key.

I have corrected it in my Bug-reoprt.

I have tried my sample code I wrote in the report (1234567890.+DtHllkj54) with different code generators, and also with the guest login of my router. Unfortunately it works with the Sailfish camera.

I shortened your title a bit, I hope that was okay.

I used https://www.online-qrcode-generator.com/ to generate the qr code and pasted it into the notes app.
It was unexpected for me that it pasted a newline which was not in the code.

Where did you paste the scanned code? Did the / show up on the screen where you can copy the text?

So let me get this straight… you are expecting the QR code reader to magically filter out a “/” for a reason you can’t specify beyond “it makes it work”?
And this, in a format that is not recognized by the reader.
How would i make a QR code for my perfectly valid password that contains a slash if it is supposed to work like that?

I’d say it is a good thing that they produce the correct output with no random extra slashes.

1 Like

Thanks for your report @se. This is a bit of a confusing one. I don’t see any reason why the / would be added to the text in the QR code. At least it’s not something that’s mentioned in the specification.

It would help to clarify just a couple of things:

  1. If you scan the QR code with a different QR code scanner (e.g. an Android app or CodeReader), does the / show up there? That might suggest that the problem is with the QR code generator rather than the Sailfish reader.
  2. On an Android device, if you enter the password by hand in order to connect to the network, and include the / character, does it accept the password and connect successfully, or does it reject the password?

Independent of these, I guess the real solution to this problem would be for Sailfish OS to support these MECARD-like wifi QR-codes fully. Technically this would be considered a feature request, but since we already had an internal issue for it I’ve tagged it as tracked, and if there are any updates I’ll aim to post them here.

@thigg: I’m thinking your experience with newlines might be a trick of the way the data is being formatted.

I added the data using the generator you linked to. When the camera displays the data from the QR code it adds a newline after the / because the formater thinks the / is separating two words (and it prefers not to split the line in the middle of a word).

When I pasted this into the Notes application, it looks identical (i.e. with the newline added after the /), but this is still a “soft” newline added for formatting. If you remove some text from the front of the string so that it fits on one line, you should find that the newline isn’t really there after all.

You are right, this is confusing. You can’t reproduce the problem with my sample code in my bug report. It’s just to show you what happened.

To 1.:
Before I wrote my bug report, I tried to access my router using the QR code. I used:

  • SailfishOS camera app
  • Codereader app from Slava
  • Real Android

The result was that only the SailfishOS camera app inserted a / in the code, which was not there. I tried several times, always with the same result.

Now, after 19 days, I tried again to access my wifi by scanning the Qr code with the SailfishOS camera app. And interestingly I can access it and in the code I don’t see any wrong character (/) added.
I am completely confused. I didn’t reflash my phone or add/remove an app or patch. I am also trying it in the same room with the same light. I also scanned the code from the screen and from a printout.

To 2:
When I enter the password by hand, both on SailfishOS and Android, including the / character, it is rejected by my router.
If I enter it without the / character, I can access it successfully.

Thank you for marking it as tracked.

With the following wifi data I was able to reproduce the problem as in my bug report:
SSID: test
Encryption: WPA2
code: 47D36bu)$eI42,1=2G89
Telekom speedport smart 4

steps to Reproduce:
Scan the generated code with the SfOS-Camera.
Scan the generated code with Wivi-settings on Android or a Android app.

Result:
On SailfishOS it displays: WIFI:T:WPA;S:test;P:47D36bu)$eI42,1=2G89;H:false; - I cannot connect
On Android App: 47D36bu)$eI42,1=2G89 - this is the correct code
On Android: I don’t see the code but it connect directly to the wifi.

Problem:
On SailfishOS you see the character \ in the code which is NOT existing in the Original-Code.

Info:
Please scan only the Generate code from the UI of your router.
If you generate the QR-Code by using an online generator you don’t get this issue.

Sounds like router issue if online code generators don’t exhibit this? Can you post a picture of the qr code that has this problem?

1 Like

The \ is missing in the sfos ouput you posted here. Shouldnt it be there somewhere?

It’s there before the comma, but discourse is hiding it, you can ‘copy to clipboard’ in sfos forum viewer to get the raw comment

The \ is most likely an escape char for the , and would appear for other cahracters such as \ or ; aswell…

A quick google search shows: Barcode Contents ¡ zxing/zxing Wiki ¡ GitHub

Since the qrcode reader does not “parse” the wifi string, displaying the \ is correct.

3 Likes

qr-code

If it’s a router issue, I don’t understand why it works on Android.

Good question.

I see the same as you, the \ is missing in this post. But in the editor the missing \ is there. I have also already deleted this character and entered it again. But the result is the same. Confusing.

Thank you for your declaration and the links. Now I understand the problem on SfOS. But why is it no problem on Android?

One (1) backslash is visible in the scan output. At 2/3 of the line:
...el42\,1=2...

Tested on Volla and Xperia 10, 4.4.0.72 .

Thank you for the testing it. With a Speedport 4 router? Than this character combination works on volla and SailfishOS 4.4.0.72, but not on a Xperia 10III. Interesting.

So I think by myself, not being an expert: If the 64 bit SFOS is the same on X10III and Volla, and the bug occurs only on X10III and not on Volla, the bug must be located in the underlying Sony binaries…

@Se ‘With a Speedport 4 router?’
No, I scanned the QR code of your post above from the computer screen.

I misunderstand you. Because the character combination don’t work also on volla:

But you should also see “…el42,1=2…”. The " \ " does not exist in the code.

Ah, now I understand. The backslash shouldn’t be there but it is…
In this case, the bug is also present on my devices. And it seems to have nothing to do with 64 or 32 bit SFOS.