pschmitt / tesmart.sh

Shell API wrapper for network-enabled TESmart KVM switches
https://github.com/pschmitt/tesmart.sh
GNU General Public License v3.0
9 stars 3 forks source link

Unable to determine input ID #1

Open taylor-schneider opened 2 years ago

taylor-schneider commented 2 years ago

Hello,

Thank you very much for writing this utility! I have been using it for some time and it is very helpful.

Recently I am seeing the following error:

pilot@tinypilot:~ $ bash tesmart.sh --debug get-input
Alias config /home/pilot/config.sh: No such file or directory
Sending "\xaa\xbb\x03\x10\x00\xee" to 15.4.3.2:5000
ncat detected
Invoking $ nc -n -w 1 15.4.3.2 5000
Raw output: $
Printable output: ""
Sending "\xaa\xbb\x03\x10\x00\xee" to 15.4.3.2:5000
ncat detected
Invoking $ nc -n -w 1 15.4.3.2 5000
Raw output: $
Printable output: ""
Sending "\xaa\xbb\x03\x10\x00\xee" to 15.4.3.2:5000
ncat detected
Invoking $ nc -n -w 1 15.4.3.2 5000
Raw output: $
Printable output: ""
Sending "\xaa\xbb\x03\x10\x00\xee" to 15.4.3.2:5000
ncat detected
Invoking $ nc -n -w 1 15.4.3.2 5000
Raw output: $
Printable output: ""
Sending "\xaa\xbb\x03\x10\x00\xee" to 15.4.3.2:5000
ncat detected
Invoking $ nc -n -w 1 15.4.3.2 5000
Raw output: $
Printable output: ""
Sending "\xaa\xbb\x03\x10\x00\xee" to 15.4.3.2:5000
ncat detected
Invoking $ nc -n -w 1 15.4.3.2 5000
Raw output: $
Printable output: ""
Sending "\xaa\xbb\x03\x10\x00\xee" to 15.4.3.2:5000
ncat detected
Invoking $ nc -n -w 1 15.4.3.2 5000
Raw output: $
Printable output: ""
Sending "\xaa\xbb\x03\x10\x00\xee" to 15.4.3.2:5000
ncat detected
Invoking $ nc -n -w 1 15.4.3.2 5000
Raw output: $
Printable output: ""
Sending "\xaa\xbb\x03\x10\x00\xee" to 15.4.3.2:5000
ncat detected
Invoking $ nc -n -w 1 15.4.3.2 5000
Raw output: $
Printable output: ""
Sending "\xaa\xbb\x03\x10\x00\xee" to 15.4.3.2:5000
ncat detected
Invoking $ nc -n -w 1 15.4.3.2 5000
Raw output: $
Printable output: ""
$ hexdump -C ->              -> HEX=
             -> DEC=
❌ Unable to determine input ID
❌ Failed to determine current input.

I dont know why this is happening. The windows utility is working using the same ip and port without issue.

Would it be possible to add a more verbose explanation of what went wrong in the output message? Any thoughts on why this stopped working?

pschmitt commented 2 years ago

Oh, a user! :)

Could you please share the output of the following commands?

pschmitt commented 2 years ago

and what type of device are you targeting here?

Casuallynoted commented 1 year ago

Oh, a user! :)

Could you please share the output of the following commands?

  • bash -x tesmart.sh --debug get-input
  • ncat --version

I'm having the exact same issue, I'm on a raspberry pi 4.

https://gist.github.com/Casuallynoted/a0dd39508a5aa1c16a4a1931ad90bcb6 is the output of the first command, and the second command gives me: Ncat: Version 7.80 ( https://nmap.org/ncat )

I'm also noticing that I'm getting this error when I try to nc the switch manually: read(net): Connection reset by peer If I reset the switch, the error goes away but it quickly comes back.

lonedevel commented 1 year ago

I'm having a similar issue on MacOS Ventura 13.1 and am running ncat 7.93. Also I noticed that the debug line on 30 and the command on line 33 are using nc which on MacOS is specific to MacOS, so I switched the command to use ncat but gets the same issues as others. I tried this in Ubuntu 22.04 and it works perfectly!

jose-a-rodrigues-alb commented 1 year ago

Having the same problem on MacOs. Let me know if i can help debugging.

jose-a-rodrigues-alb commented 1 year ago

If anyone is interested i was able to make the script work correctly on my mac with macOS monterey, with the changes present on the patch file attached. macos.patch

@pschmitt Interested in a PR with this changes? not sure if breaks anything on other OSes...

pschmitt commented 1 year ago

Sure, there are already similar PRs open though.

pschmitt commented 1 year ago

That sleep statement is very odd btw ;)