zivillian / ism7mqtt

GNU General Public License v3.0
49 stars 8 forks source link

Use of oldism7proxy on RPi4 with HASS OS #80

Open mr-gosh opened 8 months ago

mr-gosh commented 8 months ago

I tried to use the HASS Plugin to add 2-way communication to my homeassistant instance but as my Ism7i is Version 1.7 u need the oldism7proxy in between. at first i tried to see if that should be integrated into the HASS OS Plugin but that doesn't seem to be planned - so i tried to execute the oldis7mproxy binary release on the HOSS OS on an RPi4 directly - but i get different error messages regarding that:

in zsh shell: ./oldism7proxy: ./oldism7proxy: cannot execute bianry file

that could be related to zsh and i tried it in bash: ./oldism7proxy: cannot execute: required file not found

I used the arm and arm64 versions to be sure its not related to that. Any Ideas?

zivillian commented 7 months ago

Sadly I have no idea what is missing. Can you run it with strace and post the output?

strace ./oldism7proxy
mr-gosh commented 7 months ago

It was a bit tricky - but after understanding that packages in HASS OS are installed via apk add strace I got this output:

execve("./oldism7proxy", ["./oldism7proxy"], 0x7ff6552900 /* 33 vars */) = -1 ENOENT (No such file or directory)
strace: exec: No such file or directory
+++ exited with 1 +++
zivillian commented 7 months ago

Are you sure, that you copied the binary? The error message states, that the file is missing.

mr-gosh commented 7 months ago

Well I extracted the release from GitHub on my notebook and tested that the communication works that way. After that was verified I copied the Arm version to the pi and extracted the whole archive there and tried the same and it doesn't work.

Did anyone test if the binary that is released containes everything that is needed to be executable on an arm platform?

zivillian commented 7 months ago

I've looked at the archive from the latest release and it seems to be complete.

You wrote you copied the binaries from your notebook - is this running windows? The maybe you need to make the oldismproxy binary executable:

chmod +x oldismproxy
mr-gosh commented 7 months ago

I am not using Windows - I am on Linux. And i tried the x86 version first and everything worked. Than I copied the ARM Version to the pi and the directory looks like this:

