Author Topic: wifi questions, where am i choosing the network?  (Read 15735 times)

dbell

  • Newbie
  • *
  • Posts: 44
Re: wifi questions, where am i choosing the network?
« Reply #15 on: December 01, 2013, 11:35:59 am »
A side note:  factoryRestore() doesn't appear to be a "complete" Restore.

#include <DigiFi.h>
DigiFi wifi;

void setup(){
    wifi.begin(9600);
    wifi.startATMode();
    wifi.factoryRestore();
    wifi.endATMode();
}

void loop(){}

After running this and powering, I can (re-) gain access to the Settings pages at 10.10.100.254, as expected.
However, the Runmode page still has STA+AP set STA setup page still contains my home network IP address and password.
\Dave

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: wifi questions, where am i choosing the network?
« Reply #16 on: December 01, 2013, 11:38:45 pm »
Try putting Serial.begin() before the wifi stuff. Currently Serial debugging output for the wifi is turned on by default - so if there is no serial for it to output to it might lock up

Factory restore restores all settings that were set at the factory - any that are blank by default - like STA setup is left in-tact as it wouldn't influence the ability to recover a bricked device.

Blairhadfield

  • Newbie
  • *
  • Posts: 3
Re: wifi questions, where am i choosing the network?
« Reply #17 on: December 02, 2013, 02:10:27 pm »
I've also had some trouble getting the WiFi working - while the script that does the .factoryRestore() DID appear to fix my initial issue with having set a userid and password improperly, the SSID has now changed to HF-LPB, and I cannot actually connect with any device (2PCs, iPhone, iPad) 

