source code that sets up wifi connection

When you go to http://192.168.240.1 (the Yun IP) one is presented with a page where you can join a network.
The source code behind that is where in github? is it lua? or ??? does anyone have a link?
thanks. sorry about the emoticon - don't know how that got in there

rret:
When you go to http://192.168.240.1 (the Yun IP) one is presented with a page where you can join a network.
The source code behind that is where in github? is it lua? or ??? does anyone have a link?
thanks. sorry about the emoticon - don't know how that got in there

rret,
The source code is on your Yun. It's all open source. The server is called uhttpd. The CGI that runs the page you see is run by LuCI. There is code on github, which code do you want that is not on your Yun? The webserver, the CGI, Lua?

Jesse

rret:
one is presented with a page where you can join a network.

Just a bit of pedantic semantics: the code configures the wireless network connection parameters, it does not actually join the wireless network. Joining happens after a restart, as part of the normal boot process, using those configuration parameters

You may already know this, and you may just be wanting to look at the code out of programming curiosity. But if you are trying to write code to actively change the connection at run time, the difference becomes important and looking at that code may or may not be helpful.

What are you actually trying do? Maybe there's a better way.

sorry about the emoticon - don't know how that got in there

It appears there because you used three question marks in a row. The forum software sees that and substitutes a confused face emoticon. There are a lot of different shorthand sequences for triggering a smiley. When in the posting editor, try clicking on a few of the emoticons and see what text gets entered into the edit box.

i'm assuming that the code that configures changes some files such as network and wireless.
i'm interested in that source code. can you tell me where to find that in github? thanks.

This is the lua code used to set the wireless configuration

Here is the function

And here the specific wireless configuration

rret:
i'm assuming that the code that configures changes some files such as network and wireless.
i'm interested in that source code. can you tell me where to find that in github? thanks.

@Angelo9999, I think this person means the config files, and not the code.

@rret, the files on the Yun that hold the network and wireless are

  • /etc/config/network
  • /etc/config/wireless

Note it is easier to change these files via the web panel instead of directly.

Please let us know if this helps.
Jesse

jessemonroy650:
@rret, the files on the Yun that hold the network and wireless are

  • /etc/config/network
  • /etc/config/wireless

Just an idea, if the goal is to programmatically switch between two or more pre-defined settings, I've had good luck with saving several a versions of these configuration files. When it's time to switch, stop the appropriate network, copy the desired version of the file into place, then start networking again. Much easier than trying to make changes to the files each time (but only works if the different sets of settings are known ahead of time.)

ShapeShifter:
Just an idea, if the goal is to programmatically switch between two or more pre-defined settings, I've had good luck with saving several a versions of these configuration files. When it's time to switch, stop the appropriate network, copy the desired version of the file into place, then start networking again. Much easier than trying to make changes to the files each time (but only works if the different sets of settings are known ahead of time.)

Yes ShapeShifter,
that's usually a great strategy. However, a little extra caution must be taken.

FWIW: as you know I've been going through the bootup and startup files. In particular, when using the LuCi and UCI the final configuration files will get written and any comments inside those configuration files will be lost.

To be clear,

  • save the original
  • save the live configuration
  • save each intermediate

And be aware that using the UCI or LuCI will wipe out the live configuration file

Jesse

jessemonroy650:
To be clear,

  • save the original
  • save the live configuration
  • save each intermediate

Good point. I'm doing basically that, but should've been explicit.

I'm not sure of the benefit of #2 (or what you mean by it.) I assume you mean the current /etc/config/wireless, for example. If you saved the original, and saved each custom version, and the live version is always a copy of one of these, what's the point in saving the live version? It will always be a copy of one of the saved files (or perhaps a stripped down version which is definitely not worth saving.)