ThingSpeak Twitter - Revisited, Cleaned up.
#1
Posted 16 April 2011 - 05:38 PM
#2
Posted 16 April 2011 - 09:27 PM
Terry Massey
#3
Posted 17 April 2011 - 07:57 AM
#4
Posted 17 April 2011 - 08:05 AM
Hi Omar, thank you to share. How can I create a chanel? I din't found.
Hey nrc,
I will make a few videos to help people out. For now I'll do my best in describing.
1 Log in (https://www.thingspeak.com/login) and click on the 'Channels' link at the top
2 Click the 'Create new Channel' button
3 Fill out the information you wish to enter (lat and log are optional)
4 When done click on the 'Edit Channel' button, that will save it
// done making a channel... to use it do this:
5 Go back to the channels page, select your channel
6 Select your 'Write API Key' and use that to as the 'APIKey' for the class I made.
7. If you wish to send data to field# do this: blah.SendValue(#, "value");
Hope that helps.
#5
Posted 10 May 2011 - 03:13 AM
#6
Posted 10 May 2011 - 05:44 AM
Does your Netduino Plus have an IP address, etc.? You may want to try the SocketClient sample from the .NET MF SDK first...to make sure you're connected correctly.Maybe im doing something wrong? This is my first time using the ethernet on my netduino, just got it today.
If DHCP gives you any issues, static IP is a good fallback position.
Chris
#7
Posted 10 May 2011 - 11:39 PM
Hi tapius,
Does your Netduino Plus have an IP address, etc.? You may want to try the SocketClient sample from the .NET MF SDK first...to make sure you're connected correctly.
If DHCP gives you any issues, static IP is a good fallback position.
Chris
I removed the DHCP setting, the default ip is set to 192.168.5.100
When I try to ping it, i get no response,
I tried to run the SocketClient from the MF SDK and I got:
The thread '<No Name>' (0x2) has exited with code 0 (0x0).
#### Exception System.Net.Sockets.SocketException - CLR_E_FAIL (1) ####
#### Message:
#### Microsoft.SPOT.Net.SocketNative::getaddrinfo [IP: 0000] ####
#### System.Net.Dns::GetHostEntry [IP: 0008] ####
#### SocketClientSample.MySocketClient::ConnectSocket [IP: 0005] ####
#### SocketClientSample.MySocketClient::GetWebPage [IP: 0017] ####
#### SocketClientSample.MySocketClient::Main [IP: 0011] ####
#### SocketException ErrorCode = 11001
#### SocketException ErrorCode = 11001
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in Microsoft.SPOT.Net.dll
#### SocketException ErrorCode = 11001
#### SocketException ErrorCode = 11001
SocketException when connecting to http://www.msn.com/default.aspx.
If your network uses IPSec, you may need enable the port manually
Socket Error Code: 11001
System.Net.Sockets.SocketException
Any Ideas?
#8
Posted 11 May 2011 - 12:16 AM
#9
Posted 11 May 2011 - 02:14 PM
I got it working, I provided the DNS Address and Default Gateway, and its working now. Yay!
Now my new issue:
Connected to ThingSpeak...
HTTP/1.1 400 Bad Request
Server: nginx/0.8.53
Date: Wed, 11 May 2011 00:13:30 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: close
Status: 400
Cache-Control: no-cache
f
Invalid API Key
0
I c/p both keys from respective sites and now it says they are invalid, why?
I can take a look at it... I suggest you change your api key for twitter and also remove it from the thread here to prevent a bot or someone from tweeting in your name. I think I am going to update the code this weekend, I've found improvements i can make. So I will try to get the same error as you and see if I can help.
#10
Posted 14 May 2011 - 01:09 AM
I can take a look at it... I suggest you change your api key for twitter and also remove it from the thread here to prevent a bot or someone from tweeting in your name. I think I am going to update the code this weekend, I've found improvements i can make. So I will try to get the same error as you and see if I can help.
Yeah, good point, Thanks. I think i'll probably still use the same keys anyway.. tltr; (too lazy to (re)register)
#11
Posted 14 May 2011 - 07:44 PM
Yeah, good point, Thanks. I think i'll probably still use the same keys anyway.. tltr; (too lazy to (re)register)
Well I hope you aren't too lazy to press a button :
newkey.PNG 10.61KB 16 downloads
#12
Posted 15 May 2011 - 10:13 PM
I c/p both keys from respective sites and now it says they are invalid, why?
Alright I dont know what caused your issue, but I updated the code... Test it out and if it doesnt work we'll go from there. If you go to my twitter you'll see my tweet that I sent a little ago using the new code. Here is my output...
EDIT: It seems your API key was wrong somehow. I made a public netduino twitter bot:
http://twitter.com/#!/NetTweetBot
This is the API I set up for it: E3MXW8V95ZEO6QTQ
Try: new Thingspeak("", "E3MXW8V95ZEO6QTQ");
Leave the channel key as "" if you will only send tweets.
Using:
TS.SendTweet("Updated @netduino @ThingSpeak twitter class. 'tis a bit cleaner, hope it works for you! [Sent from N+]");
HTTP/1.1 200 OK
Server: nginx/0.8.53
Date: Sun, 15 May 2011 22:12:55 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: close
Vary: Accept-Encoding
Status: 200
ETag: "c4ca4238a0b923820dcc509a6f75849b"
Cache-Control: max-age=0, private, must-revalidate
1
1
0
...disconnected.
#13
Posted 16 May 2011 - 06:50 PM
Alright I dont know what caused your issue, but I updated the code... Test it out and if it doesnt work we'll go from there. If you go to my twitter you'll see my tweet that I sent a little ago using the new code. Here is my output...
EDIT: It seems your API key was wrong somehow.
Awesome, I will check it out again tonight, thanks for the help
#14
Posted 18 May 2011 - 03:04 AM
#15
Posted 18 May 2011 - 07:00 PM
#16
Posted 18 May 2011 - 08:43 PM
@OZ Where do you have to updated code? I will add a link on the tutorials page.
Ah.. I forgot to fix link, sorry about that. here it is: http://oz.heliohost....ith-thingspeak/
Thanks for linking!
#17
Posted 18 May 2011 - 08:45 PM
FYI - i got it to work, i did something silly probably from not reading things through, the reason the API key didn't work was because it was directly a Twitter API key, not one generated via ThingSpeak. Once I generated a thingspeak(twitter) api key it worked flawlessly
Good to hear! You can get the new code here: http://oz.heliohost....ith-thingspeak/ (i forgot to fix the link up there...) and that might be smaller than my old code, by a byte or two . Have fun
#18
Posted 02 January 2014 - 07:32 PM
Here is a post on my blog: http://oz.heliohost....ith-thingspeak/ I plan to make a nice video of it sometime soon, I'll post it here when I do. I like ThingSpeak a lot so I think that I will be making more projects that use this service. If you guys have any requests feel free to ask via reply, and I'll see what I can do. *Updated and cleaned up the code. Please test and let me know if you encounter any bugs.
Can't find on your site. is it still there?
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users