Author Topic: Server address corruption?  (Read 3396 times)

jdubrow

  • Newbie
  • *
  • Posts: 9
Server address corruption?
« on: February 05, 2014, 08:21:59 am »
I was trying to run the ServerExample code, which has this:

 Serial.println("Connected to wifi!");
  Serial.print("Server running at: ");
  String address = wifi.server(8080);//sets up server and returns IP
  Serial.println(address);


But when I run I receive this as output:

Connected to wifi!
Server running at: c

Any idea why the IP address is not working correctly?

armband

  • Newbie
  • *
  • Posts: 12
Re: Server address corruption?
« Reply #1 on: February 05, 2014, 04:52:57 pm »
An obvious question worth stating ... Did you follow the step-by-step WiFi setup instructions on the Digix Wiki? Can you access the Digix WiFi module's management page from a web browser running on a machine in your network?

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: Server address corruption?
« Reply #2 on: February 05, 2014, 05:36:14 pm »
and if yes to all of that - have you tried the server example?

if yes to that try putting wifi.setDebug(true); after wifi.begin() and post the results of the serial window

jdubrow

  • Newbie
  • *
  • Posts: 9
Re: Server address corruption?
« Reply #3 on: February 08, 2014, 05:20:39 pm »
I can access the device from the web page, plus I can talk to my program via the web....  here is the output from the serial logger around this code:

Quote
Connected to wifi: web!
Server running at: start at mode
next
wait for a
clear buffer
+ok

+ok

echo off
AT+E

+ok

AT+E

+ok

+ok

+ok=static,10.0.0.84,255.255.255.255,10.0.0.1

+ok

+ok

AT+ENTM

+ok

AT+ENTM

+ok

exit at mode
c

jdubrow

  • Newbie
  • *
  • Posts: 9
Re: Server address corruption?
« Reply #4 on: February 08, 2014, 05:24:37 pm »
I wonder if I had an old version of the code, but I updated DigiFi.cpp to this and it seems to work now, the first substring was for 9 not 11.

Quote
String DigiFi::server(int port){
  startATMode();
  setNetParams("TCP","SERVER",port,"127.0.0.1");
  //setTCPConn("On"); //is this needed?
  String response = getSTANetwork();
  response = response.substring(11);
  response = response.substring(0,response.indexOf(","));
  endATMode();
  return response;
}