Note that I can see the WiFi connection and all devices attempt to connect, but fail after entering the WiFi password that I set.  (If I mis-enter that password, I get a message indicating I've entered a bad password; If I enter the correct password, I get a generic "Unable to connect" message) 

Is there a proper procedure for resetting with the on-board buttons?  I could not see anything on the wiki about that -though there is a note that you can use the pads on the back of the digiX to reset the wifi.  I'm not clear on what to do there, though.

Any help would be greatly appreciated.

Thanks in advance.

**** UPDATE ****

In reading some of the other threads related to WiFi, it appears to me that the factoryRestore() function resets the Baud rate for the WiFi module to 115200 - which means for me that the next time I tried to run the script to reset the WiFi settings, it never actually succeeded -- UNTIL I changed the baud rates within the code to read:

Serial.begin(115200);
wifi.begin(115200);

After doing that, the WiFi completely reset, and I was able to log in to the WiFi again. (Then set the baud rate back to 9600 - so it's compatible with the other example code)

The bottom line for me is that to reset the WiFi module, you have to run the script posted above. It doesn't appear that the reset hardware buttons do anything for the WiFi module -though I'd like to know if anyone has had luck with those for WiFi...

Thanks!

« Last Edit: December 02, 2013, 08:17:38 pm by Blairhadfield »

Blairhadfield

  • Newbie
  • *
  • Posts: 3
Re: wifi questions, where am i choosing the network?
« Reply #18 on: December 02, 2013, 10:05:43 pm »
One additional item I have determined - if you choose an admin user and password that happens to contain an exclamation point (!), this gets stored internally in its url-encoded form (%21).  When  you attempt to log in to the web interface, you have to replace the exclamation point with %21 when typing.

Hopefully that will help someone avoid having to reset the WiFi !

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: wifi questions, where am i choosing the network?
« Reply #19 on: December 03, 2013, 03:01:16 am »
Thanks for coming back and sharing your findings!

The onboard reset button does not reset the module unless you put some solder across the MASTER-RST solder jumper on the bottom.

If you put solder across the Pin 106 jumper instead then you can reset it on demand by doing digitalWire(106,HIGH); delay(100); digitalWire(106,LOW);

dbell

  • Newbie
  • *
  • Posts: 44
Re: wifi questions, where am i choosing the network?
« Reply #20 on: December 03, 2013, 07:41:31 am »
digitalWrite(), perhaps?

sparkyichi

  • Newbie
  • *
  • Posts: 11
Re: wifi questions, where am i choosing the network?
« Reply #21 on: December 09, 2013, 01:13:29 pm »
This worked for me dbell but you would need to change the host to something that would work for you:

Code: [Select]
#include <DigiFi.h>
DigiFi wifi;

void setup()
{
  Serial.begin(9600);
  wifi.begin(9600);

  while(!Serial.available()){
    Serial.println("Enter any key to begin");
    delay(1000);
  }

  Serial.println("Starting");

  while (wifi.ready() != 1)
  {
    Serial.println("Error connecting to network");
    delay(15000);
  } 
 
  Serial.println("Connected to wifi!");
 
//GET request example

  if(wifi.get("testhost","/cgi/test.pl")){
    String body = wifi.body();
    Serial.println(body);
  }
  else{
    Serial.println("error");
 
  }
  wifi.close();
}

void loop()
{
 
}

Not pulling the params but it does both wifi and prints the webpage to the serial console.

Sparky
« Last Edit: December 09, 2013, 01:16:30 pm by sparkyichi »

rdoylebowman

  • Newbie
  • *
  • Posts: 1
Re: wifi questions, where am i choosing the network?
« Reply #22 on: February 22, 2014, 10:02:25 am »
I've been trying to solve this same issue today. factory reset did the job. OP delivers! Thanks.

Surapol

  • Newbie
  • *
  • Posts: 3
Re: wifi questions, where am i choosing the network?
« Reply #23 on: February 26, 2014, 02:01:46 am »
I have 3 digix that I would like to restore wifi factory setting but can't with this code.
#include <DigiFi.h>
DigiFi wifi;
void setup() { 
  Serial.begin(9600);
  while(!Serial.available()){
   Serial.println("Enter any key to begin");
   delay(1000);
  }
  wifi.begin(9600);
  wifi.startATMode();
  wifi.factoryRestore();
  wifi.endATMode();
  Serial.println("Done");
}

void loop() {
  // put your main code here, to run repeatedly:

}
When I press enter the program does not reach Done.

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: wifi questions, where am i choosing the network?
« Reply #24 on: February 26, 2014, 04:53:09 pm »
Have you changed the baudrate on these modules via the web interface?

If so you'll need to change the wifi.begin(9600) accordingly

you can also try putting wifi.setDebug(true); right after the begin statement and post the results form the serial terminal

Surapol

  • Newbie
  • *
  • Posts: 3
Re: wifi questions, where am i choosing the network?
« Reply #25 on: February 26, 2014, 05:11:30 pm »
From my last note, after power down and up I can manage to config the wifi.
To confirm,I have tried yours enable debug with results.
#include <DigiFi.h>
DigiFi wifi;
void setup() { 
  Serial.begin(9600);
  while(!Serial.available()){
   Serial.println("Enter any key to begin");
   delay(1000);
  }
  wifi.begin(9600);
  wifi.setDebug(true);
  wifi.startATMode();
  wifi.factoryRestore();
  wifi.endATMode();
  Serial.println("Done");
}

void loop() {
  // put your main code here, to run repeatedly:

}
The serial terminal results which stuck at the last line indefinitly (wait for a)
Enter any key to begin
Enter any key to begin
Enter any key to begin
start at mode
next
wait for a
After power down and up the config page seem to be unchanged to factory but stay put to my old settings.

Surapol

  • Newbie
  • *
  • Posts: 3
Re: wifi questions, where am i choosing the network?
« Reply #26 on: February 26, 2014, 05:19:33 pm »
I have tried again with wifi.begin(115200) with serial terminal results.
Enter any key to begin
Enter any key to begin
start at mode
next
wait for a
clear buffer
+ok

+ok

echo off
AT+E

+ok

AT+E

+ok

+ok=rebooting...
Now the config restored back to factory settings.
Everythings work ok. Thank you