Author Topic: More wifi issues and questions  (Read 4720 times)

dbell

  • Newbie
  • *
  • Posts: 44
More wifi issues and questions
« on: December 01, 2013, 11:30:36 am »
I've been trying to run the DigiFi Example sketches, but the DigiX appears to hang part way through initialization.

I opened Examples>DigiFi>Basic, uploaded it, and opened a Monitor window.
It was properly printing the prompt "Enter any key to begin"
Entered a space or period in the text box and hit Send
I get immediate response:
"Starting
start at mode
next
wait for a"

Then it hangs there.
Both before and after sending the start character, I can join the HF-LPB network and access the Settings pages.

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: More wifi issues and questions
« Reply #1 on: December 01, 2013, 11:34:00 pm »
Doh - after I had you reset it to factory default I should have realized it would then be set to the wrong baudrate (which is preset when you get it)

Log into the wifi module
Goto "Other Setting"
Change baudrate to 9600

Save, unplug, plug back in and give that a shot

dbell

  • Newbie
  • *
  • Posts: 44
Re: More wifi issues and questions
« Reply #2 on: December 02, 2013, 06:00:24 pm »
Oh, yeah - much different! Thanks!
Not what I expected from reading the sketch comments, though.
Apparently, all these responses are coming from library functions, as they are clearly not in the main line code.
After a lot of startup text that I can't really tell if it's good or not, it enters a loop, "checking for link build up":

Enter any key to begin
Enter any key to begin
Starting
start at mode
next
wait for a
clear buffer
+ok

+ok

echo off
AT+E

+ok

AT+E

+ok

Check Link
+ok=2WIRE749(C0:83:A:A2:22:9)

OUT
+ok=2WIRE749(C0:83:A:A2:22:9)

+ok

+ok

AT+ENTM

+ok

AT+ENTM

+ok

exit at mode
+ok=2WIRE749(C0:83:A:A2:22:9)

Connected to wifi!
Connect
start at mode
next
wait for a
clear buffer
+ok

+ok

echo off
AT+E

+ok

AT+E

+ok

send client settings
+ok

+ok=TCP,Server,8899,10.10.100.254

+ok

+ok

Checking for link build up
+ok=off

Re-checking for link build up
+ok=off

+ok=off

Re-checking for link build up
+ok=off

+ok=off

Re-checking for link build up
+ok=off

+ok=off
<and infinite loop...>

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: More wifi issues and questions
« Reply #3 on: December 02, 2013, 06:52:29 pm »
Well your wifi is working now!

Debug is on which is why you see all of that - download the newest software update for the DigiX addons and debug messages are off by default - though they can be very handy like this - turn them om/off by commenting/uncommenting #DEFINE DEBUG in DigiFi.cpp file

I'm guessing this is the server example?

If so, it is strange that your IP is set to 10.10.100.254 - on the STA screen (not AP) you should have DHCP selected unless you know a free address and set it to that - 10.10.100.254 is not on your 2wrie749 network which is why the link never builds up.

dbell

  • Newbie
  • *
  • Posts: 44
Re: More wifi issues and questions
« Reply #4 on: December 02, 2013, 09:38:58 pm »
Let's see if I cover it all:
It's the DigiFi Basic example,
// DigiX WiFi module example - released by Digistump LLC/Erik Kettenburg under CC-BY-SA 3.0
// Inspired by HttpClient library by MCQN Ltd.

On the STA screen, I do have DHCP enabled, and it picked a free 2WIRE749 address (192.168.1.96)

The default 10.10.100.254 address is on the AP page.

I'll update the addons, I guess. Probably more changed than just the debug flag!

Thanks...

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: More wifi issues and questions
« Reply #5 on: December 03, 2013, 03:01:47 am »
This ended up being a rather hard to find bug:

When the module is used in client mode for the first time after it has been set to server mode it never builds the link up. The next attempt after unplugging and replugging works because the module has been reset.

So -

I modified the DigiFi library to do a soft reset (and a 3 second delay to allow the module to reset) whenever it detects that the mode was changed from Server to Client

While I was at it - I found another bug with the client mode and fixed it (it wasn't properly checking if that current host was the same as the last) and also added a function to change the debug mode.

Debug is now off by default and calling

wifi.setDebug(true); right after wifi.begin(9600); will turn on the debug messages in the serial monitor


These changes can be found in the newest download:  http://sourceforge.net/projects/digistump/files/DigiXAddons-v06.zip/download

and on github: https://github.com/digistump/DigiFi

dbell

  • Newbie
  • *
  • Posts: 44
Re: More wifi issues and questions
« Reply #6 on: December 03, 2013, 06:01:23 pm »
<DrF>It's alive!!!</DrF>

ServerExample works fine. Basic appears to work, but seems to fail when attempting to send a tweet.

Thanks for all the support!

Dave

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: More wifi issues and questions
« Reply #7 on: December 03, 2013, 09:05:32 pm »
Re: Sending a tweet - you have to get and fill in a ThinkSpeak API code - and set your thingspeak account up for tweeting for it to work.

Thanks for sticking with me while we figured it out!