Gainspan WiFi | Microcontrollers | Forum

Avatar

Please consider registering
Guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —






— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
Gainspan WiFi
No permission to create posts
March 10, 2012
10:06 pm
Avatar
dexterindustries

Silver
Members
Forum Posts: 6
Member Since:
March 10, 2012
sp_UserOfflineSmall Offline

I'm getting the same problem.  I'm not using Arduino, I'm using a Gainspan wifi module.  

 

I send the following:

AT+NCTCP=184.106.153.149,80

CONNECT 0

OK
0
0
POST /update HTTP/1.1
Host: api.thingspeak.com
Connection: close
X-THINGSPEAKAPIKEY:V*KEY*KEY*B
Content-Type: application/x-www-form-urlencoded
Content-Length: 10

sensor1,19OO
 
The response I get is:
 
S0HTTP/1.1 301 Moved Permanently
Server: nginx/0.8.53
Date: Sun, 11 Mar 2012 03:02:29 GMT
Content-Type: text/html
Location: https://www.thingspeak.com/
Content-Length: 185
Connection: close

<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/0.8.53</center>
</body>

</html>
E
DISCONNECT 0
When I use a webbrowser to try to enter data, I have no problems.  However, when I'm connected via the module, I get this error.
 
Any ideas what could be wrong here?
 
March 11, 2012
11:44 am
Avatar
Hans
Natick, MA

Admin
Forum Posts: 396
Member Since:
January 18, 2011
sp_UserOnlineSmall Online

I have seen this issue with certain TCP/IP stacks.

Try using HTTP 1.0 in the request and let me know if that works. If not, I will keep digging.

---

 

Also, just to confirm, I've looked up the DNS with the same module.  The response I get for api.thingspeak.com

0
AT+DNSLOOKUP=api.thingspeak.com
184.106.153.149
March 11, 2012
11:17 pm
Avatar
dexterindustries

Silver
Members
Forum Posts: 6
Member Since:
March 10, 2012
sp_UserOfflineSmall Offline

Thanks Admin!

I tried sending 1.0 and received the same response:

 

POST /update HTTP/1.0
Host: api.thingspeak.com
Connection: close
X-THINGSPEAKAPIKEY:VF*KEY*KEY*B
Content-Type: application/x-www-form-urlencoded
Content-Length: 10

sensor1,19OOS0HTTP/1.1 301 Moved Permanently
Server: nginx/0.8.53

Date: Mon, 12 Mar 2012 04:14:00 GMT
Content-Type: text/html
Location: https://www.thingspeak.com/
Content-Length: 185
Connection: close

<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/0.8.53</center>
</body>
</html>
March 12, 2012
2:38 am
Avatar
Hans
Natick, MA

Admin
Forum Posts: 396
Member Since:
January 18, 2011
sp_UserOnlineSmall Online

Okay, it's not the HTTP 1.1 thing.

Are you posting, "sensor1,19OO"? That might be the issue. You need to post, "field1=1900".

Since the update is wrong, the API is forwarding you to the website. I will look into a more verbose error for this situation.

Let us know if that helps.

(PS. We would be interested in hearing more about your project. I don't have any experience with Gainspan, so it would be helpful.)

March 12, 2012
4:17 am
Avatar
dexterindustries

Silver
Members
Forum Posts: 6
Member Since:
March 10, 2012
sp_UserOfflineSmall Offline

Hans,

 

Thanks!  I really appreciate the help with this.  

Sorry for the confusion: the "OO" I'm seeing is the modules response to the escape sequences sent to the module over the serial line.  The first O is really an <esc>O (ok response for entering the escape sequence) and then another <esc>O (ok response for exiting the escape sequence).  

 

To be clear, there is no <CRLF> after the data entered (the data being entered is sensor1,19).

 

I would be more than happy to share my code and any of the other problems we encounter.  I'm working on a program for our LEGO MINDSTORMS sensor, the WIFI sensor:  http://www.dexterindustries.com/wifi.html

March 14, 2012
7:39 am
Avatar
Hans
Natick, MA

Admin
Forum Posts: 396
Member Since:
January 18, 2011
sp_UserOnlineSmall Online

Sounds like a cool project/product.

Try "field1=19" in the post body.

March 17, 2012
10:58 pm
Avatar
dexterindustries

Silver
Members
Forum Posts: 6
Member Since:
March 10, 2012
sp_UserOfflineSmall Offline

Problem solved!  Thanks for your help with this.

 

The problem was really dropped bytes from the LEGO MINDSTORMS NXT to the wifi module.  This has been corrected and I will be releasing the example code a little later in the week, on our blog:  http://www.dexterindustries.com/blog

 

One quick tip for everyone:  I used a program called Fiddler to test HTML POST data.  The program allows you to rapidly try different formats.  It gives very detailed information, including hex code, on the message and response.  

 

THANKS!

May 12, 2013
12:36 am
Avatar
zeke
New Member
Members
Forum Posts: 1
Member Since:
May 12, 2013
sp_UserOfflineSmall Offline

I realize that this topic is old but this is what I know.

The escape o is the gainspan module telling you that its transmit buffer is full. The buffer is only 4k bytes in size.

You will have to stop pushing data into the module if you get it.

May 14, 2013
4:09 pm
Avatar
Hans
Natick, MA

Admin
Forum Posts: 396
Member Since:
January 18, 2011
sp_UserOnlineSmall Online

Thanks for the extra input - it is good to know.

Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online: Hans, agrisensezm
37 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 261

Vinod: 196

piajola: 85

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

Newest Members:

Archieter, JamesExedo, IrbosHich, brodi, kasko, franklin castro

Administrators: Hans: 387, lee: 457