Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: User plugin for EnOcean USB300

  1. #11
    Join Date
    Nov 2002
    Posts
    169

    Default

    If I understand correctly Lua can use / in file path on both windows and Linux, maybe substitute \ with / when these are received from windows.
    Yes, it will do that.


    On Window I can drag a switch (Control Editor) to Girders Action Tree but in Linux (Girder on Ubuntu with USB300) I can't.
    I do not know why, so can you tell me if the Device Manager action (from the left Action tree) works as expected, and if drag'n drop works with the Device Manager Example Component?

    Thanks!

  2. #12

    Default

    Hi hoox,

    Device Manager action (from the left Action tree) works as expected! Drag'n drop with the Device Manager Example Component doesn’t ether work. This problem seems to be Ubuntu (15.04) related as your plugin works as expected on the Pi running Raspbian (Jessie). Not sure why this is but it is not a problem with your plugin and not a problem for me as I intend to run Girder on the PI.

    So the only current problem (at least for the time being) is that I can't use the EnOcean Pi on the Raspberry Pi. I wonder why it doesn’t work, the USB300 and EnOcen Pi uses the same TCM310 chip?!

    When I test with Girder and a Lua script (transport) USB300 and EnOcen Pi works in the same way when it comes to send and receive (the only change is the specified serial port 'ttyAMA0' or 'ttyUSB0') ESP3 messages. Any idea what could be causing the 'ttyAMA0 TIMEOUT OCCURED WITHOUT DATA' message/error?

    I think this is fantastic, how do I buy you beer?!

    Regards,

    Joachim

    Small correction, not sure if the drag and drop problem is a problem on Raspbian, as I used Girders frontend on Windows and the backend on the Pi, so it might be a Girder Linux problem.
    Last edited by Yoggi; September 9th, 2016 at 01:31 PM.

  3. #13
    Join Date
    Nov 2002
    Posts
    169

    Default

    Any idea what could be causing the 'ttyAMA0 TIMEOUT OCCURED WITHOUT DATA' message/error?
    The port could be already used, maybe by another application... As your transport script is ok with it then a problem in the TCM file is more likely. The new version fixes some connection bugs (and others), but I doubt it will fix yours.
    You can check if the connection settings and timeout values are the same as your script.

  4. #14

    Default

    Hi hoox,

    Sorry for the late reply, I have been away a few days.

    My findings with the latest version 0.3.5 (remember I am not a programer so I could be wrong).

    In order to get your code working on Windows and Linux I need to change the '\\', '//' substitution to '\\', '/'. I assume that the use of double backslash are do to that the backslash needs to be escaped (but forward dose not so it should only be replaced with one).

    local linuxFormat = string.gsub(component.internalId, '\\', '/')

    Since Windows returns different numbers of backslash in port path I need to change '// to '/+ at the beginning ('\\.\COM3' → '//./COM3' vs '/dev/ttyAMA0').

    local _, _, d, port = string.find(linuxFormat, '/+(.+)/(.+)')

    Remember the problem I had on the Pi with EnOcean Pi? TIMEOUT OCCURED WITHOUT DATA (I got this after the port got connected so its not that the port is used by an other program)

    Now I get the same error on windows(and Ubuntu with the USB300) with the USB300 'COM3 TIMEOUT OCCURED WITHOUT DATA' after I have switch the relay on and off a few times.

    From what I can see, our connection settings and timeout values are the same were it matters.
    “You can check if the connection settings and timeout values are the same as your script? (your question in previous post)

    I hope that my findings can help you, and if there is anything you would like my to try, let me know!

    Joachim

    edit
    One thing I noticed regarding the EnOcean Pi (TCM310) interface is that the BaseID drop down newer gets populated (Component Editor page), maybe there is a slight difference in how this is read in.
    Last edited by Yoggi; September 15th, 2016 at 11:22 AM.

  5. #15
    Join Date
    Nov 2002
    Posts
    169

    Default

    Thanks for the corrections, they are included in the latest update.

    I could finally get the timeout error and stop the plugin when sending a lot of commands (never after the connection or moderate use).
    However this bug could not be reproduced with the new version. See if it runs better for you too.

    One thing I noticed regarding the EnOcean Pi (TCM310) interface is that the BaseID drop down newer gets populated (Component Editor page), maybe there is a slight difference in how this is read in.
    The plugin will wait a second after the connection before reading the BaseID, and the radio receiving part is enabled first: check the Lua console when using a PTM (with Log set to 0).

  6. #16

    Default

    Hi hoox,

    I did some more testing with a transport script and I noticed that I didnít get the sync byte in the beginnings of the messages. I would aper that when I did the remapping of the serial port (on the Pi 3 the hardware serial port has been mapped to blue tooth) that the EnOcean Pi needs I made a small mistake (I needed to remove all trace of console debug in /boot/cmdline.txt).

    So your plugin works fine with the EnOcean Pi. I apologise for not catching this earlier and for leading you up the garden path!

    I will do some more testing, now that I have my intended hardware working.

    Thanks for your grate work on this plugin!

    Joachim

  7. #17
    Join Date
    Nov 2002
    Posts
    169

    Default

    Ahhh, it's great to know that your EnOcean Pi is working. At least more bugs that weren't noticed before could be fixed .

    I'm tempted with getting a Pi but still sceptic it will be ok with my unoptimized code. Do you get roughly the same Girder reaction times as with a standard PC?

  8. #18

    Default

    Hi,

    At the moment I am not running much on my Raspberry Pi 3. When it comes to turning on the lights with your plugin I would say that it is as quick as running on windows.

    I run Raspbian (jessie) without starting the Desktop GUI, so only Girders backend is running on the pi. I can also mention that I run node-red on the same Pi as the Girder backend to simulate my networked TV(i emulate the TVs response to volume change, power on/off commands with node-red), and this also works without noticeable delay.

    If you can come up with a test I would be happy to try it out for you. Maybe a script that dose something that can be measured (a script entered directly in the Windows frontend or a script on the Pis sd card).

    One thing that I find that can be slow is for Girders backend to show up when I want to connect the frontend on windows to the backend (on the Pi) but this might be network related. I have the same "problem" with netremote, but when connected I have no problems with speed.
    Last edited by Yoggi; September 18th, 2016 at 04:32 PM.

  9. #19
    Join Date
    Nov 2002
    Posts
    169

    Default

    Thanks Yoggi, with your findings I could more easily setup an EnOcean Pi. It is using the ttyS0 port of the Pi 3. Apparently we can use "dmesg | grep tty" to confirm that the ports are not used by the console after editing /boot/cmdline.txt. So far it works perfectly fine.
    I was a bit confused with where and which Girder settings had to be moved, then added in the update a gml file that could help with that and how to modify the BaseID to avoid a new learning process on the receivers.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •