esp8266 send data my thingspeak HTTP parse error | GitHub Installation | 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
esp8266 send data my thingspeak HTTP parse error
No permission to create posts
May 23, 2015
5:00 pm
Avatar
jaty
New Member
Members
Forum Posts: 1
Member Since:
May 23, 2015
sp_UserOfflineSmall Offline

HI !
Lee
Thank for your ThingSpeak ,I have run successfully.
my esp8266 sends data to api.thingspeak.com is ok,
but sends data to my ThingSpeak is Error CryCryCry

Like:
=======================================================
2015-05-24 04:35:14 +0800: HTTP parse error, malformed request (): #
2015-05-24 04:35:14 +0800: ENV: {"rack.version"=>[1, 2], "rack.errors"=>#<IO:>, "rack.multithread"=>true, "rack.multiprocess"=>false, "rack.run_once"=>false, "SCRIPT_NAME"=>"", "CONTENT_TYPE"=>"text/plain", "QUERY_STRING"=>"", "SERVER_PROTOCOL"=>"HTTP/1.1", "SERVER_SOFTWARE"=>"2.9.1", "GATEWAY_INTERFACE"=>"CGI/1.2", "REQUEST_METHOD"=>"GET"}
=====================================================

My Arduino Source Code:
====================================================
// TCP connection
String cmd = "AT+CIPSTART=\"TCP\",\"";
cmd += "119.28.5.178";
cmd += "\",3000";
Serial.println(cmd);

if(Serial.find("Error")){
dbgSerial.println("AT+CIPSTART error");
return;
}

// prepare GET string
String getStr = "GET http://119.28.5.178/update?key=TYYDY6N5NE3RIQ6G&field1=";
getStr += String(strTemp);
getStr += "

";

// send data length
cmd = "AT+CIPSEND=";
cmd += String(getStr.length());
Serial.println(cmd);

if(Serial.find(">")){
Serial.print(getStr);
dbgSerial.print(getStr);
}
else{
dbgSerial.println("AT+CIPCLOSE");
// alert user
Serial.println("AT+CIPCLOSE");
}

// thingspeak needs 15 sec delay between updates
delay(16000);
============================================

Waiting for your help!Embarassed

August 14, 2015
11:27 am
Avatar
alatza
New Member
Members
Forum Posts: 4
Member Since:
July 28, 2015
sp_UserOfflineSmall Offline

ThingSpeak is awesome!!!
But same problem here!

I am running ESP8266 as an Arduino. Code works perfectly with "api.thingspeak.com" but returns the same error with my TS server in EC2 Amazon/Ubuntu.

I thought it could be the port. Tried to change the server to listen on port 80, but then the error is:

Puma 2.12.3 starting...
* Min threads: 0, max threads: 16
* Environment: development
* Listening on tcp://0.0.0.0:80
Exiting
/home/ubuntu/.rvm/gems/ruby-2.1.0@thingspeak/gems/puma-2.12.3/lib/puma/binder.rb:231:in `initialize': Permission denied - bind(2) for "0.0.0.0" port 80 (Errno::EACCES)
from /home/ubuntu/.rvm/gems/ruby-2.1.0@thingspeak/gems/puma-2.12.3/lib/puma/binder.rb:231:in `new'
from /home/ubuntu/.rvm/gems/ruby-2.1.0@thingspeak/gems/puma-2.12.3/lib/puma/binder.rb:231:in `add_tcp_listener'
from (eval):2:in `add_tcp_listener'
from /home/ubuntu/.rvm/gems/ruby-2.1.0@thingspeak/gems/puma-2.12.3/lib/rack/handler/puma.rb:33:in `run'
from /home/ubuntu/.rvm/gems/ruby-2.1.0@thingspeak/gems/rack-1.5.5/lib/rack/server.rb:264:in `start'
from /home/ubuntu/.rvm/gems/ruby-2.1.0@thingspeak/gems/railties-4.0.5/lib/rails/commands/server.rb:84:in `start'
from /home/ubuntu/.rvm/gems/ruby-2.1.0@thingspeak/gems/railties-4.0.5/lib/rails/commands.rb:76:in `block in '
from /home/ubuntu/.rvm/gems/ruby-2.1.0@thingspeak/gems/railties-4.0.5/lib/rails/commands.rb:71:in `tap'
from /home/ubuntu/.rvm/gems/ruby-2.1.0@thingspeak/gems/railties-4.0.5/lib/rails/commands.rb:71:in `'
from bin/rails:4:in `require'
from bin/rails:4:in `'

August 14, 2015
11:49 am
Avatar
alatza
New Member
Members
Forum Posts: 4
Member Since:
July 28, 2015
sp_UserOfflineSmall Offline

jaty,

It works now!

I followed this solution: http://community.thingspeak.com/forum/installation/http1-1-400-bad-request/

Started the server with Webricks: 'rails server webrick', and everything is fine.

Thanks lee! 🙂

Forum Timezone: America/New_York

Most Users Ever Online: 166

Currently Online:
13 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:

khanhNguyen_CT, susyburr, quijano__, meosuckhoe, briskpanda, Dejw0089

Moderators: cstapels: 460

Administrators: Hans: 405, lee: 457