Gainspan WiFi | Microcontrollers | Forum

Avatar

Please consider registering
Guest

Search

— Forum Scope —






— Match —





— Forum Options —





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

Register Lost password?
sp_Feed sp_TopicIcon
Gainspan WiFi
Avatar
dexterindustries

Silver
Forum Posts: 6
sp_UserOfflineSmall Offline
1
March 10, 2012 - 10:06 pm
sp_Permalink sp_Print

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?
 
Avatar
Hans
Natick, MA

Forum Posts: 390
sp_UserOfflineSmall Offline
2
March 11, 2012 - 11:44 am
sp_Permalink sp_Print

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
Avatar
dexterindustries

Silver
Forum Posts: 6
sp_UserOfflineSmall Offline
3
March 11, 2012 - 11:17 pm
sp_Permalink sp_Print

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>
Avatar
Hans
Natick, MA

Forum Posts: 390
sp_UserOfflineSmall Offline
4
March 12, 2012 - 2:38 am
sp_Permalink sp_Print

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.)

Avatar
dexterindustries

Silver
Forum Posts: 6
sp_UserOfflineSmall Offline
5
March 12, 2012 - 4:17 am
sp_Permalink sp_Print

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

Avatar
Hans
Natick, MA

Forum Posts: 390
sp_UserOfflineSmall Offline
6
March 14, 2012 - 7:39 am
sp_Permalink sp_Print

Sounds like a cool project/product.

Try "field1=19" in the post body.

Avatar
dexterindustries

Silver
Forum Posts: 6
sp_UserOfflineSmall Offline
7
March 17, 2012 - 10:58 pm
sp_Permalink sp_Print sp_EditHistory

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!

Avatar
zeke
New Member
Forum Posts: 1
sp_UserOfflineSmall Offline
8
May 12, 2013 - 12:36 am
sp_Permalink sp_Print sp_EditHistory

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.

Avatar
Hans
Natick, MA

Forum Posts: 390
sp_UserOfflineSmall Offline
9
May 14, 2013 - 4:09 pm
sp_Permalink sp_Print

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

Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online:
24 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 252

Vinod: 164

cstapels: 96

piajola: 75

vespapierre: 63

Adarsh_Murthy: 59

Newest Members:

dannymm1

KamorkasOr

GRV2903

Jusikaclaiz

Raymondpoers

ScottDus

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

 

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Administrators: Hans, lee