We have moved to a new Sailfish OS Forum. Please start new discussions there.
10

Enable new wireless network connection by scanning its qrcode

asked 2016-05-31 02:41:45 +0300

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

updated 2016-05-31 02:50:19 +0300

SebM gravatar image

Hi,

My wifi password is a generated password and I don't want to bother typing it on the Jolla because it is 63 characters long and it is complicated.

On Android there is an application called "Barcode Scanner" (com.google.zxing.client.android) which enables the connection to a new wireless network by scanning a wifi connection string through it's qrcode picture (without typing SSID nor password) :

$ zbarimg -q --raw myWiFi.png
WIFI:S:mySSID;T:WPA;P:mfejzjfjjnflzwmjflirhrvmo;H:true;;

Btw: H:true means the SSID is hidden.

Can you provide an application or a SailFish Gui that enables a new wireless network connection by scanning its qrcode ?

edit retag flag offensive close delete

Comments

1

@SebM is there a standard to that? i also use qr codes for the password of my wlan, but they only consist of the PSK, so its not that comfortable as what youre are suggesting. so if theres an open standard i would support that idea!

misc11 ( 2016-05-31 02:48:50 +0300 )edit

@misc11 I don't know if there is a standard for that but I know wifi network share through qrcode is widely used. The official documentation I found is here : Barcode Contents

SebM ( 2016-05-31 03:46:46 +0300 )edit

I'd assume it would be possible to add this to the existing QR code scanner for Sailfish. The only trouble I see: Although I didn't check, I'm pretty certain that an application that writes to the Wifi config (wherever it's stored) won't make it into harbour.

ossi1967 ( 2016-05-31 13:56:55 +0300 )edit

This sounds like a cool project!

tortoisedoc ( 2016-05-31 14:24:52 +0300 )edit

i like the idea in gerneral but i strongly dislike this standard - if you can even call it that. just somebody on github making a table wont make it a standard. and why would you use a trademarked term there? and what is that syntax???

misc11 ( 2016-05-31 22:31:53 +0300 )edit

3 Answers

Sort by » oldest newest most voted
5

answered 2016-05-31 13:36:51 +0300

gabs5807 gravatar image

updated 2016-05-31 13:40:02 +0300

Hello there ist a similar (very old) request here: https://together.jolla.com/question/103640/idea-generate-w-lan-configuration-as-qr-code-to-transfer-it-from-phone-to-tablet/. As i wrote there the AVM DSL boxes also generate a QR Code after WLan configuration. Therefore it would be a nice feature to get a standard implementation for it (creating a QR code on the phone / reading QR code on the phone and configure WLan).

edit flag offensive delete publish link more

Comments

1

@gabs5807 The qrcode can be generated (on Ubuntu or Debian) with qtqr or qreator or by using this command line :

$ qrencode -s 7 -o qr-wifi.png "WIFI:S:$(zenity --entry --text="Hidden Network name (SSID)" --title="Create WiFi QR");T:WPA;P:$(zenity --password --title="Wifi Password");H:true;;"
SebM ( 2016-05-31 22:32:46 +0300 )edit
1

@gabs5807 did you ever check the contents of the avm qr code? is it just the psk or does it look similar to the proposed way?

misc11 ( 2016-05-31 22:33:32 +0300 )edit

Hello @misc11 this is the result (or something similar ;-)) of the QC Scan using the SailfisOS CodeReader tool on the avm generated code:

WIFI:S:This_is_the_Home_4_MobyDick;T:WPA;P:Very_secret_WLan2_password!;;

It's similar to the format you get above with zbarimg on the QC code you scanned. So it seem this is a so called standard format.

May be this is an enhanced list which is finnished with ';;' and could have additional arguments like 'H:true' .

gabs5807 ( 2016-06-01 21:05:39 +0300 )edit

@SebM So i need qrencode (or a similar) command on SailfisOS to generate the QC code and a utility to show it on the screen. Then i can read it on an other phone and configure the WLan on this phone. May be some scripting must be done for a quick hack on both sides ;-) ..

The serious way would be do make an implementation via sudo and an interactiv password input on the screen for reading and writing secure configuration information from/into the system.

gabs5807 ( 2016-06-01 21:40:35 +0300 )edit
5

answered 2016-05-31 23:49:11 +0300

tortoisedoc gravatar image

updated 2016-05-31 23:52:09 +0300

After some investigation, it appears sfos does not support generating network configs via connman without user input (for the password); i.e. by providing the password directly with the creation request to connman. I am not even sure if connman actually supports such thing (one would assume it would, but meh).

So the main issue is to teach connman about the new network, without requiring it to show the password input connection dialog.

It should of course be possible to just create the configuration for the connman, but not without root permissions (which will basically void your harbour access day zero).

It remains to be seen if connman supports connecting to a network by separately configuring the password in advance.

edit flag offensive delete publish link more

Comments

2

I wrote a script to convert wpa_supplicant.conf to conman. All WLANs worked out of the box when they came into reach.
So, it ist just the UI missing, right?
Used this info:
http://git.kernel.org/cgit/network/connman/connman.git/tree/doc/config-format.txt

A.Maretzek ( 2016-06-01 00:42:55 +0300 )edit

The UI is not required (apart from the barcode scanning). But with configuration files patching you won't get into harbour.

tortoisedoc ( 2016-06-01 07:37:51 +0300 )edit

I could live - as step 1 - with a working solution in openrepos.

ossi1967 ( 2016-06-01 09:24:44 +0300 )edit
2

answered 2016-05-31 08:06:16 +0300

inta gravatar image

updated 2016-05-31 08:06:38 +0300

There is a native App called CodeReader in the jolla store and Openrepos. It is not integrated into the network settings, but you can copy&paste the QR code content.

edit flag offensive delete publish link more

Comments

@inta I've already scanned my wifi qrcode string with this application but this application does not ask me to connect to this wifi network. If you have an Android phone, try to scan the qrcode picture of a wifi network string (e.g. : WIFI:S:mySSID;T:WPA;P:mfejzjfjjnflzwmjflirhrvmo;H:true;;) with this application and you will understant what I'm looking for

SebM ( 2016-05-31 22:40:13 +0300 )edit

So a command line workaround would be (to enter the password at sudo/devle-su): calling CodeReader from a skript (to get the information into the copy&past buffer), getting the content from the buffer into the environment, and configuring the WLan with sudo (or devel-su) with the values from the environment.

gabs5807 ( 2016-06-01 21:27:41 +0300 )edit
Login/Signup to Answer

Question tools

Follow
2 followers

Stats

Asked: 2016-05-31 02:41:45 +0300

Seen: 1,055 times

Last updated: May 31 '16