Installation - Audiodroid/batsignal GitHub Wiki
This describes how to set up the whole project.
java/eclipse
- open eclipse and create a new, empty java project with a name you like ;-)
- for Windows: Must install 32bit Java as rxtx libraries only available in 32bit for Windows.
twitter4j
-
create a file called "twitter4j.properties" in the eclipse project root directory, hit F5 in the "Project Explorer" and make sure you see the file listed
-
click on the file and edit the file like this, use the keys from you twitter account:
debug=true
oauth.consumerKey=01234567890abcdefghi
oauth.consumerSecret=01234567890abcdefghijklmnopqrstuvwxyz01234
oauth.accessToken=01234567890abcdefghijklmnopqrstuvwxyz01234567890ab
oauth.accessTokenSecret=01234567890abcdefghijklmnopqrstuvwxyz012345
- right-click on your project name in the "Project Explorer" => "Build Path" => " Configure Build Path..."
- go to the TAB "Libraries" click on [Add External JARs...] => [Browse...] and select the "java_code/lib/twitter4j-core-3.0.5.jar"-file from this git-project
rxtx
- go to "java_code/lib", copy the file called "librxtxSerial.so" into the eclipse project root directory, hit F5 in the "Project Explorer" and make sure you see the file listed (for Windows you will need to download the rxtxSerial.dll)
- right-click on your project name in the "Project Explorer" => "Build Path" => " Configure Build Path..."
- go to the TAB "Libraries" click on [Add External JARs...] => [Browse...] and select the "java_code/lib/RXTXcomm.jar"-file from this git-project
- you might have to set a default folder to look for runtime libraries...not sure if so, and if so where again...hopefully you don't need to :-(
source code
- if you are not still there, right-click again on your project name in the "Project Explorer" => "Build Path" => " Configure Build Path..."
- go to the TAB "Source" click on [Link Source...] => [Browse...] and select the "java_code/source"-folder from this git-project
run
- right-click the project name again or got to the menu bar "Run", choose "Run as...", select "Java Application", choose "Main - batsignal", if needed and have a look at the "Console"-TAB of eclipse.
- you should see the twitter message coming in every x minutes
- if you don't want twitter4j debug information in your output, set "debug=false" in the "twitter4j.properties"-file
- also the Arduino should respond to twitter messages by switching on its LED for a minute every time.
- click in the console window of eclipse and hit [ENTER] to make the application stop
unittest
There is also sources to set up an eclipse unittest project using junit4 and the mockito-jar in the lib folder. Any files that you find and that have not been mentioned are to do with the unittest project. More later!?
arduino
- open the arduino IDE, go to file=>open...and select the "arduino_code/serialToLED/serialToLED.ino"-file from this git-project
- compile and upload it to you Arduino