Named my RPi 512MB @jerpi_bilbo

To keep our multiple Raspberry Pi boards apart from each other, I've now named my RPi Model B w/512MB: "jerpi_bilbo", which stands for Java Embedded Raspberry Pi - Bilbo (named after the Hobbit from the J.R.R. Tolkien stories).

I also, set up a Twitter account for him. You can follow him at: @jerpi_bilbo

He's self-tweeting, manual prompted so far (using Java Embedded 7.0 and twitter4j Java library). Works great! I'm setting him up to be automated self-tweeting soon, so watch for that...

Here's a pointer to the open source twitter4j Java library: download here Just unzip and extract out the twitter4j-core-2.2.6.jar and put it on your Java Embedded classpath.

Here's how @jerpi_bilbo uses it to Tweet with his Java Embedded runtime:

import twitter4j.*;
import java.io.*

public final class Tweet {

    public static void main(String[] args) {
        String statusStr = null;
        if ((args.length > 0) && (args[0] != null)) {
          statusStr = args[0];
        } else {
          statusStr = new String("Hello World!");
        }

        // Create new instance of the Twitter class
        Twitter twitter = new TwitterFactory().getInstance();
        try {
           Status status = twitter.updateStatus(statusStr);
           System.out.println
             ("Successfully updated the status to: " + 
               status.getText());
        } catch (Exception e) {
           e.printStackTrace();
        }
    }
}

That's all you need. Java Embedded rocks the RPi! And, @jerpi_bilbo is alive...

Comments:

Nice. Looking forward for his tweets. Also waiting to see you doing other applications with RPi and Java Embd.

Posted by Vinoth on October 26, 2012 at 10:23 AM PDT #

Thanks, Vinoth. It seems the jerpi_bilbo RPi device is already taking on a life of his own. As soon as I automated his tweets with a cron job running Java Embedded, I'm not sure what will happen... ;-)

Posted by Hinkmond Wong on October 26, 2012 at 11:10 AM PDT #

I am following him in twitter!!!

Posted by Vinoth on October 27, 2012 at 09:00 AM PDT #

Post a Comment:
Comments are closed for this entry.
About

Hinkmond Wong's blog on making the Internet of Things (IoT) smarter with Java Technologies

Search

Archives
« July 2015
SunMonTueWedThuFriSat
   
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
21
22
23
25
26
28
29
30
31
 
       
Today