Microcontroller Tweeting


I am trying to send a tweet directly to the Twitter API from my microcontroller. In the documentation for authorizing a request, they give the following example:

POST /1/statuses/update.json?include_entities=true HTTP/1.1
Accept: /
Connection: close
User-Agent: OAuth gem v0.4.4
Content-Type: application/x-www-form-urlencoded
OAuth oauth_consumer_key=“xvz1evFS4wEEPTGEFPHBog”,
Content-Length: 76
Host: api.twitter.com


If i send this information directly to the API (assuming that all the parameters have been changed in the above example use my values and they are correctly calculated), it should post the tweet, right?
For some reason I cannot get this process to work. (Is the API only on https? or is it http also?)


Any help?


Hi Evan,

The API for statuses/update is at both HTTP and HTTPS. What error do you get when you try this (both code, message, and response body)? I would verify that you’re access token (and app) are set to read-write permissions (as opposed to read-only). Also, verify the timestamp calculation on your device – the timestamp should be within 5 minutes or so of our own (which is returned in a Date HTTP header in every response, which you can use to adjust your timestamp on-the-fly if necessary). You may want to remove include_entities=true from the GET-line of the request if the OAuth implementation you’re using isn’t super about organizing the params correctly.


Because this is all done on a microcontroller, i cannot directly see the response. I tried using Wireshark to sniff the packets that were sent and received, but couldn’t find anything.
When calculating the signature the base string example from twitter was:
If trying to use HTTP should the ‘s’ be dropped from “https”?
To connect to twitter, I open a socket to api.twitter.com and then send the POST data described in the first message above but with my values. (I also calculate the signature using my given consumer secret and my access token secret, since this is for individual use and there won’t be any other users. This is an acceptable method, correct?)


and would you be able to tell me how far off a time is from the Twitter server? I am making an NTP request to pool.ntp.org and want to know how far off the time from there is from Twitter’s


Hi Evan,
We have a project from the of the college, about sending a tweet through micro-controller,
It would be nice from you if you could send material and information about what you did.
my Email is:isolimani@gmail.com
Thanks a lot


Hello Evan
I`m interested to do a microcontroller tweeting, but I need some information about the subject, I want to make it in a PIC18f452 MCU If you can help me about it please you send me information to rambal90@gmail.com
thanks a lot