10:06 pm

Silver
March 10, 2012

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?
11:44 am

Admin
January 18, 2011

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
11:17 pm

Silver
March 10, 2012

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>
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.)
4:17 am

Silver
March 10, 2012

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
10:58 pm

Silver
March 10, 2012

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!
Most Users Ever Online: 166
Currently Online:
24 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
rw950431: 272
Vinod: 240
piajola: 95
turgo: 70
vespapierre: 63
Adarsh_Murthy: 62
Member Stats:
Guest Posters: 1
Members: 8665
Moderators: 1
Admins: 2
Forum Stats:
Groups: 3
Forums: 14
Topics: 1600
Posts: 5760
Newest Members:
Advantagetreeexperts, laundrydaddyuk, techhhelp5, ken, tran, huldacormierModerators: cstapels: 460
Administrators: Hans: 405, lee: 457