Post data to my Thingspeak channel using telnet | ThingSpeak Projects | 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
Post data to my Thingspeak channel using telnet
Avatar
mdce4
New Member
Forum Posts: 2
sp_UserOfflineSmall Offline
1
September 25, 2014 - 11:02 pm
sp_Permalink sp_Print

Is it possible? I'm using telnet on a raspberry pi from the command line, trying to update to my thingspeak channel.
Here is what I did. it gave me a 200 OK response, but no data shows up on my Thingspeak channel:

sudo telnet api.thingspeak.com 80

POST /update HTTP/1.1
Host:api.thingspeak.com
Connection: close
X-THINGSPEAKAPIKEY:2ENL8UUKM3T82Y8J
Content-Type: application/x-www-form-urlencoded
Content-Length:10

field1=241

This is the response i get:

HTTP/1.1 200 OK
Server: nginx/1.7.5
Date: Fri, 26 Sep 2014 02:54:26 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: close
Vary: Accept-Encoding
Status: 200 OK
X-Frame-Options: ALLOWALL
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, PUT, OPTIONS, DELETE, PATCH
Access-Control-Allow-Headers: origin, content-type, X-Requested-With
Access-Control-Max-Age: 1800
ETag: "9bf31c7ff062936a96d3c8bd1f8f2ff3"
Cache-Control: max-age=0, private, must-revalidate
Set-Cookie: request_method=POST; path=/
X-Request-Id: 1b8d5b3b-325e-43df-832a-2fc034561428

2
15
0

Connection closed by foreign host.

After this, i check my Thingspeak channel, but nothing ever shows up there.

Avatar
lee

Forum Posts: 457
sp_UserOfflineSmall Offline
2
September 26, 2014 - 12:41 pm
sp_Permalink sp_Print

Hi,

It looks like your request to ThingSpeak is valid, but the POST data is not being set correctly for field1. I'm not sure how to send the request directly through telnet, but you may have more success using a GET instead of a POST.

You can see the blank values in your Channel here: https://thingspeak.com/channels/14918/feed.json?key=2ENL8UUKM3T82Y8J .

lee

Avatar
mdce4
New Member
Forum Posts: 2
sp_UserOfflineSmall Offline
3
September 28, 2014 - 1:12 pm
sp_Permalink sp_Print

Hi lee,
I had to end up using wireshark to look at the packets that were going out after I did the telnet. It ended up being an extra space in between the content-length and the field data, so the POST data was not being sent correctly. I corrected that and it works now.
thanks for the help

Forum Timezone: America/New_York

Most Users Ever Online: 114

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

candacele1

WilliamBer

roxieob18

Metawatch

ozayagw

ubabeutiti

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

 

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Administrators: Hans, lee