Skip to main content

Building and installing CAN bus bundle on Kura/Eurotech Software Framework

The documentation is incomplete as of 11/25/2015: http://esf.eurotech.com/docs/how-to-use-can-bus. It shows you how to setup the can0/can1 interfaces.

I think I finally figured out the real steps to getting the CAN bus service working in Kura. I found this website somewhat useful: https://tobiddev.wordpress.com/2015/03/23/one-bundle-project-modbus-and-eclipse-kura/. It didn't tell me how to build a bundle, but I took a chance with the following and now I'm able to see my module loading the CanConnectionService in the Kura logs.

First, build Kura from source following this guide: https://wiki.eclipse.org/Kura/Getting_Started. You'll probably want to build it in Linux (I am using Debian Jessie) or possibly OS X (I didn't test it). For sure, it fails in Windows 8 at the create_installer.sh part, so I decided not to waste any more time on it. You basically need Kura built just enough so that you can load everything into Eclipse. I was able to do this using Eclipse Mars. After you finish the section "Configure Eclipse", check if you have any errors on the org.eclipse.kura.protocol.can package. If not, you're good and you can build the .jar file (which I'll refer to as "bundle" going forward):

1. Right click on the org.eclipse.kura.protocol.can package.
2. Select "Export".
3. Expand "Plug-in Development", then select "Deployable plug-ins and fragments".
4. Click "Next".
5. Make sure org.eclipse.kura.protocol.can is selected, enter a destination directory, then click "Finish".


Now, you can load the .jar file into Kura. I just did this by following the Kura documentation on how to deploy a bundle. In my case, I used the Remote Target device deployment: http://eclipse.github.io/kura/doc/deploying-bundles.html#remote-target-device. After you install the bundle (the jar file you exported earlier), search the frameworks to verify that your org.eclipse.kura.protocol.can bundle is there:


After you see the CanConnectionService under the registered services, your bundle that uses CanConnectionService should be able to work. I was also able to create a deployment package and import it as a package in the Kura web UI.

If you get any errors related to the configuration, you'll probably have to create a metatype/default configuration for the CanConnectionService.

1. Create a metatype folder under OSGI-INF, then create a new file, named "org.eclipse.kura.protocol.can.CanConnectionServiceImpl.xml". (/OSGI-INF/metatype/org.eclipse.kura.protocol.can.CanConnectionServiceImpl.xml)
2. In the xml file, I put these contents.
3. Then I created a .dpp file. Under the Bundles tab, I located the .jar file created above and used that for the project.
4. Double check your component xml, which is probably named canconnection.xml. Mine contains these contents.
5. Now try to do a Quick Build on the .dpp, then get the .dp file and import it via the Kura web UI.

Comments

Popular posts from this blog

Compiling pgmodeler on Yosemite (with Homebrew)

Refer to  pgmodeler installation . Steps: Clone the pgmodeler git repo. Use Homebrew to install qt5 (5.4.2, see here ), libxml2, and postgresql. Edit the pgmodeler.pri (not .pro) file and change these variables: PGSQL_LIB = /usr/local/opt/postgresql/lib/libpq.dylib PGSQL_INC = /usr/local/opt/postgresql/include XML_INC = /usr/local/opt/libxml2/include/libxml2 XML_LIB = /usr/local/opt/libxml2/lib/libxml2.dylib Follow instructions to compile pgmodeler (you might need to put Qt's binaries in your PATH. I was lazy and didn't). $ /usr/local/opt/qt5/bin/qmake pgmodeler.pro $ make $ make install $ cd /Applications $ /usr/local/opt/qt5/bin/macdeployqt pgmodeler.app -executable=pgmodeler.app/Contents/MacOS/pgmodeler-ch -executable=pgmodeler.app/Contents/MacOS/pgmodeler-cli Then I was able to do $ open pgmodeler.app

pgmodeler build in Debian Jessie

This is my qmake version: $ qmake -v QMake version 3.0 Using Qt version 5.3.2 in /usr/lib/x86_64-linux-gnu I had to edit linuxdeploy.sh: 1. Add "-makefile" to the QMAKE_ARGS variable: $ qmake -h Usage: /usr/lib/x86_64-linux-gnu/qt5/bin/qmake [mode] [options] [files] where mode is either "-makefile" (default) or "-project" QMAKE_ARGS="-makefile -r -spec linux-clang" 2. Right before "Running qmake...", I added another line to include pgmodeler.pro in the qmake invocation: QMAKE_ARGS="$QMAKE_ARGS pgmodeler.pro" Then I ran ./linuxdeploy.sh -no-qt-libs (https://github.com/pgmodeler/pgmodeler/issues/674)