How to find the Port No for my Channel? | ThingSpeak API | 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
How to find the Port No for my Channel?
Avatar
arvimg

Silver
Forum Posts: 5
sp_UserOfflineSmall Offline
1
February 24, 2017 - 5:37 am
sp_Permalink sp_Print

I am developing code to send data from my firmware using LPC2387 with ARM 7 to thingspeak. Can anyone suggest me the code text I need to put in ARM development platform to do the same.

Avatar
donaldp

Silver
Forum Posts: 5
sp_UserOfflineSmall Offline
2
February 24, 2017 - 10:34 am
sp_Permalink sp_Print

I suppose you will developing application code on top of RTOS or some other operation environment ...?

Personally I prefer http (port=80) POST, which requires just a TCP socket you get from the runtime and some string manipulation, either from the runtime or your dev environment.

Example - the double dots .. is string concatenation in my environment (LUA)

socket:connect(80,"api.thingspeak.com")

socket:send(
"POST /update?api_key=" .. thingspeak_channel_api_write_key ..
"&" .. thingspeak_field .. "=" .. fielddata ..
" HTTP/1.1
" ..
"Host: api.thingspeak.com
" ..
"Connection: close
" ..
"Accept: */*
" ..
"User-Agent: Mozilla/4.0 (compatible; esp8266 Lua; Windows NT 5.1)
" ..
"
")

Hint: plenty other methods exist to feed data into thingspeak: https://www.mathworks.com/help/thingspeak/channels-and-charts-api.html 

Avatar
donaldp

Silver
Forum Posts: 5
sp_UserOfflineSmall Offline
3
February 24, 2017 - 10:37 am
sp_Permalink sp_Print

grr, the poster mangled the example, the -quote double dot- sequence belongs to the line above ...

Avatar
arvimg

Silver
Forum Posts: 5
sp_UserOfflineSmall Offline
4
February 27, 2017 - 6:19 am
sp_Permalink sp_Print

This link ain't getting anything.

Yeah I guess this should be the outline of the approach

  • create a socket
  • lookup the IP address
  • open the socket
  • send the request
  • wait for the response
  • close the socket

I'm new to this and confused on developing an approach. Could you write the code lines for ARM Development environment, like Keil etc. Would be helpful.

Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online:
25 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 250

Vinod: 152

piajola: 74

vespapierre: 63

cstapels: 60

Adarsh_Murthy: 59

Newest Members:

bharad

mikebradley

gilloliver

chputney

fibula

namansahore

Forum Stats:

Groups: 4

Forums: 17

Topics: 1261

Posts: 4400

 

Member Stats:

Guest Posters: 1

Members: 5588

Moderators: 0

Admins: 2

Administrators: Hans, lee