[twitter-dev] oauth and embedded microcontrollers

228 views
Skip to first unread message

Mr Blog

unread,
May 11, 2010, 7:14:50 PM5/11/10
to Twitter Development Talk
I have a device that tweets using the API. It is a microcontroller
that is hooked to garage doors http://www.toyz.org/GarageBot

http://www.toyz.org/images/GarageBot_sm.jpg

It is a small box mounted on the wall in the garage as shown in the
photo. Unlike a full PC, it has no hard drives and draws very little
power. There is no screen or keyboard. All interaction is via the net.
Plug it in and it boots and starts doing its thing. You don’t need to
think about it. I added LEDs to provide some indication that the
device was running.

oAuth is a big burden for microcontroller based devices like this -
OAuthcalypse will probably simply kill this app. It seems like way
too much overhead to push oAuth code into this little chip. oAuth
alone would probably exceed all the rest of the application code on
the device combined.

It's too bad Twitter doesn't provide a way for the user to authorize
Basic Auth for their own Twitter ID under certain terms, or some other
lightweight Twitter API option.

By forcing oAuth, Twitter has substantially raised the bar for API
interaction and particularly for embedding Twitter into lightweight
devices.

Twitter used to be a uniqely lightweight API - not anymore.

glenn gillen

unread,
May 12, 2010, 5:03:54 AM5/12/10
to Twitter Development Talk
> oAuth is a big burden for microcontroller based devices like this -
> OAuthcalypse will probably simply kill this app.  It seems like way
> too much overhead to push oAuth code into this little chip.  oAuth
> alone would probably exceed all the rest of the application code on
> the device combined.

I couldn't find anything on the blog or the related sites given
examples of the code being used to run this GarageBot other than it
was running on uClinux. What code/libraries (if any) are you presently
using to connect to the API?

The curl guys are working on building oauth support direct into curl,
so that should provide a fallback for these kind of apps. You could
probably use curl now provided you had a way of generating the
oauth_nonce parameter (http://oauth.net/core/1.0a/#auth_header).

If you could divulge a little more about your setup, and what kind of
constraints you have to work within, we might be lucky enough to have
someone in this group that can think of a solution.
--
Glenn Gillen
http://glenngillen.com/

John Kalucki

unread,
May 12, 2010, 10:35:16 AM5/12/10
to twitter-deve...@googlegroups.com
Why not have the controller proxy through a full-featured webserver
that can oAuth in to Twitter?

-John Kalucki
http://twitter.com/jkalucki
Infrastructure, Twitter Inc.

Mr Blog

unread,
May 14, 2010, 1:51:29 PM5/14/10
to Twitter Development Talk
Thanks. As I note, that is a non-trivial project/barrier.

FWIW, I'm putting together a generic service for this application,
where a user can oAuth to the site and then create "proxy" credentials
that can be used to tweet etc.

http://www.supertweet.net/

Feedback welcome.

On May 12, 7:35 am, John Kalucki <j...@twitter.com> wrote:
> Why not have the controller proxy through a full-featured webserver
> that can oAuth in to Twitter?
>
> -John Kaluckihttp://twitter.com/jkalucki

Mr Blog

unread,
May 14, 2010, 1:58:27 PM5/14/10
to Twitter Development Talk

Hi Glenn,

FWIW, the application and platform is extremely small and lightweight
- there is nothing as powerful or huge as 'curl' there. It is all raw
C code, stripped down libraries, etc. measured in K-bytes, not
Megabytes, to say nothing of Gigabytes.

For example, the current 'tweet' code binary is 18K bytes. If you can
add oAuth in 100K bytes or less, that might work, but that one
function would then still be bigger than the entire rest of the
application. In fact, the entire file system ROM image, with all the
binaries and data is 114K bytes.

Brian Smith

unread,
May 14, 2010, 2:13:29 PM5/14/10
to twitter-deve...@googlegroups.com
Mr Blog wrote:
> For example, the current 'tweet' code binary is 18K bytes. If you can add
oAuth
> in 100K bytes or less, that might work, but that one function would then
still be
> bigger than the entire rest of the application. In fact, the entire file
system ROM
> image, with all the binaries and data is 114K bytes.

How large is your TLS stack and root CA certificate database?

Regards,
Brian

Mr Blog

unread,
May 16, 2010, 1:01:26 AM5/16/10
to Twitter Development Talk
Brian, there is no TLS or root CA certificates on this platform. No
browser. No X11. No screen or keyboard for that matter.
Reply all
Reply to author
Forward
0 new messages