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 & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • 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
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • 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
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum EnOcean Pi - EnOcean Link - Serial Comms not working
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 5 replies
  • Answers 1 answer
  • Subscribers 676 subscribers
  • Views 1091 views
  • Users 0 members are here
  • r_pi
  • raspberry
  • pi
  • frontpage
  • enocean
  • raspberry_pi
  • raspberrypi
  • serial
  • enoceanpi
  • enocean_pi
Related

EnOcean Pi - EnOcean Link - Serial Comms not working

hkafeman
hkafeman over 11 years ago

Can anyone help me please?

 

We are trying to receive EnOcean Serial Packets (ESP3.0) in a Raspberry Pi from an EnOcean Pi (or direct from an EnOcean TCM320).

 

BUT for some strange unknown reason, not all bytes are received.

 

Modifying the EnOcean Link "Receive()" function to report received bytes, shows that more frequently than not bytes are missing.

 

E.g. when multiple packets are sent over the Serial link only some bytes (at best) from each packet are received in the Software (C++) running on the Raspberry Pi which is receiving from /dev/ttyAMA0.

 

However, occasionally a complete packet is received okay!

 

A digital Oscilloscope with Serial decoding shows that all bytes are sent okay on the actual wire to the Raspberry Pi!

 

Can anyone help get this working for us as it is holdig up our project?

 

Thanks

  • Sign in to reply
  • Cancel
Parents
  • Former Member
    0 Former Member over 11 years ago

    Hi Henry,

     

    If you are using a TCM320 you will first need to update its firmware to the Gateway Controller Firmware.  This makes the TCM320 "speak" ESP3. See the enocean.com support section.

     

     

    Did you set the baud rate to 56700?

     

    How to setup a home automation server with EnOcean Pi

     

    -Bryan

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • hkafeman
    0 hkafeman over 11 years ago in reply to Former Member

    Bryan

     

    Thank you for your reply.

     

    We are actually running our own embedded software on the TCM320 and calling uart_sendPacket() to send ESP3 packets.

     

    The problem occurs with the Raspberry Pi receiving the packets on its Serial Port.

     

    Yes this is working at 57,600 baud.

     

    It seems there is one of the following causing problems as EnOcean have confirmed that there are many users/applications utilising the EnOcean Link software for Serial communications to EnOcean Pi, USB300, etc.:

    • The build of the receiving software on the Raspberry Pi which uses EnOcean Link (libEOlink.a) - we are currently using Eclipse on a Linux computer.
    • The configuration of the Raspberry Pi causing issues with the ttyAMA0 serial port.

     

    Thanks and Regards

     

    Henry

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago in reply to hkafeman

    OK, I see. You may also want to check if this python program works for you - modify it to use AMA0 instead of the USB ports. Then you know the serial port is set correctly.

     

    EnOcean USB300 and Python Via EnOcean Serial Protocol 3 | Creative Finance, Electrical Engineering, and Other Cool Stuff

     

    -Bryan

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • hkafeman
    0 hkafeman over 11 years ago in reply to Former Member

    Bryan

     

    Thanks I got a python program based on yours working in one version of Raspberry Pi installation. However it took a lot of modifying to run (as well as installation of a library...) and it showed all bytes received.

     

    The differences might have been v3 versus v2 or some such? The actual installation we are working on for our application did not have python installed for some reason so I did not try it with that....

     

    Anyway we have now found the solution to our original problem. It turned out we had fhem running in the background and that was grabbing some of the bytes....!

     

    We had forgotten that it had been installed following EnOcean's original instructions, when we used it to estabiksh communications working with the EnOcean Pi, before starting to integrate with our own software running on an EnOcean TCM320!

     

    Note however that the EnOcean Link library software is polling the serial port for incoming bytes and taking 95% of the cpu. That does not seem to be an issue so far, but I will try changing it to use blocking serial port read calls and/or to delay a short time in between polls to have less effect on other applications...

     

    Thanks

    Henry

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
  • felisk
    0 felisk over 11 years ago in reply to hkafeman

    Hi,

     

    i modified Bryan's code (thanks for it Bryan !) and got it to run 0% cpu.

    it's a matter of two lines in getSerialData().

    • added one line at the beginning of the function:

      ser.timeout = 5

    • removed the liine

      if ser.inWaiting() != 0:

     

    works well on my tests using TCM310 with PTM200 buttons, but i haven't used it extensively yet.

     

    felice

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • felisk
    0 felisk over 11 years ago in reply to hkafeman

    Hi,

     

    i modified Bryan's code (thanks for it Bryan !) and got it to run 0% cpu.

    it's a matter of two lines in getSerialData().

    • added one line at the beginning of the function:

      ser.timeout = 5

    • removed the liine

      if ser.inWaiting() != 0:

     

    works well on my tests using TCM310 with PTM200 buttons, but i haven't used it extensively yet.

     

    felice

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
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