My goal: Read my OmniMeter v4 from a Raspberry Pi, either with the FTDI/USB adapter, or the serial converter. I have both, USB would be preferred but either is fine.
I have read for hours on this forum, and there's a lot of great information, but I'm not having much success yet.
Could anyone point me in a more productive direction? I'm about ready to buy an iSerial and just try that code, as I've seen several examples that look workable.
C, python, and shell are all very familiar, although maybe rusty at times. I have tried reading and writing in each with no luck; I understand 7-E-1 can be a problem but I've done my best to set these, seems really hard to debug when you're just getting nothing back.
If I could at least get some data from the device I could look into the algorithms scattered in the forum.
Thanks for any advice or pointers,
Joe
Raspberry Pi and FTDI USB (or Serial)
Re: Raspberry Pi and FTDI USB (or Serial)
Well, after posting this I'm finally getting data in C. I think it was just missing O_RDWR. Hopefully over the next few weeks I can get it parsed and post some sample code, curious how many people might be interested. Looking forward to rrdtools next! And maybe posting to a google spreadsheeet, we'll see. -Joe
Re: Raspberry Pi and FTDI USB (or Serial)
Hello Joe, Welcome to the forum!!
Very cool to hear about your raspberry pi project. That would be great if you wanted to post your code here for others to take a look at and/or contribute to.
Here is a discussion on the forum that somewhat relates to the raspi: http://forum.ekmmetering.com/viewtopic. ... erry#p3429
My recollection is that he had quite a cool setup. We are interested in a standalone, low power, data logging solution (to an SD card or dropbox folder) that the raspberry pi could potentially provide.
I am curious to follow your progress
Very cool to hear about your raspberry pi project. That would be great if you wanted to post your code here for others to take a look at and/or contribute to.
Here is a discussion on the forum that somewhat relates to the raspi: http://forum.ekmmetering.com/viewtopic. ... erry#p3429
My recollection is that he had quite a cool setup. We are interested in a standalone, low power, data logging solution (to an SD card or dropbox folder) that the raspberry pi could potentially provide.
I am curious to follow your progress

Re: Raspberry Pi and FTDI USB (or Serial)
Jameson, thanks! I've been looking forward to this step for many months, and reading many of your very kind replies.
What I've done is to write a little C program that reads USB/RS-485 data, and prints the parts I wanted. Then, I have a shell script that calls it every minute, parses the output, and calls the wattvision API to let them handle graphing. Google docs would be easy enough; or dropbox, but for mine I'm writing to a local SAN, just an old hard drive, to avoid wearing out the SD card over the next few years.
I found a RasPi site that gave me a good start at reading RS-485, which turns out to be fairly simple with your USB dongle. Then, I found some v3 struct code on the EKM forum here, and I updated that to the v4 specs. Finally I put the CRC bits in, un-swapped the endian bits from the other system's code, and it actually verifies.
So it's a fairly simple setup; no iSerial required, and it's been running all day now without any hiccups. It can query up to twice per second if you put it in a tight loop, far more than most people should need. (another post)
There's yet another post I ran across that's using rrdtools for graphing that I'd like to try next, since wattvision only does power and I want to add water and gas. Looks like he was using iSerial too.
http://forum.ekmmetering.com/viewtopic. ... =rrd#p5970
I'll try to clean the code up over the next few days and post more progress. Thanks for the encouragement, if I hadn't read your past interest I might not have been so persistent last night!
Joe
What I've done is to write a little C program that reads USB/RS-485 data, and prints the parts I wanted. Then, I have a shell script that calls it every minute, parses the output, and calls the wattvision API to let them handle graphing. Google docs would be easy enough; or dropbox, but for mine I'm writing to a local SAN, just an old hard drive, to avoid wearing out the SD card over the next few years.
I found a RasPi site that gave me a good start at reading RS-485, which turns out to be fairly simple with your USB dongle. Then, I found some v3 struct code on the EKM forum here, and I updated that to the v4 specs. Finally I put the CRC bits in, un-swapped the endian bits from the other system's code, and it actually verifies.
So it's a fairly simple setup; no iSerial required, and it's been running all day now without any hiccups. It can query up to twice per second if you put it in a tight loop, far more than most people should need. (another post)
There's yet another post I ran across that's using rrdtools for graphing that I'd like to try next, since wattvision only does power and I want to add water and gas. Looks like he was using iSerial too.
http://forum.ekmmetering.com/viewtopic. ... =rrd#p5970
I'll try to clean the code up over the next few days and post more progress. Thanks for the encouragement, if I hadn't read your past interest I might not have been so persistent last night!
Joe
Re: Raspberry Pi and FTDI USB (or Serial)
Hi Joe,
Yes we are super encouraging of this kind of project. Our philosophy is: the more ways our users can access their meter data the better.
Yeah teaming up with what he has here: http://forum.ekmmetering.com/viewtopic. ... erry#p3429 could be a match made in heaven.
I would love to see how your water meter and gas meter graphs turn out!
Thanks again,
Yes we are super encouraging of this kind of project. Our philosophy is: the more ways our users can access their meter data the better.
Yeah teaming up with what he has here: http://forum.ekmmetering.com/viewtopic. ... erry#p3429 could be a match made in heaven.

I would love to see how your water meter and gas meter graphs turn out!
Thanks again,
Re: Raspberry Pi and FTDI USB (or Serial)
Hi Joe
How's progress? I'd love to hear more about your setup
How's progress? I'd love to hear more about your setup
Re: Raspberry Pi and FTDI USB (or Serial)
I have a production setup. I used Andino Pi (Raspberry Pi 3 B+ inside, plus RTC, plus RS485 converter, plus Atmel chip).
Currently access the meter using RS485 but atmel chip is also capable of counting the impulses.
Andino Pi is powered by 12V 2A DC power source, everything is on DIN rail ...
I also created a small FCGI script and setup nginx so I'm able to access the meter data and access it using REST.
The setup works quite well and stable.
Currently access the meter using RS485 but atmel chip is also capable of counting the impulses.
Andino Pi is powered by 12V 2A DC power source, everything is on DIN rail ...
I also created a small FCGI script and setup nginx so I'm able to access the meter data and access it using REST.
The setup works quite well and stable.