Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the WifiPage #159

Merged
merged 23 commits into from Nov 12, 2021
Merged

Add the WifiPage #159

merged 23 commits into from Nov 12, 2021

Conversation

HosamHasanRamadan
Copy link
Contributor

related to #20 .
this pull request is a good starting point for the wifi page.
the current features that the page has :

  • toggle wifi on-off
  • connect to access points listed in the UI
  • the page is totally reactive to the wifi adaptor state
  • shows error page when wifi adaptor isn't accessible

Still a lot missing from the page but it is just the start.

@Feichtmeier
Copy link
Member

Thank you very much @HosamHasanRamadan !!!

I test it today

@Feichtmeier
Copy link
Member

@HosamHasanRamadan

Checked out locally:
grafik

Correctly displays connections and wifi strength
But I can not connect to an access point, error is:

[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: org.freedesktop.NetworkManager.UnknownConnection: The device 'wlp0s20f3' has no connections available for activation.
#0      DBusClient._callMethod
<asynchronous suspension>
#1      DBusClient.callMethod
<asynchronous suspension>
#2      NetworkManagerClient.activateConnection
<asynchronous suspension>
#3      WifiModel.connectToAccesPoint
<asynchronous suspension>

@Feichtmeier
Copy link
Member

@Jupi007 could you add more wifi icons for the connection strength in yaru_icons when you have time? :)

@HosamHasanRamadan
Copy link
Contributor Author

ok, I think I know where is the problem.
you can reject this pull request I will make a new one fixing this issue and I will add new features too.
thank you for your feedback.

@Feichtmeier
Copy link
Member

You could also just work on this one if you like :)

@HosamHasanRamadan
Copy link
Contributor Author

I hope it works for you now

@Jupi007
Copy link
Collaborator

Jupi007 commented Nov 2, 2021

@Jupi007 could you add more wifi icons for the connection strength in yaru_icons when you have time? :)

With pleasure @Feichtmeier :)

@Jupi007
Copy link
Collaborator

Jupi007 commented Nov 2, 2021

@Feichtmeier We already have that kind of icons:

Capture d’écran du 2021-11-02 09-51-00

@HosamHasanRamadan Can you replace MdiIcons with YaruIcons please? Here are corresponding names:

  • MdiIcons.wifiStrength(Lock)Outline -> YaruIcons.network_wireless_signal_none(_secure)
  • MdiIcons.wifiStrength1(Lock) -> YaruIcons.network_wireless_signal_weak(_secure)
  • MdiIcons.wifiStrength2(Lock) -> YaruIcons.network_wireless_signal_ok(_secure)
  • MdiIcons.wifiStrength3(Lock) -> YaruIcons.network_wireless_signal_good(_secure)
  • MdiIcons.wifiStrength4(Lock) -> YaruIcons.network_wireless_signal_excellent(_secure)
  • MdiIcons.wifiOff -> YaruIcons.network_wireless_disabled

@HosamHasanRamadan
Copy link
Contributor Author

done

@Jupi007
Copy link
Collaborator

Jupi007 commented Nov 2, 2021

Thanks @HosamHasanRamadan :)

@HosamHasanRamadan
Copy link
Contributor Author

Done

@Feichtmeier
Copy link
Member

Thanks @HosamHasanRamadan
Tested again and more stuff works!

The list of access points is populated with duplicates though, any idea why this happens?

@HosamHasanRamadan
Copy link
Contributor Author

Does it duplicate the access point that you recently connected to through the app or it duplicates all the access points ?

@Feichtmeier
Copy link
Member

Peek 2021-11-04 10-05

No discovered access points in general. Also it only refreshes when you open up gnome control center parallel to this.

@Feichtmeier
Copy link
Member

@HosamHasanRamadan
Copy link
Contributor Author

@HosamHasanRamadan

Take a look at

https://github.com/canonical/ubuntu-desktop-installer/blob/9df535ba41eaa0b77e4dc3ce971710ebc8b7faf9/packages/ubuntu_desktop_installer/lib/pages/connect_to_internet/wifi_model.dart#L166

jpnurmi uses the ListEquality funtion from the collections package, maybe this could help

Do you still have the problem of duplicate access points ?

@Feichtmeier
Copy link
Member

Yes, pulled every commit but still duplications

@HosamHasanRamadan
Copy link
Contributor Author

Ok I will fix today . Later I want to discuss with you that the comparison mechanism using only ssid isn't enough because you may have two access points with same ssid .

@HosamHasanRamadan
Copy link
Contributor Author

Duplicate access points issue is fixed, please check it out @Feichtmeier

@Feichtmeier
Copy link
Member

@HosamHasanRamadan thanks for working so much on this!

Just pulled and rebuild sadly not fixed for me
grafik

Maybe I am doing something wrong. @Jupi007 could you check if you have the same issue?

@HosamHasanRamadan
Copy link
Contributor Author

I can't run the app on my ubuntu virtual machine because of this error , if you know how to solve this error so I could test the app on it

