9 years, 3 months ago.

ssid and password

Quote:

ssid and password

You need to create a simple text file on your mbed root folder named "users.crd". This file should have two text lines in it - the first is the ssid and the second is the password. The easiest way perhaps is to create "users.txt", add the two items and then rename it. This will be read at startup to connect you to the network. Something quite simple, like this:

Tried this but not working, copied the text file (.crd) to both SD and Mbed root.

In the end I manually entered the ssid and password in the WiflyInterface wifly part.

Question relating to:

A sample program demonstrating a small but powerful web server using the Wifly module. This uses several libraries from others, but has a custom version of the WiflyInterface library, with … Dynamic, form, get, pages, post, server, static, Web, WiFly

1 Answer

9 years, 3 months ago.

Hi Paul,

Thanks for testing the instructions! Obviously a bit flawed, so I'll do a quick update. Below should be the fix. I applied these changes and did a compile - but I'm not within reach of a mbed/WiFly pair to test with just now.

Make the following changes:

  1. remove the include for "credentials" - this is an obsolete thing I created.
  2. delete the folder for the credentials .cpp and .h, as they are not being used.
  3. create a file that is like an old Windows .ini file and save it to the local file system. Below are the details:

Code of Interest: Getting the SSID and PASS config

    ...
    INI ini("/local/config.ini");     // handles the credentials

    ...
    if (!ini.ReadString("Wifi", "ssid", ssid, sizeof(ssid))
    ||  !ini.ReadString("Wifi", "pass", pass, sizeof(pass))) {
    ...


The ".ini" file to create and save to the local file system:

Config.ini file

[Wifi]
ssid=your_ssid
pass=your_pass_code

Still no go David. (Not a major issue for me though).

I have:

config.ini

[Wifi]
NETGEAR21
PANASONIC

in my config.ini file on the Mbed (on the root where the MBED.HTM is).

When you get a few minutes could you look at the web pages, icons missing when you go back to main, and pressing the 'try this' on the 'dyn2' , locks it up completely (power cycle to restart). The PDF works well, but the bundled.zip can't find the page. I now this is a demo, but would be nice to try it out properly.

Paul

Just update this comment, the config.ini is exactly as above. I will add the ssid= and try.

Yes working now..... Main page loads (now without icon) but error on every other page, maybe the zip file with pages is out of date?

posted by Paul Staron 01 Feb 2015

ok, so your config file should look like this:

[Wifi]
ssid=NETGEAR21
pass=my password

The Wifly module does not accept spaces, so it will convert "my password" to "my$password".
A good demo should "work", and this one used to. I'll try to get to it later today.

Update from later in the day:

  • Most of the items worked when I installed the program (might be slightly newer, so I'll push my update out). The Get form worked and the POST form did not -
    • I missed an initializer in the constructor, but I see that the GET parameters are unescaped properly, and the POST parameters are not.
  • password protected page presented the dialog, but did not accept the answer.
    • I missed an initializer in the constructor that fixed this.
  • When the graphics don't show up going back to main - this is the single-threaded nature of the Wifly module, and the work-around item I mentioned by using Javascript to delay-load the images.
posted by David Smart 01 Feb 2015