Timezones not aligning correctly

Forum is open to all questions, answers, and discussions related to electric meters, ours or others.
Jameson
Posts: 860
Joined: Fri Nov 04, 2011 7:42 pm
Location: Santa Cruz, CA
Contact:

Re: Timezones not aligning correctly

Post by Jameson »

Yes, I would like to see the error you describe when using the EKM Dash (and see the error in your Dash data). And even better would be to also see the bad data with a 3rd party sniffing software (such as CoolTerm). You should be able to get hundreds of thousands of good reads in a row (with a meter properly connected to a good USB converter).

I am trying to get an idea if the issue is with the meter you have, or with your software. Thanks for your help with this, I would be interested in seeing this intermittent bad data coming from the meter.
Jameson
EKM METERING
http://www.ekmmetering.com
831.425.7371
oxymai
Posts: 8
Joined: Sat Dec 30, 2017 3:07 pm

Re: Timezones not aligning correctly

Post by oxymai »

Hi Jameson,
Below are data received from ekm V4 for your reference.
Let me know if you need further info on this issue.
Thanks,

2018 3 12 8 22 52
2018 3 12 8 22 53
2018 3 12 8 22 54
2018 3 12 8 22 55
2018 3 12 8 22 56
2018 3 12 8 22 57
2018 3 12 8 22 58
2018 3 12 8 22 59
2018 3 12 8 23 0
2018 3 12 8 23 1
2018 3 12 8 23 2
2018 3 12 8 23 3
2018 3 12 8 23 4
2018 3 12 8 23 5
2018 3 12 8 23 6
2018 3 12 8 23 7
2018 3 12 8 23 8
2018 3 12 8 23 9
2018 3 12 8 23 10
1472 -325 -528 470 -400 878
2018 3 12 8 23 16
2018 3 12 8 23 17
2018 3 12 8 23 18
2018 3 12 8 23 19
2018 3 12 8 23 20
2018 3 12 8 23 21
2018 3 12 8 23 22
2018 3 12 8 23 23
2018 3 12 8 23 24
2018 3 12 8 23 25
2018 3 12 8 23 26
2018 3 12 8 23 27
2018 3 12 8 23 28
2018 3 12 8 23 29
2018 3 12 8 23 30
2018 3 12 8 23 31
2018 3 12 8 23 32
2018 3 12 8 23 33
2018 3 12 8 23 34
2018 3 12 8 23 35
2018 3 12 8 23 36
2018 3 12 8 23 37
2018 3 12 8 23 38
2018 3 12 8 23 39
2018 3 12 8 23 40
2018 3 12 8 23 41
2018 3 12 8 23 42
Jameson
Posts: 860
Joined: Fri Nov 04, 2011 7:42 pm
Location: Santa Cruz, CA
Contact:

Re: Timezones not aligning correctly

Post by Jameson »

Very strange, do you happen to have the raw Hex from the meter when it has this issue?

It looks like you are parsing more characters when the issue happens, is this on purpose? You are also parsing Dashes, is this on purpose also? I think the raw Hex would be the most useful.

As far as I know, both our EKM Dash (with a USB converter) and the EKM Push only use the CRC 16 to tell if the data is bad. I dont think we do any other checking. We do not check to see if the timestamp looks OK for example, we get 100,000 of good reads in a row with this. If the CRC is good, the meter would have to be putting this bad data out on purpose, I have not seen this. It is possible that your meter is faulty. Let me know if you keep seeing this, and please send the Raw Hex if you can capture it.

What is your meter number?

Thanks for your help.
Jameson
EKM METERING
http://www.ekmmetering.com
831.425.7371
oxymai
Posts: 8
Joined: Sat Dec 30, 2017 3:07 pm

Re: Timezones not aligning correctly

Post by oxymai »

This does not happen very often, it could be one for an hour or one for a few hours so it is fairly tricky to watch and stop. But I might try to write another code to catch all hex data for you to look at.
I experienced about bad data with V4 meter and the data from V4 gets screwed up as giving out bad data all the time, I had one trick to get it back to normal response, It happened quite sometime ago and I moved on with that issue already. I will get back to you for more info on this as well.
I used my own designed isolated usb/RS485 converter and it is the most reliable converter ever exists, so I would rule out this piece, there is another usb/rs485 converter in the system to read/write another energy storage system and did not give out any bad data since day 1 .
The way I read data out of V4 was recommended by EKMmeter website on C++, I would expect to see 255 bytes out of V4 meter and do CRC16 on 253 bytes and compare with the last 2 bytes as a check for data acceptance. And the parsing would be following your meter datasheet, here is serial number: "000300004181"
Here is another level check inside CRC check which helps rejecting bad data I came up
MeterRead.YCheck = time_conv(response[233],response[234]);
if ((MeterRead.YCheck <=0)||(MeterRead.YCheck >=50))
{
ems_settings.MeterFail = 1;
}
These codes are from EKM website and it works fine except the bad data randomly

write(sp,write_buffer,sizeof(write_buffer));
// Set connection timeout
int timeout = 5;
SerialPortSettings.c_cc[VTIME] = timeout*10;

// apply new serial port settings
tcsetattr(sp,TCSANOW,&SerialPortSettings);
// discards old data in the buffer
tcflush(sp, TCIFLUSH);
// Read buffer size
// Initialize file descriptor sets
fd_set read_fds, write_fds, except_fds;
FD_ZERO(&read_fds);
FD_ZERO(&write_fds);
FD_ZERO(&except_fds);
FD_SET(sp, &read_fds);
struct timeval timeoutStruct;
timeoutStruct.tv_sec = timeout;
timeoutStruct.tv_usec = 0;

// Get meter response
if (select(sp + 1, &read_fds, &write_fds, &except_fds, &timeoutStruct) == 1)
{
read(sp,&response,255);
}

Thanks,
Post Reply