[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Invalid argument(s): Failed to load dynamic library 'libgio-2.0.so': libgio-2.0.so: cannot open shared object file: No such file or directory
#0      _open (dart:ffi-patch/ffi_dynamic_library_patch.dart:11)
#1      new DynamicLibrary.open (dart:ffi-patch/ffi_dynamic_library_patch.dart:20)
#2      gio (package:gsettings/src/gio.dart:9)
#3      new GSettings._new (package:gsettings/src/settings.dart:266)
#4      new GSettings (package:gsettings/src/settings.dart:252)
#5      main (package:settings/main.dart:18)
#6      main (file:///home/hosam/Desktop/ubuntu/settings/.dart_tool/flutter_build/generated_main.dart)
#7      _runMainZoned.<anonymous closure>.<anonymous closure> (dart:ui/hooks.dart:143)
#8      _rootRun (dart:async/zone.dart:1428)
#9      _CustomZone.run (dart:async/zone.dart:1328)
#10     _runZoned (dart:async/zone.dart:1863)
#11     runZonedGuarded (dart:async/zone.dart:1851)
#12     _runMainZoned.<anonymous closure> (dart:ui/hooks.dart:141)
#13     _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:283)
#14     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184)

Screenshot from 2021-11-06 22-09-24
r

@Jupi007
Copy link
Collaborator

Jupi007 commented Nov 6, 2021

Maybe I am doing something wrong. @Jupi007 could you check if you have the same issue?

I'm really sorry @Feichtmeier but I can't test this at all because I don't use Wifi on my desktop, and I don't have any other computer 😔

@HosamHasanRamadan
Copy link
Contributor Author

I am running the release binary of on the app bundle , I think it doesn't need flutter as a runtime dependency.

@Feichtmeier
Copy link
Member

I can't run the app on my ubuntu virtual machine because of this error , if you know how to solve this error so I could test the app on it

[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Invalid argument(s): Failed to load dynamic library 'libgio-2.0.so': libgio-2.0.so: cannot open shared object file: No such file or directory
#0      _open (dart:ffi-patch/ffi_dynamic_library_patch.dart:11)
#1      new DynamicLibrary.open (dart:ffi-patch/ffi_dynamic_library_patch.dart:20)
#2      gio (package:gsettings/src/gio.dart:9)
#3      new GSettings._new (package:gsettings/src/settings.dart:266)
#4      new GSettings (package:gsettings/src/settings.dart:252)
#5      main (package:settings/main.dart:18)
#6      main (file:///home/hosam/Desktop/ubuntu/settings/.dart_tool/flutter_build/generated_main.dart)
#7      _runMainZoned.<anonymous closure>.<anonymous closure> (dart:ui/hooks.dart:143)
#8      _rootRun (dart:async/zone.dart:1428)
#9      _CustomZone.run (dart:async/zone.dart:1328)
#10     _runZoned (dart:async/zone.dart:1863)
#11     runZonedGuarded (dart:async/zone.dart:1851)
#12     _runMainZoned.<anonymous closure> (dart:ui/hooks.dart:141)
#13     _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:283)
#14     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184)

Screenshot from 2021-11-06 22-09-24
r

Try either refreshing the flutter snap from edge or removing it and installing it manually from git and add the path to your bashrc

@Feichtmeier
Copy link
Member

Feichtmeier commented Nov 7, 2021

sudo snap remove flutter

git clone https://github.com/flutter/flutter.git -b master

edit $HOME/.bashrc

Add at the end

export PATH="$PATH:[PATH_OF_FLUTTER_GIT_DIRECTORY]/bin"

Replace the path including the [ ] with the real path to where you've cloned flutter to

@Feichtmeier
Copy link
Member

I am running the release binary of on the app bundle , I think it doesn't need flutter as a runtime dependency.

I don't have your issue running flutter inside vscode or in the bundle.

May I ask why you don't use vscode, vscode flutter extension and a normal flutter installation? :)

@HosamHasanRamadan
Copy link
Contributor Author

I am running the release binary of on the app bundle , I think it doesn't need flutter as a runtime dependency.

I don't have your issue running flutter inside vscode or in the bundle.

May I ask why you don't use vscode, vscode flutter extension and a normal flutter installation? :)

It's my last solution because I run Ubuntu on a virtual machine with limited resources.
I will install flutter on the virtual machine and give it a try before changing the code

@HosamHasanRamadan
Copy link
Contributor Author

Note to self:
I compare between access points using ssid and hwAddress which makes sense to me but the Ubuntu installer pull request uses only ssid for comparison but in a situation when you have two access points with the same ssid only one will be shown .
On the other hand , my solution leads to duplicate access points and I don't know right now where is the source of problem.
If the problem is with the nm library don't forget to report the issue.

@HosamHasanRamadan
Copy link
Contributor Author

HosamHasanRamadan commented Nov 7, 2021

I tested the app on my ubuntu virtual machine and I don't have the issue of the duplicate access points
Screenshot from 2021-11-07 14-41-48

@Feichtmeier
Copy link
Member

Move a bit in your room for changes then ☺️

@HosamHasanRamadan
Copy link
Contributor Author

Move a bit in your room for changes then ☺️

I use Wi-Fi dongle in my pc 😅.
I will change my code to compare between access using ssid only

@HosamHasanRamadan
Copy link
Contributor Author

I am almost sure now that you won't have duplicate access points this time 😅🤞

@Feichtmeier
Copy link
Member

grafik

Yes, now it works! 🥂
Is it ready to merge from your side?

@HosamHasanRamadan
Copy link
Contributor Author

grafik

Yes, now it works! 🥂

Is it ready to merge from your side?

Yes 🙌👍

@Feichtmeier
Copy link
Member

Feichtmeier commented Nov 10, 2021

Edit: no, we remove the test for now, sec

@Feichtmeier Feichtmeier changed the title The starting code base of the Wifi page Add the WifiPage Nov 12, 2021
@Feichtmeier Feichtmeier merged commit 76003b1 into ubuntu-flutter-community:master Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants