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
Pi IoT
  • Challenges & Projects
  • Design Challenges
  • Pi IoT
  • More
  • Cancel
Pi IoT
Blog [Pi IoT] - Smarter Spaces #3 - Remote Horse Feeder System
  • 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: jomoenginer
  • Date Created: 9 Jul 2016 5:07 PM Date Created
  • Views 964 views
  • Likes 2 likes
  • Comments 9 comments
Related
Recommended

[Pi IoT] - Smarter Spaces #3 - Remote Horse Feeder System

jomoenginer
jomoenginer
9 Jul 2016

So, I was able to get the iLumi controlled via a python script that in turn I was able to add to OpenHAB and could control the iLumi BR30 from an OpenHAB ColorPicker, however when I attempted to add the EnOcean Pi 902 to the Raspberry Pi 3 and performed the update/upgrade to support the device I lost both the Wi-Fi and the Bluetooth functionality of the Raspberry Pi 3.   I was able to recover the W-Fi connection on the RasPi 3 by performing a dist-upgrade and then updating the firmware on the system to 4.4.3.  This corrected the Wi-Fi issue but I am still unable to get the Bluetooth device on the RasPi 3 to enable.  The system seems to think there is no bluetooth device on the board which I know there is one since it was working prior to the upbreak.  I'll have to see if I can get this to come up again or just add a usb bluetooth dongle to the board to get past it.

This assisted me in getting the WiFi back up and working:

http://raspberrypi.stackexchange.com/questions/43474/how-to-enable-wi-fi-channel-12-on-raspberry-pi-3

 

Also, I was never able to get the RasPi to see the EnOcean Pi 902 so I was wondering if anyone knew if the device is supported with Raspberry Pi 3 and Jessie or do I need to use the RasPi B+ to connect the EnOcean Pi 902.  

  • Sign in to reply

Top Comments

  • fvan
    fvan over 9 years ago +2
    Hi Jon, i got my EnOceanPi 868 to work, including Wifi and BLE. All is described here: [Pi IoT] Alarm Clock #05: EnOcean Pi and Sensors Good luck! Frederick
  • jomoenginer
    jomoenginer over 9 years ago +1
    Still no success with getting the BLE device to enable, but I did find some more info regarding this. Apparently at kernel 4.4.9 there was a switch from ttyAMA0 to serial1; I'm currently running with 4…
  • jomoenginer
    jomoenginer over 9 years ago in reply to jomoenginer +1
    Okay, finally a bit of success. After searching the web and attempting many changes to the RasPi 3 config, I finally stumbled on the needed info to get the On Board BLE device working again on the RasPi…
  • clem57
    clem57 over 9 years ago

    I read your next blog and think it is swell. Keep up the great work.

    Clem

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • jomoenginer
    jomoenginer over 9 years ago in reply to clem57

    Thanks Clem,

     

    Yeah, this was a head banger for sure. The other one I ran into is trying to keep the wifi active on the Raspberry Pi.  Both the RasPi 3 and B+ seem to die consistently at various times so I have had to add a bunch of changes to the config and a cron job that kicks the wlan0 on a regular basis if it is down.

    Also, the EnOcean stuff I have pretty much given up on except the Rocker Switches.  I've sent a message regarding having the wrong set of Sensors and was told it was being looked into but that was over a week or so ago and no update since.  The Energy Harvesting switch I have yet to see a purpose for since OpenHab will not detect it although I can see the activity from it via Fhem and EnOceanSpy or peeking at the serial interface.  All my postings at OpenHAB and EnOcean regarding the use of this device have not been replied to so I'm not sure what to do with this one.  I have a TI SensorTag that may use for Temp readings or just toss in a DTH11 or even go with a Cypress Energy Harvesting device since I like the idea of having that in the mix.

     

    Cheers,

    Jon

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • clem57
    clem57 over 9 years ago in reply to jomoenginer

    Wow! You deserve a star for persistence to track this problem down. When the hardware changes sometimes the software does not. You are right about the frequencies involved. Hopefully element14Dave can get involved to correct this one.

    Cheers,

    Clem

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • jomoenginer
    jomoenginer over 9 years ago

    Okay, I believe I have solved the puzzle as to why the EnOcean Pi receiver is not picking up the Temp, Magnet Contact Transmitter Module or the Switch Module from the EnOcean Sensor Kit that was sent to me.   Looking at the back of the Switch module, it is listed as model PTM210 DB PN: S3001-A210-15 where as the one that works has a model number of PTM 210U PN: S3051-A210-S.  Looking up the PTM 210 DB on the EnOcean site, it is listed with a Freq of 868 MHz where as the Receiver module I have is a 902 US version.  I would suspect these are incompatible and will not talk to each other.    I'll have to contact the good folks involved in the contest to perhaps get the Sensor Kit switched out for a 902 version which should work.

     

    Now that is solved I can proceed with the rest of my project.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • jomoenginer
    jomoenginer over 9 years ago in reply to jomoenginer

    Okay, finally a bit of success.     After searching the web and attempting many changes to the RasPi 3 config, I finally stumbled on the needed info to get the On Board BLE device working again on the RasPi 3.  I am not sure what got it to the state it was in, but it is all working now.

    This is what I found:

    To fix the issue with the On Board BLE (hci0) not showing after an update on the RasPi 3, I followed the info in the following post, although I do not know what is being said:  (NOTE:  I have since found some of the info in other links but this one listed the steps more logically:

    http://www.fhemwiki.de/wiki/Raspberry_Pi_3:_GPIO-Port_Module_und_Bluetooth

     

    1. Edit /boot/config.txt and add the following:

     

          BLE Fix:

          sudo view /boot/config.txt

     

     

         # Additial overlays    

         dtoverlay=pi3-miniuart-bt

         force_turbo=1

     

     

         # Enable UART

         enable_uart=1

         #force_turbo=1

     

    2.  Edit /boot/cmdline/txt

    Add "core_freq=250" to the end of the cmdline string:

        dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait core_freq=250

     

    3. Edit "hciuart.service" change "ttyAMA0" to "ttyS0" if not already set.

         $ sudo view /lib/systemd/system/hciuart.service

     

     

         [Unit]

         Description=Configure Bluetooth Modems connected by UART

         ConditionPathIsDirectory=/proc/device-tree/soc/gpio@7e200000/bt_pins

         Before=bluetooth.service

         After=dev-ttyS0.device

     

         [Service]

         Type=forking

         ExecStart=/usr/bin/hciattach /dev/ttyS0 bcm43xx 921600 noflow -

     

    4. Add a "sleep 10" to the start section in the "fhem" init script if using FHEM.

        $ sudo view /etc/init.d/fhem

     

         case "$1" in

         'start')

                 echo "Starting fhem..."

                 perl fhem.pl fhem.cfg

                 RETVAL=$?

                sleep 10

                 ;;

     

    After performing these steps and rebooting the board, the on board BLE device should show up again:

    In my case I still had the USB BLE Dongle installed so both hci devices were listed in the hcitool listing from bluez:

          $ sudo hcitool dev

         Devices:

           hci1 B8:27:EB:0A:18:49  <-- On Board RasPi 3 BLE device

           hci0 5C:F3:70:6E:13:4B  <-- USB BLE Dongle

     

     

          $ sudo hciconfig

         hci1: Type: BR/EDR  Bus: UART

           BD Address: B8:27:EB:0A:18:49  ACL MTU: 1021:8  SCO MTU: 64:1

           UP RUNNING

           RX bytes:717 acl:0 sco:0 events:42 errors:0

           TX bytes:1560 acl:0 sco:0 commands:45 errors:0

     

        hci0: Type: BR/EDR  Bus: USB

           BD Address: 5C:F3:70:6E:13:4B  ACL MTU: 1021:8  SCO MTU: 64:1

           UP RUNNING

           RX bytes:4967 acl:44 sco:0 events:348 errors:0

           TX bytes:4942 acl:45 sco:0 commands:226 errors:0

     

    The /dev/serial* to tty mapping is now as follows:

    $ ls -lt /dev/serial*

    lrwxrwxrwx 1 root root 5 Jul 16 22:59 /dev/serial1 -> ttyS0

    lrwxrwxrwx 1 root root 7 Jul 16 22:59 /dev/serial0 -> ttyAMA0

     

    Looking at the Fhem messages, we can see the EnOcean Pi is still working:

     

    // Fhem messages

    Events:

    2016-07-16 09:56:31 EnOcean EnO_switch_002BA820 buttons: pressed

    2016-07-16 09:56:31 EnOcean EnO_switch_002BA820 channelB: B0

    2016-07-16 09:56:31 EnOcean EnO_switch_002BA820 A0,B0

    2016-07-16 09:56:31 EnOcean EnO_switch_002BA820 buttons: released

    2016-07-16 09:56:31 EnOcean EnO_switch_002BA820 buttons: released

    2016-07-16 09:56:33 EnOcean EnO_switch_002BA820 buttons: pressed

    2016-07-16 09:56:33 EnOcean EnO_switch_002BA820 channelB: BI

    2016-07-16 09:56:33 EnOcean EnO_switch_002BA820 AI,BI

     

    NOTE:  I found if Fhem init script was up and running, the EnOcean script would not display any events from the Pi device, thus I shut down the Fhem process prior to running the EnOcean script or before running the OpenHab start script. 

     

    pi@raspberrypi:~ $ sudo /etc/init.d/fhem status

    fhem is running

    pi@raspberrypi:~ $ sudo /etc/init.d/fhem stop

    Stopping fhem...

    pi@raspberrypi:~ $ cd EnOceanSpy/

    pi@raspberrypi:~/EnOceanSpy $ sudo ./EnOceanSpy /dev/ttyAMA0

    Starting EnOceanSpy...

    2016-07-16 10:05:14  55 00 07 07 01 7A F6 70 00 2B A8 20 B0 01 FF FF FF FF 30 00 E5

    2016-07-16 10:05:15  55 00 07 07 01 7A F6 00 00 2B A8 20 A0 01 FF FF FF FF 33 00 97 55 00 07 07 01 7A F6 10 00 2B A8 20 B0 01 FF FF FF FF 36 00 9E

    2016-07-16 10:05:16  55 00 07 07 01 7A F6 00 00 2B A8 20 A0 01 FF FF FF FF 34 00 FC 55 00 07 07 01 7A F6 37 00 2B A8 20 B0 01 FF FF FF FF 45 00 18 55 00 07 07 01 7A F6 00 00 2B A8 20 A0 01 FF FF FF FF 42 00 20

     

     

     

     

     

    If needed, Change the OpenHAB serial port setting to ttyAMA0:

    $ view configurations/openhab.cfg

     

         # EnOcean USB adapter serial port

         enocean:serialPort=/dev/ttyAMA0

     

     

     

    Initially, after doing all of this and seeing both the On Board BLE device working as well as the EnOcean device working, when I started OpenHAB, the PTM 210 U events were not being reported by OpenHAB.  However, I did find a blogpost posting by  Kai Kreuzer (The Creator of OpenHAB)  regarding this issue.

    http://kaikreuzer.blogspot.com/2014/08/forget-me-not-with-openhab-and-enocean.html

     

    He states:

    “…  Unfortunately, the RXTX library that is used by openHAB for connecting to serial ports does not consider /dev/ttyAMA0 to be a standard port and thus simply does not recognise it. You therefore have to explicitly declare it through the JVM parameter "-Dgnu.io.rxtx.SerialPorts=/dev/ttyAMA0" in the start(_debug).sh launch script.”

     

     

    I added the following heading:

      echo Launching the openHAB runtime...

      java \

      

        -Dgnu.io.rxtx.SerialPorts=/dev/ttyAMA0 \

     

     

     

     

     

    After this, I was able to see the events from the EnOcean Pi via OpenHAB again when pressing the PTM 210u switch..

     

    Messages from openhab.log:

    2016-07-17 01:33:23.303 [INFO ] [enhab.model.script.EnOcean Off] - Trying to run python script

    2016-07-17 01:33:23.315 [INFO ] [g.openhab.io.net.exec.ExecUtil] - executed commandLine 'sudo /usr/bin/python /opt/openhab/configurations/scripts/test2.py iLumi1 255 255 255'

    2016-07-17 01:33:23.317 [INFO ] [penhab.model.script.EnOcean On] - Send on

    2016-07-17 01:33:23.499 [INFO ] [enhab.model.script.EnOcean Off] - Trying to run python script

    2016-07-17 01:33:27.107 [INFO ] [penhab.model.script.EnOcean On] - Trying to run python script

    2016-07-17 01:33:27.118 [INFO ] [enhab.model.script.EnOcean Off] - Trying to run python script

    2016-07-17 01:33:27.126 [INFO ] [g.openhab.io.net.exec.ExecUtil] - executed commandLine 'sudo /usr/bin/python /opt/openhab/configurations/scripts/test2.py iLumi1 0 0 0'

    2016-07-17 01:33:27.128 [INFO ] [penhab.model.script.EnOcean On] - Send off

    2016-07-17 01:33:27.337 [INFO ] [enhab.model.script.EnOcean Off] - Trying to run python script

     

     

     

     

     

     

    Now, the only thing left is to get the EnOcean Pi to recognize other EnOcean sensors.  Thus, far I have not been successful with this, but that is something for a later time.

     

    I’ll create another post to outline how I am controlling the ilimi BR30 with the EnOcean PTM 210U via OpenhHAB.

     

    • Cancel
    • Vote Up +1 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