[Ubuntu] Dialog to offer the available Access Points

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
tmacreturns Offline
Junior Member
Posts: 34
Joined: Aug 2011
Reputation: 0
Location: The Netherlands
Post: #1
Hi all,

First, I am not 100% sure that this post belongs here due to its relation to a skin file DialogAccessPoints.xml, but since I am trying to develop/customize my XBMC from the source code, I believe the best fit for this post would be here.

Here's the thing:

As I said, I am personalizing XBMC from source code and running it my Ubuntu 10.04 machine. My goal know is to be able to connect to a Wireless Lan using a wireless dongle, since the native network card does not support wireless connectivity.

I've added in GUISettings.cpp the options necessary to configure the network in Ubuntu, by selecting the interface, DHCP/Static Mode,.... This is done just basically copying the lines AddString(NULL,...) to AddString(net,...).

The problem lays in the case when I try to set up the Wireless, as one of the options when dealing with wireless networks is to select the SSID. When I click here nothing happens and I can never connect to the wireless network. The reason causing this is that it tries to initialize the window DialogAccessPoints.xml, but this file is never found on any of the scripts I've taken a look so far ( which basically are the ones in the official repository).

Therefore, I would like to know whether there is any DialogAccessPoints.xml file available somewhere, or if somebody could give me any kind of guideline on HOW TO create one of my own, I would appreciate it very much.

Thanks in advance
find quote
ronie Offline
Team-XBMC Member
Posts: 8,986
Joined: Jan 2009
Reputation: 147
Post: #2
most likely no one ever made one since these settings aren't being exposed to the gui (yet).

judging by the sourcecode, all the dialog needs is one listcontrol with id="3".

you may be able to get the basics working by making a copy of DialogSelect.xml (it's in the 720p folder of the skin you're using) and rename it to DialogAccessPoints.xml

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not PM or e-mail Team-XBMC members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
spiff Offline
Retired Developer
Posts: 12,386
Joined: Nov 2003
Post: #3
the whole code is "hidden" since what's there require to run xbmc as root, something we really really really do not encourage..
find quote
garbear Offline
Team-XBMC Developer
Posts: 699
Joined: Dec 2010
Reputation: 30
Location: gangsta's paradise
Post: #4
I did a pull request on this topic a while ago, https://github.com/xbmc/xbmc/pull/303. It's not going to be merged yet because, as cptspiff said, you need to be running root for it to do any good. (Reason: On linux, you can read the stale results from a previous scan, but initiating a new scan requires root permission.)

Check out topfs's network_abstraction branch here, https://github.com/topfs2/xbmc/tree/network_abstraction. Before XBMC scans for wifi networks, XBMC will need something like this.
find quote
tmacreturns Offline
Junior Member
Posts: 34
Joined: Aug 2011
Reputation: 0
Location: The Netherlands
Post: #5
First of all, thanks a lot to all of you that replied, you are great help in the development Smile.

I am aware that I need to run XBMC as root to change any network settings, but it is also true that I need to run some "sudo" commands from NetworkLinux.cpp to configure the wireless dongle.

Yesterday, as ronie suggested, I realized that the only necessary thing was to have a list within the DialogAccessPoints.xml with the id=3. Since I just read now ronie's idea, I basically copied the DialogFavourites.xml ( I think this is the file) and changed the list id to 3, so right now it is just working fine the Wireless selection.

Once the Wireless is selected and the password is entered I try to connect to my wireless dongle following the vendor's instructions ( Ralink in this particular case). However, when the Progress dialog "Connecting" finishes, it returns the message that we are not connected to the wireless. This is returned in the function "CNetworkInterfaceLinux::IsConnected" from NetworkLinux.cpp, due to "ifr.ifr_flags & IFF_RUNNING" being zero.

I have to say that at this point, the wireless interface is working as I have an IP and I can browse the Internet. Yet again, the Weather window is not displaying the current weather, as it seems it cannot contact the servers.

Could anyone tell me whether I am missing anything? Thanks in advance!

P.S.> I am not sure this belongs to this thread anymore as it has nothing to do with the XML file anymore, so please feel free to re-locate it or suggest me where to do it Smile
find quote
spiff Offline
Retired Developer
Posts: 12,386
Joined: Nov 2003
Post: #6
missing dns perhaps?
find quote
tmacreturns Offline
Junior Member
Posts: 34
Joined: Aug 2011
Reputation: 0
Location: The Netherlands
Post: #7
spiff Wrote:missing dns perhaps?

I am afraid it is not the reason, as under /etc/resolv.conf I do have DNS obtained after calling the DHCP client. I am afraid it has to do with the Wireless dongle driver. I am certainly connected to the Internet, but XBMC is checking the IFF_RUNNING flag under the wireless network interface, and this is not set, so XBMC detects it as disconnected.

However, thank you spiff for the idea Smile

Yet, if anybody knows how to deal with this flag( either how to set it or a workaround in XBMC) just let me know, please.
find quote
spiff Offline
Retired Developer
Posts: 12,386
Joined: Nov 2003
Post: #8
how about you simple replace the flag check with a true?
find quote
tmacreturns Offline
Junior Member
Posts: 34
Joined: Aug 2011
Reputation: 0
Location: The Netherlands
Post: #9
spiff Wrote:how about you simple replace the flag check with a true?

I did something similar. I just replace the check with IFF_UP, that at least indicates that the interface is not down. Actually,I've read somewhere that there is not much different between these two flags, do this should do the work.

Thanks!
find quote
tmacreturns Offline
Junior Member
Posts: 34
Joined: Aug 2011
Reputation: 0
Location: The Netherlands
Post: #10
Hi all,

Once again I am wondering about this topic, and I hope you could give me a hand if possible Smile.

Now that I´ve defined my own DialogAccessPoints.xml and placed it under the skin.confluence/720p/ folder, I would like that GUIDialogAccessPoints.cpp would fallback into this default skin file whenever it can´t find the XML within the current skin folder. This is happening pretty much always at this time, as no skin is currently offering the DialogAccessPoints.xml file.

Obviously, the option to copy the xml file to every skin folder is not the best option.

I was thinking whether it is possible to have an xml fallback for the skin files as well as for the addons xml´s. Maybe ( and probably) I am missing something very obvious here, but I´ve tried to search in the XBMC wiki and in the Forum, but I´ve got nothing so far.

Any ideas?

Thanks in advance
find quote
topfs2 Offline
Team-XBMC Developer
Posts: 3,962
Joined: Dec 2007
Reputation: 9
Post: #11
https://github.com/topfs2/xbmc/tree/network_abstraction

If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
find quote
tmacreturns Offline
Junior Member
Posts: 34
Joined: Aug 2011
Reputation: 0
Location: The Netherlands
Post: #12
Thanks for your reply topfs2, but I am afraid that project does not solve my problem.

Maybe I should start a new thread, but my problem now is to implement some sort of fallback for the XML files that cannot be found in the current skin.

For instance, if there is not a DialogKeyboard.xml within the current skin, XBMC would fetch the layout from the default skin instead of not loading the Keyboard Dialog. My goal is to have this but for the access points. I think I´ve kinda solved already my issues with the wireless configuration, now I only need to be able to display the access points in every skin I can download.

Thanks
find quote
ronie Offline
Team-XBMC Member
Posts: 8,986
Joined: Jan 2009
Reputation: 147
Post: #13
tmacreturns Wrote:Now that I´ve defined my own DialogAccessPoints.xml and placed it under the skin.confluence/720p/ folder, I would like that GUIDialogAccessPoints.cpp would fallback into this default skin file whenever it can´t find the XML within the current skin folder.

that's something that isn't possible.

tmacreturns Wrote:Obviously, the option to copy the xml file to every skin folder is not the best option.
it is and after copying it, you'll also need to adjust the code to match the skin. :-)

tmacreturns Wrote:I was thinking whether it is possible to have an xml fallback for the skin files as well as for the addons xml´s. Maybe ( and probably) I am missing something very obvious here, but I´ve tried to search in the XBMC wiki and in the Forum, but I´ve got nothing so far.

skin files are not inter-exchangeable, nor can you fallback from one skin to another.

reason is, the code defined in one file depends on (uses) code from a number of other files (Fonts.xml, colors/defaults.xml, includes.xml, defaults.xml and possible several others as well)

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not PM or e-mail Team-XBMC members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
tmacreturns Offline
Junior Member
Posts: 34
Joined: Aug 2011
Reputation: 0
Location: The Netherlands
Post: #14
Thanks for your reply ronie. I was afraid of it, I was thinking of defining a "standard" dialog for the access points, but I guess it would imply to modify quite a lot the source code. However, as far as I understood for defining a dialog you don´t necessarily need to have any include,as if you leave everything to default, only changing the dimension of the font and the containers, that would be enough. Of course, without any image included. Anyway, this would look way too ugly, not compliant with the XBMC standars Smile

Thanks!
find quote
garbear Offline
Team-XBMC Developer
Posts: 699
Joined: Dec 2010
Reputation: 30
Location: gangsta's paradise
Post: #15
tmacreturns,

Do you have a github repo for your work? I've done some work on the wireless portion of xbmc, and I'm interested in following your work as well.
find quote
Post Reply