➜  ism7proxy ll                 
total 34M    
-rw-r--r--    1 root     root        6.7M Nov  1 19:40 BouncyCastle.Cryptography.dll
-rw-r--r--    1 root     root        7.5K Nov  1 19:40 Microsoft.Win32.Primitives.dll
-rw-r--r--    1 root     root       38.0K Nov  1 19:40 Mono.Options.dll
-rw-r--r--    1 root     root       30.0K Nov  1 19:40 System.Collections.Concurrent.dll
-rw-r--r--    1 root     root       22.0K Nov  1 19:40 System.Collections.Immutable.dll
-rw-r--r--    1 root     root       19.5K Nov  1 19:40 System.Collections.NonGeneric.dll
-rw-r--r--    1 root     root       12.0K Nov  1 19:40 System.Collections.Specialized.dll
-rw-r--r--    1 root     root       19.5K Nov  1 19:40 System.Collections.dll
-rw-r--r--    1 root     root        9.5K Nov  1 19:40 System.ComponentModel.Primitives.dll
-rw-r--r--    1 root     root       85.0K Nov  1 19:40 System.ComponentModel.TypeConverter.dll
-rw-r--r--    1 root     root        5.0K Nov  1 19:40 System.ComponentModel.dll
-rw-r--r--    1 root     root       57.5K Nov  1 19:40 System.Console.dll
-rw-r--r--    1 root     root       59.5K Nov  1 19:40 System.Diagnostics.DiagnosticSource.dll
-rw-r--r--    1 root     root        8.5K Nov  1 19:40 System.Diagnostics.StackTrace.dll
-rw-r--r--    1 root     root       49.5K Nov  1 19:40 System.Formats.Asn1.dll
-rw-r--r--    1 root     root       23.5K Nov  1 19:40 System.IO.Compression.Brotli.dll
-rw-r--r--    1 root     root       42.0K Nov  1 19:40 System.IO.Compression.dll
-rw-r--r--    1 root     root       27.5K Nov  1 19:40 System.IO.MemoryMappedFiles.dll
-rw-r--r--    1 root     root       13.5K Nov  1 19:40 System.Linq.dll
-rw-r--r--    1 root     root        6.5K Nov  1 19:40 System.Memory.dll
-rw-r--r--    1 root     root      495.5K Nov  1 19:40 System.Net.Http.dll
-rw-r--r--    1 root     root       27.5K Nov  1 19:40 System.Net.NameResolution.dll
-rw-r--r--    1 root     root       30.5K Nov  1 19:40 System.Net.NetworkInformation.dll
-rw-r--r--    1 root     root       70.5K Nov  1 19:40 System.Net.Primitives.dll
-rw-r--r--    1 root     root       92.0K Nov  1 19:41 System.Net.Quic.dll
-rw-r--r--    1 root     root      182.0K Nov  1 19:41 System.Net.Security.dll
-rw-r--r--    1 root     root      127.0K Nov  1 19:41 System.Net.Sockets.dll
-rw-r--r--    1 root     root        5.0K Nov  1 19:41 System.Numerics.Vectors.dll
-rw-r--r--    1 root     root       13.0K Nov  1 19:41 System.ObjectModel.dll
-rw-r--r--    1 root     root        1.8M Nov  1 19:41 System.Private.CoreLib.dll
-rw-r--r--    1 root     root       72.0K Nov  1 19:41 System.Private.Uri.dll
-rw-r--r--    1 root     root      103.5K Nov  1 19:41 System.Reflection.Metadata.dll
-rw-r--r--    1 root     root        3.0K Nov  1 19:41 System.Runtime.CompilerServices.Unsafe.dll
-rw-r--r--    1 root     root        7.0K Nov  1 19:41 System.Runtime.InteropServices.RuntimeInformation.dll
-rw-r--r--    1 root     root        5.5K Nov  1 19:41 System.Runtime.Intrinsics.dll
-rw-r--r--    1 root     root       37.5K Nov  1 19:41 System.Runtime.Numerics.dll
-rw-r--r--    1 root     root        9.5K Nov  1 19:41 System.Runtime.dll
-rw-r--r--    1 root     root       91.5K Nov  1 19:41 System.Security.Cryptography.Algorithms.dll
-rw-r--r--    1 root     root       13.0K Nov  1 19:41 System.Security.Cryptography.Csp.dll
-rw-r--r--    1 root     root       28.0K Nov  1 19:41 System.Security.Cryptography.Encoding.dll
-rw-r--r--    1 root     root       46.0K Nov  1 19:41 System.Security.Cryptography.OpenSsl.dll
-rw-r--r--    1 root     root       20.0K Nov  1 19:41 System.Security.Cryptography.Primitives.dll
-rw-r--r--    1 root     root      197.5K Nov  1 19:41 System.Security.Cryptography.X509Certificates.dll
-rw-r--r--    1 root     root      105.0K Nov  1 19:41 System.Text.RegularExpressions.dll
-rw-r--r--    1 root     root       30.0K Nov  1 19:41 System.Threading.Channels.dll
-rw-r--r--    1 root     root       11.5K Nov  1 19:41 System.Threading.dll
-rw-r--r--    1 root     root        5.0K Nov  1 19:41 System.dll
-rw-r--r--    1 root     root       78.1K Nov  1 19:41 createdump
-rw-r--r--    1 root     root       49.9K Nov  1 19:41 libSystem.Globalization.Native.so
-rw-r--r--    1 root     root      693.9K Nov  1 19:41 libSystem.IO.Compression.Native.so
-rw-r--r--    1 root     root       61.8K Nov  1 19:41 libSystem.Native.so
-rw-r--r--    1 root     root       17.9K Nov  1 19:41 libSystem.Net.Security.Native.so
-rw-r--r--    1 root     root      113.8K Nov  1 19:41 libSystem.Security.Cryptography.Native.OpenSsl.so
-rw-r--r--    1 root     root        1.4M Nov  1 19:41 libclrjit.so
-rw-r--r--    1 root     root        4.3M Nov  1 19:41 libcoreclr.so
-rw-r--r--    1 root     root      568.1K Nov  1 19:41 libcoreclrtraceptprovider.so
-rw-r--r--    1 root     root      471.3K Nov  1 19:41 libdbgshim.so
-rw-r--r--    1 root     root      210.0K Nov  1 19:41 libhostfxr.so
-rw-r--r--    1 root     root      194.0K Nov  1 19:41 libhostpolicy.so
-rw-r--r--    1 root     root        1.5M Nov  1 19:41 libmscordaccore.so
-rw-r--r--    1 root     root        1.1M Nov  1 19:41 libmscordbi.so
-rw-r--r--    1 root     root        7.5K Nov  1 19:41 netstandard.dll
-rwxr-xr-x    1 root     root       59.1K Nov  1 19:41 oldism7proxy
-rw-r--r--    1 root     root       11.7M Nov  7 14:31 oldism7proxy-linux-arm.zip
-rw-r--r--    1 root     root       26.9K Nov  1 19:41 oldism7proxy.deps.json
-rw-r--r--    1 root     root       21.0K Nov  1 19:41 oldism7proxy.dll
-rw-r--r--    1 root     root       13.6K Nov  1 19:41 oldism7proxy.pdb
-rw-r--r--    1 root     root        1.0K Nov  1 19:41 oldism7proxy.runtimeconfig.json
-rw-r--r--    1 root     root         175 Nov  9 10:11 output.txt

