Author Topic: Uni-t ut-d07a Bluetooth..  (Read 17578 times)

0 Members and 1 Guest are viewing this topic.

Offline antage

  • Contributor
  • Posts: 10
  • Country: ru
Re: Uni-t ut-d07a Bluetooth..
« Reply #25 on: October 10, 2018, 12:01:54 am »
I have another question if you don't mind.  When I look at the float numbers, they appear to be followed by a string for the description.   The floats always appear to be 32-bit.   However, the string that follows does not always use the next byte following the float.   That byte may contain the actual ASCII character, a 0x20(space), 0x30 (0) and a few others.   It appears that for the first float, I could actually just skip the first byte but that's not the case for other strings.   Could you please explain what is going on?

main, aux1, aux2 values have additional byte after 32-bit float:

0 bit: positive overload (0L),
1 bit: negative overload (-0L),
4..7 bits: a number of digits after decimal point.

Unit is 0-terminated string but it has fixed length (8 bytes).
 

Offline joeqsmith

  • Super Contributor
  • ***
  • Posts: 11632
  • Country: us
Re: Uni-t ut-d07a Bluetooth..
« Reply #26 on: October 10, 2018, 12:31:45 am »
With temperature selected, the byte following the second floating point number will be a 0x11 which is the same for the byte following the first float after the start.  However, when I select resistance mode,  the byte following the first float is 0x20 followed by the 0x7e ( the Omega).   The part I don't understand is the second float will be followed with a 0x7e and then a 0x00. 

So in some cases I seem to have to treat that first byte differently.   Does your meter behave differently?
« Last Edit: October 10, 2018, 01:47:19 am by joeqsmith »
 

Offline Brannigan

  • Contributor
  • Posts: 11
  • Country: ca
Re: Uni-t ut-d07a Bluetooth..
« Reply #27 on: October 10, 2018, 04:15:37 am »
The extra formatting byte is only used on values that will be displayed in one of the 3 aux bars below the main display.

The float without the extra byte is for the bar graph, which of course, doesn't have formatting, but does have a separate unit string, terminated with 0x00.

The "regular" modes (basic measurements) all have the same length (31 bytes including function ID) except for temperature which has 32, because temperature has no bar graph but has an AUX value for T1 or T2 and needs formatting.

Also, the overload nybble has an additional condition. If the value is >2, then it signifies "data not available", as in the case of autoranging, when the meter shows ---.-

 
 

Offline antage

  • Contributor
  • Posts: 10
  • Country: ru
Re: Uni-t ut-d07a Bluetooth..
« Reply #28 on: October 10, 2018, 03:42:35 pm »
I've added partial protocol description: https://github.com/antage/ut181a/blob/master/Protocol.md
It covers measurement packet format only.
 

Offline joeqsmith

  • Super Contributor
  • ***
  • Posts: 11632
  • Country: us
Re: Uni-t ut-d07a Bluetooth..
« Reply #29 on: October 10, 2018, 05:25:42 pm »
First, again thanks to everyone.   I appreciate the dialog. 

Looking at the byte that may or may not follow a float, 
Quote
If the value is >2, then it signifies "data not available"
.   Antage's document shows the low two bits being defined.   Is a 0x3 an error (both over ranges set) or does it really mean the data is not available?

Offline antage

  • Contributor
  • Posts: 10
  • Country: ru
Re: Uni-t ut-d07a Bluetooth..
« Reply #30 on: October 10, 2018, 05:36:36 pm »
Looking at the byte that may or may not follow a float, 
Quote
If the value is >2, then it signifies "data not available"
.   Antage's document shows the low two bits being defined.   Is a 0x3 an error (both over ranges set) or does it really mean the data is not available?

When you get 0x03 what the display shows?
 

Offline antage

  • Contributor
  • Posts: 10
  • Country: ru
Re: Uni-t ut-d07a Bluetooth..
« Reply #31 on: October 10, 2018, 05:50:16 pm »
I wrote about 'data not ready' bits without checking.
Now I have checked and correct description: https://github.com/antage/ut181a/commit/2d5571e2ac8f3391b332469aafaee8759837a52b
Any of overload bits should be interpreted as 'data not ready'.
 

Offline joeqsmith

  • Super Contributor
  • ***
  • Posts: 11632
  • Country: us
Re: Uni-t ut-d07a Bluetooth..
« Reply #32 on: October 11, 2018, 01:07:05 am »
Reading your document, the bargraph always follows the AUX channels.  If the AUX channels are not used, the bargraph would follow the Main channel.   The Main channel is always the first but the other three can change their position.    It appears this how the meter works.  I assume they do this rather than hard code their locations to try and minimize the amount of data they send.   

