element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
In the Air Design Challenge
  • Challenges & Projects
  • Design Challenges
  • In the Air Design Challenge
  • More
  • Cancel
In the Air Design Challenge
Blog [Air ex Machina] #04 Beaglebone for dummies - JAVA,OpenHab
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: nikil511
  • Date Created: 16 Nov 2014 4:15 PM Date Created
  • Views 990 views
  • Likes 0 likes
  • Comments 5 comments
  • openhab
  • in_the_air_design_challenge_2014
  • in_the_air
  • BeagleBone
  • air_ex_machina
Related
Recommended

[Air ex Machina] #04 Beaglebone for dummies - JAVA,OpenHab

nikil511
nikil511
16 Nov 2014

Ambrogio did a very nice post on how to install java & openhab on BBB:

http://www.element14.com/community/community/design-challenges/in-the-air-design-challenge/blog/2014/11/14/airmobile--4-…

Follows an alternative approach for installing JAVA and OpenHab on BBB which is hopefully more newbie-friendly.


1) Where is my Beaglebone ?

 

I have never played with Beaglebone before, so I assumed it was more or less an RPi and did not bother to look at the details.

Some differences that might delay an excited user are: HDMI plug is not the typical size (Type A), it is micro (type D)

http://en.wikipedia.org/wiki/HDMI#mediaviewer/File:HDMI_Connector.jpg

So you need a micro hdmi cable or adapter to connect BBB directly on a monitor.

http://search.ebay.com/hdmi-micro-d

 

However, since Debian Linux is already installed in the internal eMMC 4GB, of the latest version of BBB, you can do stuff headless (without monitor) straight away.

So, hook an ethernet cable, power up BBB over USB. Note: use a dedicated PC USB (not a hub, where power is shared across).

(had to press reset for it to boot) ...and blue leds are flashing, Debian is up and running.... but what's the IP address ?

 

You can find out it’s IP with a number of ways, the easiest one is to try this:

http://beaglebone.lan

this should by default work on linux/mac but for windows only if you have an mDNS/bonjour service installed.

(if you can’t be bother with bonjour, try FING or see your access point / modem DHCP list)

and you will see this web site running on BBB

image

 

of course SSH will work too, username root , with blank password.

(can use putty.exe on windows)

 

 

2) Installing JAVA


You can easily install java in BBB via the repository like this:

 

echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee /etc/apt/sources.list.d/webupd8team-java.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886
apt-get update
apt-get install oracle-java8-installer

 

The above installs the Java8 hard float after accepting the License Agreement ASCII screen, and configures the environment.

Hardfloat can have dramatic performance boost on some applications. More details here:

http://trouch.com/2013/01/12/raspberry-pi-benchmark/

https://blogs.oracle.com/jtc/entry/comparing_arm_linux_jvms_revisited

BeagleBoard.org - Oracle JDK

 

... Alternatively if you want to install JAVA manually:

First step is to download the JAVA8 "ARMv7 Linux - VFP, HardFP ABI, Little Endian1" from oracle. However this is not possible command line from BBB with "wget" because, oracle want's you to accept licences and login. So you need to do it from you desktop and then transfer the file to BBB. One way to transfer the file is via SFTP , so in windows you need to use something like filezilla or http://the.earth.li/~sgtatham/putty/latest/x86/psftp.exe

you then sftp://beaglebone.lan

using root and blank password, and transfer the file across. Then...

tar xfvz ejdk-8-fcs-b132-linux-arm-vfp-hflt-03_mar_2014.gz

export JAVA_HOME=/usr/java/ejdk1.8.0/linux_arm_vfp_hflt/jre/

export PATH=$PATH:/usr/java/ejdk1.8.0/linux_arm_vfp_hflt/jre/bin/

...and add last two lines at  ~/.profile set upon boot

 

Eitherway, you should get something like this in the end:

java -version

java version "1.8.0"

Java(TM) SE Embedded Runtime Environment (build 1.8.0-b132)

Java HotSpot(TM) Embedded Client VM (build 25.0-b70, mixed mode)


Build 1.8.0-b132 is the lates manual one, and build 1.8.0_06-b23 the repository one.


3) Install Openhab


Openhab is very well organized as a community & java opensource project. They have debian builds/repo, and they use cloudbees for continuous integration.

https://github.com/openhab/openhab/wiki/Linux---OS-X

https://openhab.ci.cloudbees.com/job/openHAB/

 

That means it should be very easy to install OpenHab it in BBB/Debian, without having to do any manual stuff.

 

echo "deb http://repository-openhab.forge.cloudbees.com/release/1.5.0/apt-repo/ /" > /etc/apt/sources.list.d/openhab.list
sudo apt-get update
apt-get install openhab-runtime

 

Thats all :-)

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following NEW packages will be installed:

  openhab-runtime

0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.

10 not fully installed or removed.

Need to get 37.5 MB of archives.

After this operation, 42.0 MB of additional disk space will be used.

WARNING: The following packages cannot be authenticated!

  openhab-runtime

Install these packages without verification [y/N]? y

Get:1 http://repository-openhab.forge.cloudbees.com/release/1.5.0/apt-repo/  openhab-runtime 1.5.0 [37.5 MB]

 

Of course, you need to select some bindings, e.g:

 

apt-get install openhab-addon-binding-http