as you can see the binary got executable rights from me after i extracted the oldism7proxy-linux-arm.zip on the cmd.

Don't know which missing file he is complaining about. :(

mr-gosh commented 7 months ago

Are You sure the oldism7proxy works an ARM - or are any additional packages needed?

I tested it on an old pi Linux 5.10.103+ #1529 Tue Mar 8 12:19:18 GMT 2022 armv6l GNU/Linux and it doesn't run the proxy:

strace ./oldism7proxy
execve("./oldism7proxy", ["./oldism7proxy"], 0xbe9737c0 /* 17 vars */) = 0
brk(NULL)                               = 0x1b7f000
uname({sysname="Linux", nodename="volkszaehler", ...}) = 0
readlink("/proc/self/exe", "/home/user/oldism7proxy/oldism7p"..., 4096) = 36
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/home/user/oldism7proxy/netcoredeps/tls/v6l/vfp/libpthread.so.0", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
stat64("/home/user/oldism7proxy/netcoredeps/tls/v6l/vfp", 0xbeb40c10) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/home/user/oldism7proxy/netcoredeps/tls/v6l/libpthread.so.0", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
stat64("/home/user/oldism7proxy/netcoredeps/tls/v6l", 0xbeb40c10) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/home/user/oldism7proxy/netcoredeps/tls/vfp/libpthread.so.0", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
stat64("/home/user/oldism7proxy/netcoredeps/tls/vfp", 0xbeb40c10) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/home/user/oldism7proxy/netcoredeps/tls/libpthread.so.0", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
stat64("/home/user/oldism7proxy/netcoredeps/tls", 0xbeb40c10) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/home/user/oldism7proxy/netcoredeps/v6l/vfp/libpthread.so.0", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
stat64("/home/user/oldism7proxy/netcoredeps/v6l/vfp", 0xbeb40c10) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/home/user/oldism7proxy/netcoredeps/v6l/libpthread.so.0", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
stat64("/home/user/oldism7proxy/netcoredeps/v6l", 0xbeb40c10) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/home/user/oldism7proxy/netcoredeps/vfp/libpthread.so.0", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
stat64("/home/user/oldism7proxy/netcoredeps/vfp", 0xbeb40c10) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/home/user/oldism7proxy/netcoredeps/libpthread.so.0", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
stat64("/home/user/oldism7proxy/netcoredeps", 0xbeb40c10) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=40719, ...}) = 0
mmap2(NULL, 40719, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb6f7e000
close(3)                                = 0
openat(AT_FDCWD, "/lib/arm-linux-gnueabihf/libpthread.so.0", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\224O\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=130416, ...}) = 0
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6f7c000
mmap2(NULL, 168560, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb6f2e000
mprotect(0xb6f45000, 61440, PROT_NONE)  = 0
mmap2(0xb6f54000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x16000) = 0xb6f54000
mmap2(0xb6f56000, 4720, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb6f56000
close(3)                                = 0
openat(AT_FDCWD, "/lib/arm-linux-gnueabihf/libdl.so.2", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0 \n\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=9768, ...}) = 0
mmap2(NULL, 73924, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb6f1b000
mprotect(0xb6f1d000, 61440, PROT_NONE)  = 0
mmap2(0xb6f2c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0xb6f2c000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/arm-linux-gnueabihf/libstdc++.so.6", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0@\343\6\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=1265528, ...}) = 0
mmap2(NULL, 1337068, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb6dd4000
mprotect(0xb6f02000, 65536, PROT_NONE)  = 0
mmap2(0xb6f12000, 28672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x12e000) = 0xb6f12000
mmap2(0xb6f19000, 5868, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb6f19000
close(3)                                = 0
openat(AT_FDCWD, "/lib/arm-linux-gnueabihf/libm.so.6", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\240r\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=464392, ...}) = 0
mmap2(NULL, 528504, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb6d52000
mprotect(0xb6dc3000, 61440, PROT_NONE)  = 0
mmap2(0xb6dd2000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x70000) = 0xb6dd2000
close(3)                                = 0
openat(AT_FDCWD, "/lib/arm-linux-gnueabihf/libgcc_s.so.1", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\270\321\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=116324, ...}) = 0
mmap2(NULL, 180532, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb6d25000
mprotect(0xb6d41000, 61440, PROT_NONE)  = 0
mmap2(0xb6d50000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b000) = 0xb6d50000
close(3)                                = 0
openat(AT_FDCWD, "/lib/arm-linux-gnueabihf/libc.so.6", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\fy\1\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1291908, ...}) = 0
mmap2(NULL, 1360668, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb6bd8000
mprotect(0xb6d10000, 61440, PROT_NONE)  = 0
mmap2(0xb6d1f000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x137000) = 0xb6d1f000
mmap2(0xb6d22000, 8988, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb6d22000
close(3)                                = 0
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6f7a000
set_tls(0xb6f7a500)                     = 0
mprotect(0xb6d1f000, 8192, PROT_READ)   = 0
mprotect(0xb6d50000, 4096, PROT_READ)   = 0
mprotect(0xb6dd2000, 4096, PROT_READ)   = 0
mprotect(0xb6f12000, 20480, PROT_READ)  = 0
mprotect(0xb6f2c000, 4096, PROT_READ)   = 0
mprotect(0xb6f54000, 4096, PROT_READ)   = 0
mprotect(0x4e4000, 4096, PROT_READ)     = 0
mprotect(0xb6f88000, 4096, PROT_READ)   = 0
munmap(0xb6f7e000, 40719)               = 0
set_tid_address(0xb6f7a0a8)             = 12928
set_robust_list(0xb6f7a0b0, 12)         = 0
rt_sigaction(SIGRTMIN, {sa_handler=0xb6f328e8, sa_mask=[], sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0xb6c051c0}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {sa_handler=0xb6f329a4, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0xb6c051c0}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
ugetrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
brk(NULL)                               = 0x1b7f000
brk(0x1ba0000)                          = 0x1ba0000
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x52b1c6} ---
+++ killed by SIGSEGV +++
Speicherzugriffsfehler
mr-gosh commented 5 months ago

Is anyone able to execute oldism7proxy on arm at all?

zivillian commented 3 months ago

I've tested it on my RPi4 and it worked:

pi@piaware:~/ism7 $ uname -a
Linux piaware 6.1.21-v7l+ #1642 SMP Mon Apr  3 17:22:30 BST 2023 armv7l GNU/Linux
pi@piaware:~/ism7 $ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye
pi@piaware:~/ism7 $ ./oldism7proxy
  -i, --ipAddress=VALUE      Wolf Hostname or IP address
  -d, --debug                dump raw xml messages
  -h, --help                 show help
Chris2834 commented 2 months ago

Is anyone able to execute oldism7proxy on arm at all?

yes, running on rpi3 with Raspian 11 (Bullseye) on extra machine for testing; so far ok; no issue to integrate in HA pointing to proxy.

I also do have a strong interest in running on HASS OS. Any hint / idea?

mr-gosh commented 2 months ago

That is strange - can you explain what you exactly did to run it? Ob my rpis the binaries are not executable.... 😕