09-09-2019 05:37 PM
The 2 bytes should be interpreted as a single 16 bit integer. So, 0x3193 would equal 12691, which does not seem correct for the temperature since that would equate to 1269.1 degrees Fahrenheit according to the documentation. Are you sure that you are using the correct 2 bytes. Based on the limited snippet of the documentation you posted I think your temperature would be 0x0231, which would equate to 56.1 degrees.
Without having all of the details, I would guess that the values for your inside temperature, humidity and out temperature would be the bytes 0xF902319303, with the temperatures in little endian format.
This would mean that the inside temp would be 76.1, humidity is 49% and the outside temp is 91.5. I am not sure what the extra bytes in the beginning of your data would be then.
09-09-2019 06:08 PM
I think you're correct! This is very close to the real temperature here. And my capture pic includes the beginning of the data. There is no extra data before 064C, 06 as ACK, 4C as L.
Since it is in little endian, I guess I'd better use Unflattern from String so that I can set the byte order. Sorry I still don't know how to set type. I changed the representation of constant 0 to U16. But this didn't work.
09-09-2019 07:55 PM
@feelsomoon wrote:
Yes, I did. I tired the original example and it worked. But the return data in the indicator is like. Can I add your code after the read Serial VI?
Why is your command Loop 1/n in normal display which means you are sending a literal forward slash "n" at the end. That is not a new line character.
Your command should be Loop 1\n with the control set to \codes mode which means "Loop 1<LF>" a linefeed/newline character!
09-10-2019 10:21 AM - edited 09-10-2019 10:25 AM
What I would do is define a cluster to match the definition of the protocol and unflatten the entire set of data, all 12 bytes, into that cluster. That way you have access to all of the data.
Without the entire protocol definition there was no way to know that the 0x064C was and ACK and an L, nor why they are there. The brief snippet of the protocol definition indicated the external temperature started at byte 12. In the picture you posted the temperature was located at byte 14, hence my comment about the extra data in the beginning.
09-10-2019 10:46 AM
@Mark_Yedinak wrote:
Without the entire protocol definition there was no way to know that the 0x064C was and ACK and an L, nor why they are there. The brief snippet of the protocol definition indicated the external temperature started at byte 12. In the picture you posted the temperature was located at byte 14, hence my comment about the extra data in the beginning.
The snippet is actually showing starting with ACK "LOO". Seems like the protocol is stating what it is acknowledging. But, again, this is pure conjecture without having documentation on the full protocol.
09-10-2019 12:26 PM
@crossrulz wrote:
@Mark_Yedinak wrote:
Without the entire protocol definition there was no way to know that the 0x064C was and ACK and an L, nor why they are there. The brief snippet of the protocol definition indicated the external temperature started at byte 12. In the picture you posted the temperature was located at byte 14, hence my comment about the extra data in the beginning.
The snippet is actually showing starting with ACK "LOO". Seems like the protocol is stating what it is acknowledging. But, again, this is pure conjecture without having documentation on the full protocol.
It's true. It is started with ACK LOO. I splited the part I need so its type should only be U16. I'm sorry I'm still confused about defining the type. I put a constant 0 in the cluster. Then change its representation to U16. This didn't work. Then I tried makedef. It didn't work, either. Could you teach me how to define the type for the Unflatten from String function? I know it's super basic but I've looked through many tutorials and didn't find the answer.
09-10-2019 12:29 PM
@RavensFan wrote:
@feelsomoon wrote:
Yes, I did. I tired the original example and it worked. But the return data in the indicator is like. Can I add your code after the read Serial VI?
Why is your command Loop 1/n in normal display which means you are sending a literal forward slash "n" at the end. That is not a new line character.
Your command should be Loop 1\n with the control set to \codes mode which means "Loop 1<LF>" a linefeed/newline character!
Thanks for your correction. Could you give me some suggestions about defining type in a cluster? I put a constant 0 in the cluster. Then change its representation to U16. This didn't work. Then I tried makedef. It didn't work, either. Could you teach me how to define the type for the Unflatten from String function? I know it's super basic but I've looked through many tutorials and didn't find the answer.
09-10-2019 01:23 PM - edited 09-10-2019 01:24 PM
@feelsomoon wrote:Thanks for your correction. Could you give me some suggestions about defining type in a cluster? I put a constant 0 in the cluster. Then change its representation to U16. This didn't work. Then I tried makedef. It didn't work, either. Could you teach me how to define the type for the Unflatten from String function? I know it's super basic but I've looked through many tutorials and didn't find the answer.
My question now is what is the rest of the data string you are getting? There are a lot of 0xFFs in there.
09-10-2019 01:43 PM
@crossrulz wrote:
@feelsomoon wrote:Thanks for your correction. Could you give me some suggestions about defining type in a cluster? I put a constant 0 in the cluster. Then change its representation to U16. This didn't work. Then I tried makedef. It didn't work, either. Could you teach me how to define the type for the Unflatten from String function? I know it's super basic but I've looked through many tutorials and didn't find the answer.
My question now is what is the rest of the data string you are getting? There are a lot of 0xFFs in there.
I guess it's because we put the sensor indoor. So there is no available precipitation or wind data. Sorry if I misunderstand, are you just put constant number 0 in the cluster? How does it know what size is each parameter? I did the same for the part just Outside Temperature, it didn't work. Do you know what's the problem?
09-10-2019 01:47 PM
@crossrulz wrote:
@feelsomoon wrote:Thanks for your correction. Could you give me some suggestions about defining type in a cluster? I put a constant 0 in the cluster. Then change its representation to U16. This didn't work. Then I tried makedef. It didn't work, either. Could you teach me how to define the type for the Unflatten from String function? I know it's super basic but I've looked through many tutorials and didn't find the answer.
My question now is what is the rest of the data string you are getting? There are a lot of 0xFFs in there.
I was just in the process of posting the same thing. You beat me to it. It appears that wind speed is not included in the data, or it is VERY windy there.