apt-get install openhab-addon-binding-ntp

apt-get install openhab-addon-persistence-exec

apt-get install openhab-addon-persistence-logging

apt-get install openhab-addon-persistence-rrd4j

 

You will wanna change the OpenHAB's jetty webserver port in /etc/default/openhab since by default its HTTP_PORT=8080, and Debian has already a proxy service there. (e.g. change to 9090)

nano /etc/default/openhab

You may start now the openhab service

/etc/init.d/openhab start

[ ok ] Starting openhab (via systemctl): openhab.service.

service openhab status


find / -name openhab

/var/log/openhab

/var/lib/openhab

/etc/init.d/openhab

/etc/openhab

/etc/default/openhab

/usr/share/openhab

 

Unfortunately openhab spreads on the above directories, (vs installing it manually from a zip, which keeps everything in one place)

If you want to replicate the demo you can download/extract the demo zip in /usr/share/openhab

If something is wrong you will need to see the log: /var/log/openhab/openhab.log

I will post more details on OpenHab on a future post, once I have some incoming sensor data.



4) Problems encountered

A) Upgrading

I always have the urge to upgrade stuff to their latest version, but maybe this is not such a good idea. Here is why:

sudo apt-get update

Fetched 20.1 MB in 48s (419 kB/s)

 

sudo apt-get upgrade

90 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Need to get 63.7 MB of archives.

After this operation, 264 kB of additional disk space will be used.

....

and got a couple of upgrade errors like:

dpkg: error processing apache2 (--configure):

dependency problems - leaving unconfigured

Setting up libdpkg-perl (1.16.15) ...

Setting up dpkg-dev (1.16.15) ...

Processing triggers for ca-certificates ...

Updating certificates in /etc/ssl/certs... 18 added, 5 removed; done.

Running hooks in /etc/ca-certificates/update.d....done.

Errors were encountered while processing:

rsyslog

openssh-server

dbus

dbus-x11

hostapd

apache2.2-common

apache2-mpm-worker

apache2

E: Sub-process /usr/bin/dpkg returned an error code (1)

 

Restoring OS

So I guess, its better if you avoid upgrading, unless you want to dig deeper into what's happening.

btw, here are the images in case something goes wrong, or if you wanna try via an microSD card

http://beagleboard.org/latest-images

To restore BBB to original state, download the emmc debian image, sector-write it on an microSD, and boot BBB with S2 button pressed.

Note:If all 4 leds flash together, try again, it should not be like that. (Its a emmc write error)

I flashed SD card again, tried everything from start, and copy finished in ~10min)

 

B) Debian default approach will not install java:

I could not install java the straightforward Debian way.

 

sudo apt-get install python-software-properties

sudo add-apt-repository ppa:webupd8team/java

sudo apt-get update

sudo apt-get install oracle-java8-installer

 

W: Failed to fetch http://ppa.launchpad.net/webupd8team/java/ubuntu/dists/trusty/Release  Unable to find expected entry 'main/binary-armel/Packages' in Release file (Wrong sources.list entry or malformed file)

W: Failed to fetch http://ppa.launchpad.net/webupd8team/java/ubuntu/dists/wheezy/main/source/Sources  404  Not Found

W: Failed to fetch http://ppa.launchpad.net/webupd8team/java/ubuntu/dists/wheezy/main/binary-armel/Packages  404  Not Found

W: Failed to fetch http://ppa.launchpad.net/webupd8team/java/ubuntu/dists/wheezy/main/binary-armhf/Packages  404  Not Found

E: Some index files failed to download. They have been ignored, or old ones used instead.

root@beaglebone:~# apt-get install oracle-java8-installer

Reading package lists... Done

Building dependency tree

Reading state information... Done

E: Unable to locate package oracle-java8-installer


C) Openhab ver 1.5.1 via deb repository does not seem to work on BBB

Latest stable release of openhab is ver 1.5.1. Unfortunately I could not start the service on BBB neither could I find out what was wrong.

More details here: https://github.com/openhab/openhab/issues/1690

They will release version 1.6 in the next few days, so I will upgrade to that version one way or another (via deb repository or manual "zip")

 

Next post:[Air ex Machina] #05 Lost in the sensors

  • Sign in to reply
  • engswee
    engswee over 10 years ago

    Manolis

    You can get the HDMI cable here (element 14 order code 2127550) 68786-0001 - MOLEX - MICRO HDMI CABLE ASSEMBLY | element14 Singapore

    It work for me with BBB out of the box. Just plug in and power up image

     

    cheer

    ES

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 10 years ago in reply to nikil511

    Ok, now I understand.

    Forget about the Python question.

     

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • nikil511
    nikil511 over 10 years ago

    Did some re-factoring in my post, pushed up the correct instructions, and collected all problems at the end.

    Furthermore I had problems with openhab ver 1.5.1 when installed via deb repository, so I have filled an issue over there: https://github.com/openhab/openhab/issues/1690

    Version 1.5.0 seems to work fine, but will move to 1.6 in the comming days anyway.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • nikil511
    nikil511 over 10 years ago in reply to DAB

    The openHAB Runtime is a Java application and requires JVM 1.6 or later, (deb or zip)

    What do you mean do the same with Python ?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 10 years ago

    Good post, but I am curious why you loaded Java?

     

    Could you do the same work with Python?

     

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube