Posts Tagged ‘java’

Arduino Mega ADK tty device

December 29, 2011 Comments off

Unlike what most of the documentation on the arduino site refers to, the Mega ADK board makes use of /dev/ttyACM0 and not /dev/ttyUSBn[1]. And in order to use it, you need the latest 1.0 version of the arduino dev kit, which has an updated RXTX library to support it, so don’t go updating it, like all the ubuntu install instructions eventually get around to telling you to do. You may also get into a rats nest of uninstalling tty and ftdi drivers.


  1. Get a JDK6 or 7 JDK (32 or 64 bit available)[2]
  2. Download the arduino dev kit (32/686 or 64 bit available)[3]
  3. Install all the avr stuff : 'sudo apt-get install avr-libc avrdude binutils-avr gcc-avr'
  4. Install the downloaded jdk then 'sudo update-alternatives --config java' to set the default JVM.[4]
  5.  Untar the arduino download to a dir of your choice (your home dir perhaps, as you dont want to be doing this as root)
  6.  Plug in the arduino board to a free USB port, and then run ./arduino from the install dir
  7.  Set the ADK board from Tools->Board menu
  8.  Set the serial port from Tools->Serial Port– it should already be done. If its not, or it is disabled, something is wrong with your installation. Check previous steps. Cry. Try again.
  9.  From File->Examples->Basic choose Blink.
  10.  Click the right arrow icon to upload to your board. Check pin 13 amber LED is blinking.

[1] – see last para of “Included Dependencies”


Java Semantic & Linked Open Data webapps – Part 5.2

February 8, 2011 Comments off

Continuation from previous article in series

The overall architecture for the Semantic backed J2EE app is different from the Linked data app already discussed because we need a business logic layer and a decoupling from the persistence layer. We also want to create a Java app rather than a semantic application so that the programming paradigms and patterns are familiar to the Enterprise java developer.


Semantically backed J2EE webApp - System diagram

Here we see a fairly standard 3 tier MVC application. Browser requests URIs from the appserver, or makes an Ajax call and gets html from server side JSPs or JSON formatted data in response, respectively. The application server contains java code that maps URIs and API calls to controllers, which make calls to service classes and DAO code. The DAO code makes call via a persistence proxy to get data from the server that is unmarshalled from RDF to java objects (or makes writes in the other direction). The persistence layer is configured to use an implementation that takes care of the Object to RDF mapping – two implementations are available (JenaBean and EmpireJPA). These in turn use their own protocols to talk to native or location repositories, or typically JDBC talk with standard DBMS. Spring and Spring security provide infrastructure level services for dependency injection, component wiring, MVC abstractions, and role, method and data level security for beans and dynamically created object instances. These technologies are shown below in the AppServer layer cake.


Technology libraries and tools used in Semantically backed J2EE WebApp

Technology libraries and tools used in Semantically backed J2EE WebApp

Obviously, there are many things going on here, and they’ll need some discussion

  • Basic building blocks, tool selection
  • Security considerations and restrictions
    • authentication – OpenID, admin login, facebook connect
    • authorisation role,uri,method,data levels
    • registration process
    • ownership, group (friend) and application membership, resolution (date & location cloaking)
    • ACL – data and dynamic object level authorisation
    • Syndication –
      • json,jsonp (get/post),,ajax,
      • cors
      • oauth
      • API and result formats
  • Scale, concurrency, transactions,  failures, and performance
  • URIs, ontology, linkage
  • input, output interfaces
  • ontology to object/interface mapping