element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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
Pi IoT
  • Challenges & Projects
  • Design Challenges
  • Pi IoT
  • More
  • Cancel
Pi IoT
Blog PiIoT - The perfect reading place #18 [tech]: EnOcean Link library API test and usage
  • 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: balearicdynamics
  • Date Created: 15 Aug 2016 8:23 AM Date Created
  • Views 598 views
  • Likes 1 like
  • Comments 0 comments
  • eolink library
  • internet of things
  • sensors
  • piiot
  • enocean api
  • eclipse
  • enocean
  • muzieum
  • raspberry pi
  • ubuntu linux
  • gnu gcc
  • compiling
  • iot
  • cross compiling
  • iot nodes
  • raspbian jessie
  • raspberry pi2
  • remote deploying
Related
Recommended

PiIoT - The perfect reading place #18 [tech]: EnOcean Link library API test and usage

balearicdynamics
balearicdynamics
15 Aug 2016

Introduction

Writing new software based on the EnOcean technology or just compile the tutorials and examples provided by the EnOcean Link package it should be available a development environment (better based on Eclipse cross-compiling on Ubuntu Linux) and some other settings are needed. So before starting maybe useful to read these two previous posts:

 

PiIoT - The perfect reading place #16[tech]: Setup the Raspberry PI Cross-compiler for EnOcean

PiIoT - The perfect reading place #17 [tech]: Compiling the EnOcean Link library for the Raspberry PI

 

Easy setup for the Raspberry PI serial

The Raspberry PI 2 Raspbian distribution we are running is the Jessie last update. As starting from this distribution the ttyAMA0 serial port is managed as a service: we should disable it (not enabled at boot) with the command.

 

sudo systemctl disable serial-getty@ttyAMA0.service

 

  • Disabling the serial needs a reboot. To avoid rebooting the raspberry PI we can also stop the tty service with the command: sudo systemctl stop serial-getty@ttyAMA0.service
  • To make the serial port available to the EnOcean gateway without being root user don't forget to change the ttyAMA0 privileges with the command sudo chmod 777 /dev/ttyAMA0

Copying the compiled library to the Raspberry PI

After the EOLink library has been cross compiled in the Eclipse IDE desktop environment we should put it somewhere in the Raspberry PI home folder. Here we refer to the folder

 

Setting the sources for the Raspberry PI serial

By default the sources of the Tutorial and examples projects of the EnOcean Link package defines the serial port device as USB0

 

#define SER_PORT "/dev/ttyUSB0"//! the Serial Port Device

 

To make the programs running on the Raspberry PI we should change this define to the following:

 

#define SER_PORT "/dev/ttyAMA0"//! the Serial Port Device

 

This action should be systematically applied to all the sources in both the projects examples and Tutorial. This task can easily be done in the Eclipse IDE environment with the multiple files search and replace as shown in the images below:

imageimage

Note: not all the sources refers to the ttyUSB0, some other define the serial port as ttyUSB1

As many programs includes some message referring to the USB300 connection port for completeness it is better to replace also this detail with the text ttyAMA0. This operation has not influence on the program functionality or behaviour.

This just one of the most interesting advantages developing and managing a lot of sources on Eclipse desktop environment.

Issue cross compiling EnOcean programs

After everything has been setup correctly we will try to compile en EnOcean provided program. As expected the most simple is just the HelloWorld. All what we should do is to launch the build of the properly set Build Configuration.

imageimage

imageimage

At the end of every cross compiling of program that link the EOLink library we get an error !!!

 

/home/pi/EnOcean/EnOcean Link V1.2.0.0/EOLink/ReleaseLib/../Timer/eoTimer.cpp:44: undefined reference to `clock_gettime'

makefile:44: recipe for target 'Tutorial' failed

collect2: error: ld returned 1 exit status

make: *** [Tutorial] Error 1

To explain this in few words, this seems an known issue related to the time component; it is not a EnOcean software issue but it is of the cross compiler toolchain. There is a library used by the cross compiler that is not of the same version than the one used by the Raspberry PI Debian environment.

As a matter of fact, according with the StackOverflow article How to upgrade glibc from version 2.13 to 2.15 on Debian? - Stack Overflow it is possible to upgrade this library. At the actual date this operation is strongly discouraged as the replacement library is only in the deb http://ftp.debian.org/debian experimental main repository, considered not reliable for any kind of production or normal development environment. If you want to try, it's at your own risk.

 

Ubuntu desktop development environment for Raspberry PI and EnOcean: conclusion

The described settings and state of the art are subject to almost frequent updates as the open source community constantly work solving problems and issues and upgrading the system. This remain the most proficient development environment I use to develop programs on the Raspberry PI, C/C++ but not only; with few changes it is possible to expand this development environment for Python and Java. The list of the points below tries to focus limits and advantages of this environment.

 

  • Excluding the specific case of the EnOcean applications linking the EOLink library the cross compiling method is faster and more efficient than programming directly on the Raspberry
  • The EOLink library itself can be compiled without difficult with the cross-compiles and without errors
  • Editing the code in the comfortable environment of the Eclipse source editor, cross-referencing the sources, finding the syntax errors and missing includes and more makes the difference anyway.
  • The remote environment (Raspberry PI) remain always connected and accessible to the desktop environment inside the Eclipse IDE. It is extremely easy to move sources or folders from the project to the remote machine and vice-versa.
  • Eclipse can also produce good makefiles according with the building configuration and settings.
  • All when it is not possible to cross compile the sources due the issue mentioned above it is sufficient keeping a ssh terminal open on the Raspberry to compile on the remote machine in seconds.
  • Sign in to reply
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