Closed CatsBy119 closed 1 year ago
It is. The text field backend is html, so you'll have to use the html notation. https://www.ascii-code.com/
It should be something such as \A\A \B\B ...
It looks a little messy but should do the trick. This technique was done to resolve an issue where somebody wanted to use non-printable characters such as a line feed.
Thanks for your reply.
Using Wireshark, I have found the following results:
CommandSender input: AA BB 02 0C 01 Hex code captured by Wireshark: 41 41 20 42 42 20 30 32 20 30 32 20 30 43 20 30 31
Referring to https://www.ascii-code.com/ Hex (41) = Symbol (A) Hex (42) = Symbol (B) Hex (20) = Symbol (SP) the Description is "Space"
Therefore: 41 41 20 42 42 = "AA BB"
This appears to mean that the CommandSender input needs to be in the "Symbol format". Unfortunately, that does not work because some symbols are not recognised and are interpreted as Hex 3F.
It would help if you could quote the CommandSender input that would be interpreted as HEX AA BB 02 0C 01 by the receiving device.
Thanks.
Hey CatsBy119, I apologize for the late response. I was out on vacation for two weeks and had responded the night before heading on a plane. I noticed that my previous comment got autoformatted to not show the hex notation I had specified. And I slightly misinterpreted what you were trying to do. Was treating it as a string instead.
So if this is your hexadecimal AA BB 02 0C 01
you could do
ª »   
I hope I understood that correctly and that helps get you what you need.
I've reopened this until I get further word whether that does the trick.
Hi David,
Thanks for reaching out. I tried your suggestion but it didn’t work.
I have attached a couple of screen snips to show you what I am trying to achieve versus what CommandSender does.
In this case I want to use CommandSender to switch the Inputs and Outputs on a 4x3 KVM switch. The KVM accepts commands in Hex format only.
FYI, I am currently using CommandSender to switch the Inputs/outputs on a 8x8 Video Matrix unit. It works brilliantly BUT that that unit was supplied with commands in both Hex and ASCII formats. I use the ASCII commands with CommandSender.
Regards,
Andrew (CaysBy119)
Snip 1.
I have used an application called “Packet Sender” to transmit the command (in Hex) “aa bb 02 0a 02:” to my KVM switch. This particular command switches Output 1 to Input 2.
The packet transmitted is captured with “Wire Shark”.
As you can see from the screen snip, the packet transmitted contains 5 bytes and is captured in Hex as “aa bb 02 0a 02”. The ACSII representation of that is shown on the right hand side as “..”
Snip 2.
I have used CommandSender to transmit “ª »  https://github.com/Zayik/CommandSender/issues/2 ;  https://github.com/Zayik/CommandSender/issues/12 ;  https://github.com/Zayik/CommandSender/issues/1 ;” and have captured that packet with Wire Shark.
As you can see from the screen snip, the packet contains 29 bytes and is captured in Hex as “26 23 31 37 30 3b 20 26 23 31 38 37 3b 20 26 23 32 3b 20 26 23 31 32 3b 20 26 23 31 3b”
The ACSII representation of that is shown on the right hand side as “ª »  https://github.com/Zayik/CommandSender/issues/2 ;  https://github.com/Zayik/CommandSender/issues/12 ;  https://github.com/Zayik/CommandSender/issues/1 ;” suggesting that CommandSender is transmitting data in ASCII format(?)
This screenshots didn't come through. That being said, I have made the grave mistake of forgetting that I removed the string being backed by html encoding schema a while ago to make it fall in line a bit more with how packet sender can operate.
Been way too long since I've looked at this.
Try the following:
Instead of using \ÿ to represent the html notation, use the oct notation: \u0255 \u0273 ...
Snips added to previous post.
The oct notation doesn’t work either. I tried this… \u0252 \u0252 \u0273 \u0273 (Hex: AA BB)
Wire Shark captures 7 bytes (it captures the spaces too) Hex captured = 3f 20 3f 20 3f 20 3f ASCII = ? ? ? ?
Replacing the spaces with ; results in this:
Data 7 bytes Hex captured = 3f 3b 3f 3b 3f 3b 3f ASCII = ?;?;?;?
Given that both \u0252 and \u0273 are captured in Hex as “3F” it seems that it does not recognise the oct notation.
I appreciate your patience in all of this. I've been digging into this and it turns out that an encoding I used for converting text into bytes did not support extended ascii characters. Funny enough, the encoding I was using was the ASCII encoding.
I created a pre-release which I hope can resolve the issue. https://github.com/Zayik/CommandSender/releases/tag/v1.2.0
I was able to use the following: \xaa\xbb\x02\x0c\x01
to send the hex "AA BB 02 0C 01"
Please give this a try :)
That works brilliantly! Thanks for all your work on this plugin,
As someone who isn't very well versed on all of this, I need to send this set of Hex values to a device: 0x21 0x01 0x08 0x02 0x10 0x7D 0x0D
How do I translate this to the correct syntax for CommandSender?
Hex values to a device: 0x21 0x01 0x08 0x02 0x10 0x7D 0x0D
replace the "0x" with "\x" and remove the spaces \x21\x01\x08\x02\x10\x7D\x0D
As per kacos2000's comment. Note that \x0D is a "carriage return" that may or may not be required by your device. I had to combine that hex with the ASCII commands for my video matrix as that device requires a carriage return to be entered with each IP command. For example, to switch Output 1 to Input 7
Removing the carriage return did the trick for me!
Glad to see people are still interested in this. I've also started a discussions page for any general questions, as they might be more visible than commenting on a closed issue. :)
Is it possible to send commands in hexadecimal with CommandSender? For example how send: AA BB 02 0C 01