EKM-Omnimeter RS-485 Data

For more advanced meter data users. Learn from others and ask questions about how to read meters, how to use the EKM Push Data, and how to display the meter data in useful ways.
Jameson
Posts: 742
Joined: Fri Nov 04, 2011 7:42 pm
Location: Santa Cruz, CA
Contact:

Re: EKM-Omnimeter RS-485 Data

Post by Jameson » Mon Jan 25, 2016 7:29 pm

Hello Daniel,

Yes, I think using a MAX485 should work (you will want to make sure you play with the terminating and biasing resistor values). If you can get the data to look like the data in your "Mon Jan 25, 2016 10:37 am" post, then you will be on the right track.

Do you have a USB port? If so, I would recommend our USB converter, then once you get your Arduino talking to the meter via the USB converter you can switch the code to talk over the UART TTL to MAX485 transceiver. This way you are only tackling one issue at a time.

Best,
Jameson
EKM METERING
http://www.ekmmetering.com
831.425.7371

Daniel_Ch
Posts: 6
Joined: Mon Jan 11, 2016 12:02 pm

Re: EKM-Omnimeter RS-485 Data

Post by Daniel_Ch » Wed Jan 27, 2016 8:54 pm

Good evening Jameson,

This is my serial monitor reading (ASCII),

¯?0000000±39±9!�

‚�0000000±39±9066´5²±²03995²²·0²6´99¸5000000000000000000003±²90000±¸300000±²990000000000000000±±¸·±±¸¸00000²¸´0030²´00000003±±¸03±²00006²00²0²0000·0±6±¸56±²´0000000000000000000000000000000!
6�B0 õ�

and this is HEX conversion, (I'm still working on HEX printing), my meter is 13919, as you can see the address is wrong by b1,
Static ?

af 3f 30 30 30 30 30 30 30 b1 33 39 b1 39 21 fffd
0a
fffd
0a
201a fffd 17 14 30 30 30 30 30 30 30 b1 33 39 b1 39
30 36 36 b4 35 b2 b1 b2 30 33 39 39 35 b2 b2 b7
30 b2 36 b4 39 39 b8 35 30 30 30 30 30 30 30 30
30 30 30 30 30 30 30 30 30 30 30 30 33 b1 b2 39
30 30 30 30 b1 b8 33 30 30 30 30 30 b1 b2 39 39
30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30
b1 b1 b8 b7 b1 b1 b8 b8 30 30 30 30 30 b2 b8 b4
30 30 33 30 b2 b4 30 30 30 30 30 30 30 33 b1 b1
b8 30 33 b1 b2 30 30 30 30 36 b2 30 30 b2 30 b2
30 30 30 30 b7 30 b1 36 b1 b8 35 36 b1 b2 b4 30
30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30
30 30 30 30 30 30 30 30 30 30 30 30 30 30 21
0a
36 fffd 42 30 20 f5 fffd

Remember that I'm getting data from meter and push system, I think that my reading is
*request
*data
*close string,

My data are only about 191 bytes, is this possible ?, I mean any configuration ? (I didn't install the ommimeter)

Daniel_Ch
Posts: 6
Joined: Mon Jan 11, 2016 12:02 pm

Re: EKM-Omnimeter RS-485 Data

Post by Daniel_Ch » Wed Jan 27, 2016 9:33 pm

I think arduino is reading 8 Bits data because of the b1 (+-), it is not 7 bits symbol.

Jameson
Posts: 742
Joined: Fri Nov 04, 2011 7:42 pm
Location: Santa Cruz, CA
Contact:

Re: EKM-Omnimeter RS-485 Data

Post by Jameson » Thu Jan 28, 2016 2:04 pm

Thanks for the Hex return. I would either suspect bad Serial Settings or bad terminating resistor and biasing resistor values. Your data looks garbled.

Are you still reading through your UART port? I would still suggest you read through a USB port if you have one.

I dont know what you mean by : "b1 (+-), it is not 7 bits symbol."
Jameson
EKM METERING
http://www.ekmmetering.com
831.425.7371

nielo
Posts: 4
Joined: Wed Aug 27, 2014 7:45 pm

Re: EKM-Omnimeter RS-485 Data

Post by nielo » Wed Jul 11, 2018 6:00 pm

The crc calculation for EKM meters is pretty confusing so I thought I'd post a routine for Arduino to help anyone who needs it.
You should be able to copy what's below and paste it into your sketch without modification.
The only thing you'll need to add is a global character array declared as "char crcCalculated[2]".

One last thought that is unrelated:
If you need to print (om maybe save it to an SD card) the data passed to this
routine (or any other HEX data) with 2 characters per byte ("0A" as opposed to "A")
the easiest way is something like this:

for (int i = 0; i < sizeof(WhateverArray); i++) {
if (WhateverArray <= 15) Serial.write('0'); // Leading "0"
Serial.print(WhateverArray, HEX);
Serial.write(' ');
}


/******************** copy and paste below stuff ************************/

/*
Arduino version of building a CRC for EKM meters. (ModBus 16bit CRC).
This will fill in the global array "char crcCalculated[2]" with the CRC calculated from the passed
information.
if the calculated CRC matches the CRC in the passed array this routine returns TRUE, else
Returns FALSE.

Finally, because this was designed to check the CRC contained in a message received from an EKM meter,
the first byte of the message (0x02, Ascii STX = "Start Of Text") is not included in the CRC calculation.
Also, the last two bytes of the message are the CRC calculated by the meter and are not
included in the calculation, but they should match the crc calculated by this routine.

SOOO, if you need to calculate a CRC from something other than a message received from an
EKM meter you should pass an array with the first byte and the last 2 bytes as dummies.
For instance, if you want to send a message to an EKM meter with the correct crs, add a byte to the beginning
of the message and add two bytes to the end, then send the result to this routine. After this routine executes
the calculated crc will be contained in the crcCalculated array.

Finally, just for clarity, with the Arduino compiler arrays are always 0 based so, an array of 255 characters runs
from 0 to 254.

*/
boolean generateCRC(char ar[], int x) {
// "ar" is an array and should (for an EKM meter) contain 255 characters.
// The received character count is passed in x (and should be 255 for an EKM meter).
// crcCalculated is a global array used to save the CRC calculated by this routine so it may be
// used elsewhere (if necessary).

char crcCheck[2];// Used to hold the passed crc
unsigned int b;
unsigned int crc = 0xFFFF; // Eventuall holds calculated crc

// Save passed crc
crcCheck[0] = ar[x - 2];
crcCheck[1] = ar[x - 1];

// Calculate crc
for (int i = 1; i < (x - 2); i++) {
b = ar;
crc ^= b;
for (int c = 8; c != 0; c--) {
if ((crc & 0x0001) != 0) {
crc >>= 1;
crc ^= 0xA001;
} else {
crc >>= 1;
}
}
}

// Keep just the lowest 7 bits of both bytes
crcCalculated[0] = crc & 0x7F;
crcCalculated[1] = (crc >> 8) & 0x7F;

// If everything is ok return true, else return false
if ((crcCalculated[0] == crcCheck[0]) && (crcCalculated[1] == crcCheck[1])) {
return true;
} else {
return false;
}
} //End of routine

HalosarA
Posts: 2
Joined: Sat Sep 29, 2018 12:50 am

Buy Registered European passport online, EU passport, UK passports for sale

Post by HalosarA » Wed Oct 17, 2018 4:09 pm

We are producers and quality sellers of real and fake documents. We process and produce documents that you can use to travel and work in any part of the world. Our real documents are valid and registered in the required government database system. As for our fake documents they look 100% real and can also be use for travel but that is done at the clients risk. We advice clients who want to use thei documents for travel to always go in for the real documents. Visit our renewed website:

http://www.buyrealfakepassport.cc

e-mail: support@buyrealfakepassport.cc

Registered passport of all countries, visas, biometric passport, degrees, drivers license, ID cards, training certificates, M GCSE, A-levels, Social security card, Canada Cards, United States Cards, Student Cards, International Cards, Private Cards, Adoption Certificates, Baptism Certificates, Birth Certificates, Birth Certificates, Divorce Certificates, Marriage Certificates, Custom Certificates High School Diplomas, G.E.D. Diplomas, Home School Diplomas, College Degrees, University Degrees, Trade Skill Certificates, Validate SSN Number US green cards, Counterfeit dollars/euro, Spy Products, Voice Changers Listening Devices, Invisible Ink, DMV Record Inquiry, buy registered and unregistered ID cards,buy registered and unregistered drivers license worldwide, buy registered and unregistered USA(United States) passports, buy registered and unregistered Australian passports, buy registered and unregistered Belgium passports, purchase registered and unregistered Brazilian(Brazil) passports, buy registered and unregistered Canadian(Canada) passports, buy registered and unregistered Finnish(Finland) passports, buy registered and unregistered French(France) passports, buy registered and unregistered German(Germany) passports, get registered and unregistered Dutch(Netherlands/Holland) passports, buy registered and unregistered Israel passports, buy registered and unregistered UK(United Kingdom) passports, buy registered and unregistered Spanish(Spain) passports, buy registered and unregistered Mexican(Mexico) passports, buy registered and unregistered South African passports, order registered and unregistered Australian driver licenses, buy registered and unregistered Canadian driver licenses, buy registered and unregistered Dutch(Netherlands/Holland) driving licenses, buy registered and unregistered German(Germany) driving licenses, where to get registered and unregistered UK(United Kingdom) driving licenses, sale registered and unregistered Diplomatic passports, GMAT, MCAT, and LSAT Examination Certificates , Novelty Birth, Marriage, Novelty Passports and New Identity Packages , Replicated, False Degrees/Diplomas from most post-secondary institutions from around the world. We are the world best producers documents. Hit us and get all your documents problems solved today. We are flexible and very easy to deal with, we accept nearly all forms of payments and all our clients can use any that best suites them. Visit our renewed website:

http://www.buyrealfakepassport.cc

e-mail: support@buyrealfakepassport.cc

---
Keywords:

We produce both Real and Real documents. Buy Registered and unregistered USA(United States) passports, Buy Registered and unregistered Australian passports, Buy Registered and unregistered Belgium passports, Buy Registered and unregistered Brazilian(Brazil) passports, Buy Registered and unregistered Canadian(Canada) passports, Buy Registered and unregistered Finnish(Finland) passports, Buy Registered and unregistered French(France) passports, Buy Registered and unregistered German(Germany) passports, Buy Registered and unregistered Dutch(Netherland/Holland) passports, Buy Registered and unregistered Israel passports, Buy Registered and unregistered UK(United Kingdom) passports, Buy Registered and unregistered Spanish(Spain) passports, Buy Registered and unregistered Mexican(Mexico) passports, Buy Registered and unregistered South African passports, Buy Registered and unregistered Australian driver licenses, Buy Registered and unregistered Canadian driver licenses, Buy Registered and unregistered French(France) driver licenses, Buy Registered and unregistered Dutch(Netherland/Holland) driving licenses, Buy Registered and unregistered German(Germany) driving licenses, Buy Registered and unregistered UK(United Kingdom) driving licenses, Buy Registered and unregistered Diplomatic passports, Buy Registered and unregistered USA(United States) passports, Buy Registered and unregistered Australian passports, Buy Registered and unregistered Belgium passports, Buy Registered and unregistered Brazilian(Brazil) passports, Buy Registered and unregistered Canadian(Canada) passports, Buy Registered and unregistered Finnish(Finland) passports, Buy Registered and unregistered French(France) passports, Buy Registered and unregistered German(Germany) passports, Buy Registered and unregistered Dutch(Netherland/Holland) passports, Buy Registered and unregistered Israel passports, Buy Registered and unregistered UK(United Kingdom) passports, Buy Registered and unregistered Spanish(Spain) passports, Buy Registered and unregistered Mexican(Mexico) passports, Buy Registered and unregistered South African passports, Buy Registered and unregistered Australian driver licenses, Buy Registered and unregistered Canadian driver licenses, Buy Registered and unregistered French(France) driver licenses, Buy Registered and unregistered Dutch(Netherland/Holland) driving licenses, Buy Registered and unregistered German(Germany) driving licenses,
Buy Registered and unregistered UK(United Kingdom) driving licenses, Buy Registered and unregistered Diplomatic passports, Registered and unregistered Camouflage passports, Registered and unregistered passport Duplicates, Registered and unregistered USA(united States) passports for sale, Registered and unregistered Australian passports for sell, Registered and unregistered Belgium passports for sell, Registered and unregistered Brazilian(Brazil) passports for sell, Id card and Driver's License, buy Real passports, get Real passports online, real passports for sale, Real schengen visas for sale, Real German passports for sale, purchase Real passports online, where to buy Real passport online, Real Canadian passport for sale, Real, passport, id cards, uk, sell, online, canadian, british, sale, novelty, conterfeit, bogus, american, united, states, usa, us, italian, malaysian, australian, documents, idetity, idetification, driver, license, licence, driving, residence, permit, SSN Real passport id, free Real passport, identity theft, Real, novelty, camoflauge, passport, anonymous, private, safe, travel, anti terrorism, international, offshore, banking, id, driver, drivers, license, instant, online, for sale, REAL BRITISH PASSPORT, REAL CANADIAN PASSPORT, REAL FRENCH PASSPORT, REAL AMERICAN PASSPORT, REAL RUSSIAN PASSPORT, REAL JAPANESES PASSPORT, REAL CHINESE PASSPORT, AND REAL PASSPORT FOR COUNTRIES IN THE EUROPEAN UNION, REAL DRIVERS LICENSE,I.D CARDS,BIRTH CERTIFICATES,DIPLOMATS,MARRIAGE CERTIFICATES,AND VISAS, REGISTERED AND UNREGISTERED BRITISH PASSPORT, REGISTERED AND UNREGISTERED CANADIAN PASSPORT, REGISTERED AND UNREGISTERED FRENCH PASSPORT, REGISTERED AND UNREGISTERED AMERICAN PASSPORT, REGISTERED AND UNREGISTERED RUSSIAN PASSPORT, REGISTERED AND UNREGISTERED JAPANESES PASSPORT, REGISTERED AND UNREGISTERED CHINESE PASSPORT,REGISTERED AND UNREGISTERED PASSPORT FOR COUNTRIES IN THE EUROPEAN UNION.
http://www.buyrealfakepassport.cc

Post Reply