Itach stops working

I have an itach device (GC100) that stops working after a few seconds. This only happens when the connection address is the same on the “TV” and “DVR” if I change either connector address to 2 or 3 it works fine. The GC100 has 3 connectors on module 4 and 3 connectors on module 5, I’m hoping I have something formatted wrong and don’t have to give up using half of the GC100?

I’m running HA on a virtual machine V 0.110.5. Nothing shows up in the logs.

#Example works for a few seconds then stops
remote:

  • platform: itach
    host: 192.168.1.70
    devices:
    • name: TV
      modaddr: 5
      connaddr: 1
      commands:
      • name: “ON”
        data: “0000 0070 0000 0032 0080 003f 0010 0010 0010 0030 0030 0010 0a98”
      • name: “OFF”
        data: “0000 0070 0000 0032 0080 003f 0010 0010 0010 0010 0030 0010 0a98”
    • name: DVR
      modaddr: 4
      connaddr: 1
      commands:
      • name: “DVR”
        data: “0000 0070 0000 0032 0081 0041 0010 0011 0010 0031 0010 0010”

#Example works fine
remote:

  • platform: itach
    host: 192.168.1.70
    devices:
    • name: TV
      modaddr: 5
      connaddr: 1
      commands:
      • name: “ON”
        data: “0000 0070 0000 0032 0080 003f 0010 0010 0010 0030 0030 0010 0a98”
      • name: “OFF”
        data: “0000 0070 0000 0032 0080 003f 0010 0010 0010 0010 0030 0010 0a98”
    • name: DVR
      modaddr: 4
      connaddr: 2
      commands:
      • name: “DVR”
        data: “0000 0070 0000 0032 0081 0041 0010 0011 0010 0031 0010 0010”

I had a similar issue too a couple of years ago when I started using HA and its itach platform.
I narrowed it down to the pyitachip2ir driver, and changed the code to get it to work.
When I posted the problem back then, no one else seemed to have this issue, so after I later found a fix, I never posted the solution.

What I recall, is I found the driver setup a tcp socket and kept it up, but the socket eventually dropped out and the driver didn’t know how to recover. I changed it to where the socket is only used when sending an IR command. This worked for me.

If you’re interested, I can go back and try to recreate the fix that I did and post it, but you’ll need to be able to compile C++ code and install it in your Python’s package library. Its not complex, but takes a little bit of work.

That would be great! Thank you so much

I placed my modified version of the original code on my github at:

along with instructions.

1 Like

Hello,

Sorry to ask a noob question.
I am unable to find where site packages are installed on my system.

Would this go in the custom components folder? Or, is this at a “deeper” level due to it being a driver?

Thanks for your help!!

Its not a custom component. Best way to describe it, is a convenient manual hack as all that is being done is manually overwriting an existing package file after the package has been installed and not part of any installation procedure.

Locating site-packages
It will of course depend on what kind of system you are using and what type of HA and installation method you have. If you’re using Hassio, I won’t be able to help much as I am not all that familiar with it. If you are using Hass in a python virtual environment in will be located in your venv’s lib or lib64 directory under the python3.x directory.

Thanks for the reply.

I have both a Raspberry Pi 4 (using image from site) and built up an HP computer using Ubuntu Server 20.04.

I can’t seem to find any of the files you reference on your Github on either. I have scanned and searched for the itachip2ir and it does not bring anything up.

I’ve also searched for itach - this too comes up empty - but is clearly somehow there - as some of the codes randomly work.
If I reboot the system, a new set of commands seem to work, and others then don’t.

I have enabled “show hidden files” in Winscp, but I could be missing something.

I sure appreciate your efforts on this. I am hopeful to make some progress on this.

Would you please be so kind to offer a little more thoughts, knowing the two systems I am running (as I test). I do see the web UI loading faster on the HP with an SSD, but it uses ~ 15W, and the Pi 4 uses ~ 9W.

Thank you so much for your help!

you are probably running hassio. Hassio runs inside a docker container which contains all the python code including the site-packages.

I believe you are correct Sir, on both systems. I will do some searching on the topic and report back to try to help others if i can find a resolution.

Thanks!

I wanted to report back with a few updates, and ask a question.
My question is do I need to g++ compile on the system that I am running?

In other words, I’ve found the Docker container, and was able to connect via console.

The container is homeassistant, and the directory is:
/usr/local/lib/python3.7/site-packages

While g++ was not available in this container, I was able to compile on a Raspberry Pi and pull the .so file off.

I then transferred that file via samba to the computer running Hassio (after renaming the old file to .sow)

At that point, I was able to copy it from the directory I could see from samba and pull it into the appropriate directory.

The trouble is something is not working as planned. After rebooting, I cannot see anything remote.send_command related, meaning the remote. prefix is missing from services on Developer Tools.

Thank you for your help!

Hello!
I was able to get this working - at least better -
I tried to compile on Ubuntu Server 20.04 and the resulting file was larger than how it compiled on the Raspberry Pi 3B+.

I did run sudo -i first this time - maybe that was it.

Anyway, the original, non-working file is 156 kb. The new working file is 188 kb.

Rebooted and remote.send_ is in services.

Edit:

I am sorry to report - the problem of random commands being properly executed or ignored still persists.

Thanks anyway!

Generally yes, because the compiler on the Rpi will generate machine code specifically for the processor it runs on. You can compile on a different machine if it has the same CPU architecture, otherwise you get into what is called a cross-compiler. It is possible you need different compile flags to build a shared library file on the Pie. I did a quick google search but couldn’t find thread on it.

Hi!

I have this problem too!
How do I go about compiling when I’m running HassOS? I don’t suppose there’s a step by step instructions to do so?

Thanks

HassOS based Home Assistant doesn’t appear to have any compiler tool chains, so your best bet would be to find a hardware platform that has the same CPU architecture and has a g++ compiler. What platform are you running HassOS on?

I’ve downloaded the hassOS image for vmware… and the server runs an older xeon cpu. Should I look up how to ssh to hassos’s host and install compiler on it?

I’m not familiar with VMware, but if it is possible to compile C code on your server (outside of HassOS image), then it may be simpler to compile the itach code there and copy the resulting shared library into say the HA config directory and then move it from there into the Homeassistant Container’s site-packages directory.

I will look that up; thanks.

Btw, did you experience this problem too:


(random itach ports not starting correctly).

I didn’t have that issue when I only had an IP2IR on my system… but as I setup more of them on my system, the latter ones couldn’t start up correctly despite trying to restart multiple times.

UPDATE:
I have a “production” system running HA using python venv, but I also have a “sandbox” Hassio (officially Home Assistant). I took the itach shared library file that I compiled on my production system and copied it to my sandbox Hassio system. Both of these systems have the same linux CPU architecture/machine (in my case $ uname -m => x86_64), so compiling on one system and copying to another should work. I ran a test to see if the itach shared library file would work within the Hassio’s Home Assistant container, and it indeed did work!!

There is a problem however that dawned on me when using Hassio that I wanted to point out. When you update say from 0.117.x to 0.118, the update replaces the old Home Assistant container with the new one and whatever files you extraneously added (like the itach shared library) to its site-packages directory will disappear after the container upgrade. The workaround for this will probably to be make the itach component a custom component as it will live under the config directory which remains intact after an upgrade.

Finally, on your question about problems with multiple IP2IR devices…I only have one IP2IR, so haven’t run into this before.

That’s great!
Ok noted; only major version? 0.117.x updates should be ok?

I don’t suppose I can get a copy of your x86_64 binary to try on my hassio?

This will hold true for any updates, major or minor.

I placed the compiled shared library file for x86_64 in the repository.