You start with 0 offset which I assume is after the AB, CD, length, length.  It seems one byte is not accounted for.  I attached what I am seeing for the first few bytes in a packet.

Offline Brannigan

  • Contributor
  • Posts: 11
  • Country: ca
Re: Uni-t ut-d07a Bluetooth..
« Reply #33 on: October 11, 2018, 01:42:01 am »
The byte 0x02, labeled ??? is the packet ID, which tells what the response is, to differentiate it from other data responses, like recorded trend data, or saved measurements.

The auto and misc byte are a group of status bits, most of which correspond to annunciators on the LCD, like hold, record, HV, lead error and the rest are the AUX bits and modes (peak, maxmin etc), as previously discussed.
 

Offline antage

  • Contributor
  • Posts: 10
  • Country: ru
Re: Uni-t ut-d07a Bluetooth..
« Reply #34 on: October 11, 2018, 01:39:30 pm »
Reading your document, the bargraph always follows the AUX channels.  If the AUX channels are not used, the bargraph would follow the Main channel.   The Main channel is always the first but the other three can change their position.    It appears this how the meter works.  I assume they do this rather than hard code their locations to try and minimize the amount of data they send.

You're right. If the packet has main and aux1 values the bargraph value follows right after aux1. If the packet has main value only the bargraph value follows after main.

Quote
You start with 0 offset which I assume is after the AB, CD, length, length.  It seems one byte is not accounted for.  I attached what I am seeing for the first few bytes in a packet.
I'll try to clarify frame format in the documentation.
 

Offline antage

  • Contributor
  • Posts: 10
  • Country: ru
Re: Uni-t ut-d07a Bluetooth..
« Reply #35 on: October 11, 2018, 02:23:42 pm »
The auto and misc byte are a group of status bits, most of which correspond to annunciators on the LCD, like hold, record, HV, lead error and the rest are the AUX bits and modes (peak, maxmin etc), as previously discussed.

Thanks for pointing to additional bits (HV, lead error, etc). I've described it in the documentation.
 

Offline Brannigan

  • Contributor
  • Posts: 11
  • Country: ca
Re: Uni-t ut-d07a Bluetooth..
« Reply #36 on: October 11, 2018, 06:30:33 pm »
You're welcome. The two upper bits, 14 and 15 do not appear to change, and there is one bit, bit 10, that I have very occasionally seen go to 1, but I have no idea why.

The measurement word (uint_16) consists of four nybbles for:

Rotary switch position,
SELECT button,
screen menu selections (left to right, top to bottom)

and the last one is a bit odd, it represents whether the F1 or F2 key has been pressed, but when you change the rotary switch, of course it defaults to F1 implicitly.

All values are one based as is the range info.

The Range byte is of limited use, because it just shows which range is in use in any given measurement, but tells nothing about the magnitude of the range. So, range 1 is the lowest range always. I used a look-up table driven by the measurement mode and the range value to get the actual numeric range and polarity e.g. +/- 60 or 0 to 60.

Edit: Added clarification, corrected typos
« Last Edit: October 11, 2018, 10:14:07 pm by Brannigan »
 

Offline joeqsmith

  • Super Contributor
  • ***
  • Posts: 11632
  • Country: us
Re: Uni-t ut-d07a Bluetooth..
« Reply #37 on: October 12, 2018, 10:16:14 am »
Again, thanks everyone for taking the time to post some of these nuggets. 

Is bit 0 of the miscellaneous byte unused?

I was looking at some of the source code and noticed a test mode.   Can someone explain a little more about it. 


With the the 181A set to diode check mode and nothing attached to the meter.  The meter itself will display "OL", however the none of the bits 0-3 of the MISC1 byte are set.
« Last Edit: October 13, 2018, 05:32:54 pm by joeqsmith »
 

Offline Brannigan

  • Contributor
  • Posts: 11
  • Country: ca
Re: Uni-t ut-d07a Bluetooth..
« Reply #38 on: October 14, 2018, 07:12:45 pm »
I think you need to verify your test routine. On my meter, bit 3 (BAR) is set, in the diode mode.

Bit 0 applies to the first AUX bar, and it is rarely used, as it's position overlaps the bar graph.

Where you will see it set is in the MAXMIN mode.
 

Offline antage

  • Contributor
  • Posts: 10
  • Country: ru
