Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
Hi,
I have two questions,
1. I am using Thingworx 9.0, I want to show live CCTV streaming on thingworx mashup how can I do that?
Please send me any architecture diagram to connect CCTV camera to thingworx.
Does anyone know how to work? Much appreciated.
2. I have sensor data in the hex format which in the attachment file, I want to convert it into a readable format.
I have tried with some javascript program which is given below but it is giving me the wrong result please check attachment for output. please suggest
var hex1 = HextData.toString();
var str = '';
for (var n = 0; n < hex1.length; n += 3) {
str += String.fromCharCode(parseInt(hex1.substr(n, 6), 16));
}
var result = str;
Does anyone know how to work? Much appreciated.
I took a look at your questions:
Peter
Thanks for your reply
In the second question,
I have some hex data which was sent by my client and I received it from my end.I have to convert that hex data into a simple human-readable format( consider English).
Please check below hex data sent by the client.
55 55 00 5A 21 41 02 00 00 38 36 31 32 35 31 30 33 38 30 33 39 33 39 39 A5 08 D1 5D FC 2C 82 39 F9 6E 34 BF 14 B1 61 89 B5 E3 A4 2C 88 F4 A8 AA 0B 43 78 EE 7C 37 6A 94 27 A1 20 BF AF C7 3D F0 FE 25 B1 6D E7 4E F6 3A 35 3A D5 0F 91 83 0D 80 36 97 70 F6 DC E8 0A 81 AA AA
55 55 00 5A 21 41 02 00 00 38 36 31 32 35 31 30 33 38 30 33 39 33 39 39 A5 08 D1 5D FC 2C 82 39 F9 6E 34 BF 14 B1 61 89 B5 E3 A4 2C 88 F4 A8 AA 0B 43 78 EE 7C 37 6A 94 27 A1 20 BF AF C7 3D F0 FE 25 B1 6D E7 4E F6 3A 35 3A D5 0F 91 83 0D 80 36 97 70 F6 DC E8 0A 81 AA AA
UU *!A 861251038039399ûGæ¦l-*Rá-+ph顱¬¬
UU *!A 861251038039399ûGæ¦l-*Rá-+ph顱¬¬
how we can get proper data conversion so we can read the data what exactly it is.
please suggest
I am not sure I can assist with the translation you are requesting. The hex data which is being returned may not be ascii information. When I place the information in a web page which converts HEX to ASCII I get
"UUZ!A861251038039399¥Ñ]ü,9ùn4¿±aµã¤,ô¨ªCxî|7j'¡ ¿¯Ç=ðþ%±mçNö:5:Õ
6pöÜè
ªª"
which is similar to the strings displayed at the bottom of the hex data. When I look at the data a byte of "00" is sometimes to terminate a string. If that is the case then the entire string is "UU"? If you know the format of the data, a translation might be possible. If you divide the HEX bytes into the proper groups then the values can be translated. The HEX bytes might represent values and not ASCII characters. If you know what is sending the HEX characters it may provide the description of the information.
Hope that helps
Peter
Here is the data format in which data has to be converted sent by the client.
(Frame header)5555+(Message length)001C+ (Protocol Version)2050 + _(Encryption)01 + _(Reserved)0000+ (Device ID)383634383637303232353131303135+(Frame type)03+(Frame number)1234 + (Data length)0004 + (Effective data)01020304 + (Checksum)AB12CD34 + (Frame end)AAAA
KEY: E1 B7 A1 8B 09 13 F7 8E C0 89 8E D6 28 2D D8 D3 15 00 3F 6B FD A4 69 6E 15 00 3F 6B FD A4 69 6E
Plaintext: 55 55 00 2A 21 41 02 00 00 38 36 31 32 35 31 30 33 38 30 33 39 33 39 39 0C 00 04 00 06 5A 7A D0 42 00 8D 55 45 06 2B FF AA AA
Encrypted(send to MQTT server): 55 55 00 2A 21 41 02 00 00 38 36 31 32 35 31 30 33 38 30 33 39 33 39 39 CE 74 70 12 8F 2B 3C 0C 70 E6 B1 CB D9 A2 4F 9A AA AA
The part of the plaintext that needs to be encrypted is 0C 00 04 00 06 5A 7A D0 42 00 8D 55 45 06 2B, the length is 15, so we must filling one byte FF to ensure 16-byte aligned, then encrypt the filled data with AES256_ECB algorithm, we will get the result. The following picture is for reference
The above format sent by my client please suggest the way.
I am not sure what you are trying to accomplish. Are you trying to build message which will get sent to a remote system? Are you trying to extract data from a message which was received by ThingWorx?
I do not believe that there is an existing service which decodes these messages. The example you displayed 3 fields, KEY, Plaintext, and Encrypted. What factor does the KEY play in your process?
I am not sure I understand the content of the Plain Text message. If you can provide context maybe I can assist.
I have tried to decode the plain text message and am not finding a ascii message.
From your format:
header (55 55).
Message length (00 2A) = this would be 42 bytes - the total message is too short
protocol version (21 41) = would this be decimal 8513?
Encryption (02) = ?
Reserved (00 00)
Device ID (38 36 31 32 35 31 30 33 38 30 33 39 33 39 39) = 383631323531303338303339333939 ?
Frame Type (0C) = ?
Frame Number (00 04) = ?
Data length (00 06) = 6
Data (5A 7A D0) = if this is ascii it would be "Zz" and a control character
Effective Date (42 00 8D 55 ) = ?
check sum (45 06 2B FF ) = what method of calculation of check sum?
Frame End (AA AA)
I have tried to decode it but I only get DEVICE ID from data that is sent. I just want to know given string contains only the device id or anything else that I forgot to get.
Please check the attachment which will show what exact data is sent by my client in HEX format