Announcement

Collapse
No announcement yet.

Help: Error Failed to Initialize screenlogycpy [SOLVED]

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Help: Error Failed to Initialize screenlogycpy [SOLVED]

    First of all really excited to see there is a screenlogic plugin. Just need a little help to get it working.

    When I enable the plugin on my HS4 Standard Edition 4.2.13.0 (Linux) environment I get the Failed to Initialize screenlogycpy Any suggestions on how to get this going?


    07/01/2022 17:13:14 ScreenLogic Error Failed to Poll ScreenLogic Adapter: [Pentair: 16-C7-8C]; Failed to execute /usr/local/HomeSeer/bin/ScreenLogic/screenlogicpy
    07/01/2022 17:13:14 ScreenLogic Info Configured Adapters: [Pentair: 16-C7-8C] @ 192.168.1.135
    07/01/2022 17:13:13 ScreenLogic Info Performing Adapter Auto-Discovery across all available subnets
    07/01/2022 17:13:12 HomeSeer Plug-In Finished initializing plug-in ScreenLogic
    07/01/2022 17:13:12 HomeSeer Starting Plug-In ScreenLogic loaded in 916 milliseconds
    07/01/2022 17:13:12 HomeSeer Starting Plug-In Plugin ScreenLogic started successfully in 150 milliseconds
    07/01/2022 17:13:12 ScreenLogic Debug ScreenLogic Plugin is Operational
    07/01/2022 17:13:12 ScreenLogic Info Polling Adapters every 30 seconds
    07/01/2022 17:13:12 ScreenLogic Error Failed to Initialize screenlogycpy; /bin/bash Home : Unknown Environment : Linux ubuntu 5.4.0-1065-raspi #75-Ubuntu SMP PREEMPT Fri Jun 3 14:24:57 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux

    07/01/2022 17:13:12 ScreenLogic Debug Operating System: Linux
    07/01/2022 17:13:12 ScreenLogic Info Plugin Initializing

    #2
    I forgot to indicate this is running on a Raspberry Pi 4.

    Comment


      #3
      Thanks! I'm glad you're excited. 😁

      I'm sorry your having trouble with the plugin, however I think we can figure this out. These are the growing pains having code run on different systems.

      There are 3 executables in the /usr/local/HomeSeer/bin/ScreenLogic directory, and the initialize.sh script decides which one to run based the results of uname command
      • screenlogicpy.arm ... for Linux on the Pi
      • screenlogicpy.exe ... for Windows
      • screenlogicpy.x86 ... for Linux on Intel
      Your "uname" command reports: Linux ubuntu 5.4.0-1065-raspi #75-Ubuntu SMP PREEMPT Fri Jun 3 14:24:57 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux

      Your on the Pi, so AS ROOT, try running:

      Code:
      cd /usr/local/HomeSeer/bin/ScreenLogic
      chmod +x screenlogicpy.arm
      ./screenlogicpy.arm
      If this works, BACKUP and then replace your /usr/local/HomeSeer/bin/ScreenLogic/initialize.sh with the code below, then restart the plugin. This will see the "raspi" in your uname command and copy the correct executable.

      Let me know how this goes.
      Thanks! /keith


      Code:
      #!/bin/bash
      #
      # HSPI ScreenLogic Initialize
      #
      # Ensures screenlogicpy is correct for this platform and executable
      #
      #
      SCREENLOGICPY="./screenlogicpy"
      
      chmod +x ./bin/ScreenLogic/screenlogicpy.sh
      
      UNAME=$(eval "uname -a")
      if [[ $UNAME == *"raspi"* ]]; then
      echo "Init screenlogicpy for the Pi/Linux"
      cp ./bin/ScreenLogic/screenlogicpy.arm ./bin/ScreenLogic/screenlogicpy; chmod +x ./bin/ScreenLogic/screenlogicpy
      exit 0
      elif [[ $UNAME == *"arm"* ]]; then
      echo "Init screenlogicpy for the Pi/Linux"
      cp ./bin/ScreenLogic/screenlogicpy.arm ./bin/ScreenLogic/screenlogicpy; chmod +x ./bin/ScreenLogic/screenlogicpy
      exit 0
      elif [[ $UNAME == *"x86_64"* ]]; then
      echo "Init screenlogicpy for the x86/Linux"
      cp ./bin/ScreenLogic/screenlogicpy.x86 ./bin/ScreenLogic/screenlogicpy; chmod +x ./bin/ScreenLogic/screenlogicpy
      exit 0
      elif [[ $UNAME == *"debian"* ]]; then
      echo "Init screenlogicpy for the Debian/Linux"
      cp ./bin/ScreenLogic/screenlogicpy.debian ./bin/ScreenLogic/screenlogicpy; chmod +x ./bin/ScreenLogic/screenlogicpy
      else
      echo "Unknown Environment : $UNAME"
      exit 1

      Comment


        #4
        Keith,
        Thank you for your help. I can not get past the first step. Not sure what file is missing.

        ubuntu@ubuntu:/usr/local/HomeSeer/bin/ScreenLogic$ ls -l
        total 28584
        -rw-r--r-- 1 root root 701992 Apr 19 09:20 Newtonsoft.Json.dll
        -rw-r--r-- 1 root root 710224 Apr 19 09:20 Newtonsoft.Json.xml
        -rwxr-xr-x 1 root root 865 May 3 15:42 initialize.sh
        -rw-r--r-- 1 root root 865 Jul 2 07:00 initialize.sh.old
        -rw-r--r-- 1 root root 13285768 Apr 17 09:03 screenlogicpy.arm
        -rw-r--r-- 1 root root 7587435 Apr 17 09:03 screenlogicpy.exe
        -rw-r--r-- 1 root root 6965112 Apr 17 09:03 screenlogicpy.x86
        ubuntu@ubuntu:/usr/local/HomeSeer/bin/ScreenLogic$ sudo chmod +x screenlogicpy.arm
        ubuntu@ubuntu:/usr/local/HomeSeer/bin/ScreenLogic$ ls -l
        total 28584
        -rw-r--r-- 1 root root 701992 Apr 19 09:20 Newtonsoft.Json.dll
        -rw-r--r-- 1 root root 710224 Apr 19 09:20 Newtonsoft.Json.xml
        -rwxr-xr-x 1 root root 865 May 3 15:42 initialize.sh
        -rw-r--r-- 1 root root 865 Jul 2 07:00 initialize.sh.old
        -rwxr-xr-x 1 root root 13285768 Apr 17 09:03 screenlogicpy.arm
        -rw-r--r-- 1 root root 7587435 Apr 17 09:03 screenlogicpy.exe
        -rw-r--r-- 1 root root 6965112 Apr 17 09:03 screenlogicpy.x86
        ubuntu@ubuntu:/usr/local/HomeSeer/bin/ScreenLogic$ sudo ./screenlogicpy.arm
        sudo: unable to execute ./screenlogicpy.arm: No such file or directory
        ubuntu@ubuntu:/usr/local/HomeSeer/bin/ScreenLogic$


        I attached the HomeSeer log also
        Attached Files

        Comment


          #5
          Also, I checked and it appears that your executiable is 32bit. My Pi4 support 64bit and is running the 64bit verions of Ubuntu. I am wondering if I need to install a library.

          Comment


            #6
            ubuntu@ubuntu:/usr/local/HomeSeer/bin/ScreenLogic$ file screenlogicpy.arm
            screenlogicpy.arm: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=43e34490e9d028332b4a4212935709105c527f63, stripped
            ubuntu@ubuntu:/usr/local/HomeSeer/bin/ScreenLogic$ lsb_release -a
            No LSB modules are available.
            Distributor ID: Ubuntu
            Description: Ubuntu 20.04.1 LTS
            Release: 20.04
            Codename: focal
            ubuntu@ubuntu:/usr/local/HomeSeer/bin/ScreenLogic$

            Comment


              #7
              Ah ha - File it under "nothing's easy" ... It's python code, which I've built into an executable (on 3 different systems). The intent was so the plugin isn't dependent on installing a specific version of python first.

              I don't know if installing any library will fix it or not - that would be sweet though. My first thought, I could image an SD card for my Pi and build a new executable there. Where did you get your Ubuntu image?

              It will take me a little bit to get that done (have family over for the holiday) - I'll work towards building a new executable and get it to you

              Thanks /keith

              Comment


                #8
                Keith, No hurry. Please enjoy your family with weekend. I have waited for years so whats waiting a little longer :-).

                The Raspberry Imager has Ubuntu 20.04 and 22.04 under other OS. That is where I downloaded it from.
                Very easy.

                Comment


                  #9
                  Keith, Well it not getting any easier. :-(


                  ubuntu@ubuntu:/usr/local/HomeSeer/bin/ScreenLogic$ sudo chmod +x screenlogicpy.arm64

                  ubuntu@ubuntu:/usr/local/HomeSeer/bin/ScreenLogic$ ls -l

                  total 35300

                  -rw-r--r-- 1 root root 701992 Apr 19 09:20 Newtonsoft.Json.dll

                  -rw-r--r-- 1 root root 710224 Apr 19 09:20 Newtonsoft.Json.xml

                  -rwxr-xr-x 1 root root 865 May 3 15:42 initialize.sh

                  -rw-r--r-- 1 root root 865 Jul 2 07:00 initialize.sh.old

                  -rw-r--r-- 1 root root 13285768 Apr 17 09:03 screenlogicpy.arm

                  -rwxr-xr-x 1 root root 6876472 Jul 2 21:45 screenlogicpy.arm64

                  -rw-r--r-- 1 root root 7587435 Apr 17 09:03 screenlogicpy.exe

                  -rw-r--r-- 1 root root 6965112 Apr 17 09:03 screenlogicpy.x86

                  ubuntu@ubuntu:/usr/local/HomeSeer/bin/ScreenLogic$ sudo ./screenlogicpy.arm64

                  [14689] Error loading Python lib '/tmp/_MEIcraCIQ/libpython3.10.so.1.0': dlopen: /lib/aarch64-linux-gnu/libm.so.6: version `GLIBC_2.35' not found (required by /tmp/_MEIcraCIQ/libpython3.10.so.1.0)






                  When I checked what GLIBC I had

                  ubuntu@ubuntu:/usr/local/HomeSeer/bin/ScreenLogic$ ldd --version

                  ldd (Ubuntu GLIBC 2.31-0ubuntu9.9) 2.31

                  Copyright (C) 2020 Free Software Foundation, Inc.

                  This is free software; see the source for copying conditions. There is NO

                  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

                  Written by Roland McGrath and Ulrich Drepper.

                  ubuntu@ubuntu:/usr/local/HomeSeer/bin/ScreenLogic$


                  I have done an apt update and no new updates and this error still occurs.

                  Comment


                    #10
                    I built Ubuntu 64-bit V20.04 on the Pi (previous was 22.04) please try the screenlogicpy.arm64 in the dropbox link I PM'd to you

                    From this build I get:

                    ldd --version
                    ldd (Ubuntu GLIBC 2.31-0ubuntu9.7) 2.31
                    Copyright (C) 2020 Free Software Foundation, Inc.
                    This is free software; see the source for copying conditions. There is NO
                    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
                    Written by Roland McGrath and Ulrich Drepper.

                    uname -a
                    Linux ubuntu 5.4.0-1052-raspi #58-Ubuntu SMP PREEMPT Mon Feb 7 16:52:35 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux

                    Comment


                      #11
                      YES!!!! That fixed it. Very nice. Thank you.

                      Comment


                        #12
                        Excellent - I'll include this in the next release

                        /keith

                        Comment


                          #13
                          Originally posted by keith.roberts66 View Post
                          Excellent - I'll include this in the next release

                          /keith
                          I am also facing an error that failed to initialize screenlogycpy.

                          Comment

                          Working...
                          X