Re: Uni-t ut-d07a Bluetooth..
« Reply #39 on: October 14, 2018, 07:47:27 pm »
With the the 181A set to diode check mode and nothing attached to the meter.  The meter itself will display "OL", however the none of the bits 0-3 of the MISC1 byte are set.
When I set diode check mode I see:
misc1 byte = 0x08 (it has bargraph value)
misc2 byte = 0x01 (auto range is on)
precision byte of main value = 0x41 (positive overload and 4 digits after decimal point)
 

Offline Brannigan

  • Contributor
  • Posts: 11
  • Country: ca
Re: Uni-t ut-d07a Bluetooth..
« Reply #40 on: October 14, 2018, 08:28:06 pm »
I forgot to mention:

MAXMIN is the one case where all 4 of the display status bits are set (Bits 0-3), but there is no bargraph preset.

I don't know if it's a bug, or if bit 3 has a different significance in MAXMIN mode.

Also, there are situations, like HOLD, where the MAIN display is shown in a small window in the centre at the top of the screen.

I can find no way, apart from HOLD, to indicate this display is to be used. It is also used in when viewing saves or records, but there seem to be no way to know remotely when it is in that mode.
 

Offline joeqsmith

  • Super Contributor
  • ***
  • Posts: 11632
  • Country: us
Re: Uni-t ut-d07a Bluetooth..
« Reply #41 on: October 14, 2018, 11:09:47 pm »
Yep, it was a bug in my decoding.  Thanks.  It's been great having people to bounce these questions off.   

The Hold mode seems to be a bit odd in that the meter appears to store up the readings for the bargraph. Once Hold is released, there is a burst of bargraph readings then it settles back down.   Could one of you please confirm if this is normal.  If it's normal, how do you handle it?  Flush all the data, display it? 


I started to look at the other modes (peak, min/max and rel).  That's the next thing to tackle. 
« Last Edit: October 15, 2018, 05:01:24 pm by joeqsmith »
 

Offline joeqsmith

  • Super Contributor
  • ***
  • Posts: 11632
  • Country: us
Re: Uni-t ut-d07a Bluetooth..
« Reply #42 on: October 16, 2018, 02:43:31 am »
I finished up the decoding logic.  The document was really helpful.  It would have taken me some time to sort out the the min/max function. 

Everything seems to work correctly except that somewhat odd behavior when selecting Hold.

I want to see how their software is slowing down the sample rate.  Maybe they just skip data points.   I also want to look into that diagnostic mode I mentioned.

Offline Brannigan

  • Contributor
  • Posts: 11
  • Country: ca
Re: Uni-t ut-d07a Bluetooth..
« Reply #43 on: October 16, 2018, 04:11:22 am »
I don't have any answers regarding the sampling rates, just some observations:

I did an extensive test with a low frequency, low distortion sine wave and the ~10 Hz sample rate is real. The values obtained are accurate to the expected values for that signal, to the resolution and accuracy of the meter.

So, all well and good, it's a nice feature when you are connected to a computer.

And then there is the update rate of the meter itself; 2 per second. Some people have a problem with that, but I'm OK with it, particularly with the fast bar graph. Fast changing numerical values and be difficult to interpret. A bit faster, or selectable would have been cool.

I did some reading about the A/D and multimeter subsystem chip and found that the conversion rate is 2/ second, so how they are getting 10/second I really don't know. It's been a while, but I wonder if the meter chip does averaging internally and it can be enabled/disabled.

Alternately, it wouldn't be the first time for a manufacturer to push a chip above spec, but 5x is a big jump.

One thing I noticed, and mentioned before, is that if the continuous transmission is selected (10 Hz), the MAIN data tracks the input signal at that rate and the BAR data is as fast, or likely faster than the 9600 baud transmission allows.

However, if you select the single reading mode, and run it in a tight loop, the BAR value changes very quickly, but the MAIN value update rate tracks the big display on the meter (2/sec)

I would be interested to see what you find out about the test mode. I know nothing about the Android app, but I am guessing/assuming that it is Java. Have you decompiled it with something like baksmali?
 

Offline joeqsmith

  • Super Contributor
  • ***
  • Posts: 11632
  • Country: us
Re: Uni-t ut-d07a Bluetooth..
« Reply #44 on: October 16, 2018, 11:39:34 am »
I suspect the 181A's timing is better than what my software reports. 

When I started out on this project, I downloaded the Android app and ran it through some on-line disassembler.   I have no knowledge of Java and no desire to learn it.   So it was a short lived effort and I was on to sniffing the packets. 

I've never looked into the 181A's hardware outside of what I did for the videos I made.   Did you post somewhere about what you found?  Chipset used, tests ran, etc?

It's by far the best UNI-T meter I have looked at.  It's got a lot going for it but it's also IMO in need of some improvements.  I keep hoping they will come out with an improved version of the meter. 

Offline joeqsmith

  • Super Contributor
  • ***
  • Posts: 11632
  • Country: us
Re: Uni-t ut-d07a Bluetooth..
« Reply #45 on: October 17, 2018, 12:26:20 am »
A few things that may be of interest.  Before I sorted out how to send data from the D07A, I would use UNI-T's software to setup the meter using the cable.  I then would unplug the cable from the meter and install the D07A and use my software.   

I use the UNI-T supplied software to set the data rate to 5 seconds and then install the D07A using my old software, it appears the data is still being sent at some very fast rate.   I suspect they just skip packets in their software.    Easy enough. 

Going back to my latest software, I connected a signal generator to the meter and press the Hold.  I wait for a few seconds, unplug the signal generator and release the Hold.  The meter does not appear to store of the data as I suspected.  Once Hold is released, you are back the the current data.  That answers that.   

I then slowed the signal generator to 10mHz.  Note the valid packet rate is 10Hz.   The primary display appears to be updating at one fifth of that or 2 times per second.   Obviously the bargraph is much faster, which is why I thought it was some sort of filtered value.   

So it appears there is no magic with their sampling.   Is this not what you are seeing?   

Offline Brannigan

  • Contributor
  • Posts: 11
  • Country: ca
Re: Uni-t ut-d07a Bluetooth..
« Reply #46 on: October 18, 2018, 07:38:12 pm »
I got the information about the meter subsystem chip from another EEVblog Forum post.

https://www.eevblog.com/forum/testgear/uni-t-ut181a-pictures/

The chip in question is a Cyrustek ES51997

http://www.cyrustek.com.tw/spec/ES51997.pdf

I'm not sure what you mean by magic.  As I said before, the datasheet clearly states that the high res A/D has a conversion rate of 2/sec and yet the meter is outputting high res data at ~ 10/second. IIRC, the information at that rate was real and full resolution, but I will check it again when I have some free bench time.

AFAIK, there are only two sample rates via serial, for the full resolution; 2Hz and 10 Hz. The fast A/D for the bargraph is 600 count resolution and updates at 20 Hz, which might be doable over the serial port, if you have a tight loop, and there isn't much turnaround overhead in the meter.

I agree that any other data rate for the main display is a function of dropping samples and or averaging them.

Also, to repeat, if you request a measurement, rather that letting it stream at 10 Hz, the main display value changes at 2 Hz and the BAR value changes rapidly.
 

Offline joeqsmith

  • Super Contributor
  • ***
  • Posts: 11632
  • Country: us
Re: Uni-t ut-d07a Bluetooth..
« Reply #47 on: October 18, 2018, 09:39:48 pm »
What I mean by magic is that the meter is not by some unexplainable means, outputting a new data at 10Hz.   It sends a copy of the same data five times. 

So yes, they send out data at ten times per second but it only updates at 2 times per seconds. Is this not what you are seeing?

Offline Brannigan

  • Contributor
  • Posts: 11
  • Country: ca
Re: Uni-t ut-d07a Bluetooth..
« Reply #48 on: October 18, 2018, 11:08:56 pm »
OK, now I'm confused.

I just did a test with my meter and the data is exactly as you say. With the 10 Hz automatic mode enabled, every 5 consecutive readings are identical, which is quite obvious.

I had previously (quite a while ago) done a test and convinced myself that the 10 samples per second were unique and tracked a sine wave correctly. This is why I could not understand the chip manufacturer's spec of 2 updates/sec.

I can not explain what I did back then, as a quick observation would tell me that the test was not even necessary. For now, I can only chalk it up to a major brain fart. I will investigate more as time allows.

So, the high speed update is of limited value unless one wants to access the faster, low resolution data. I suppose that the meter is also more consistent in timing, than doing a timed data request, but I seem to recall that it's not exactly 10 Hz or 2 Hz, but don't quote me on that.
 

Offline joeqsmith

  • Super Contributor
  • ***
  • Posts: 11632
  • Country: us
Re: Uni-t ut-d07a Bluetooth..
« Reply #49 on: October 18, 2018, 11:56:06 pm »
Ah, this make a little more sense now.  If I had to guess, you may have played around with the software they supply with the meter which doesn't show this level of detail.   

Yes, the advantage would be if you wanted to use the low resolution data.  I could also see with the amount of data they send, you could possibly handle cases where a packet was dropped. 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf