Closed ghost closed 10 years ago
I'll look into adding support for this, would you mind showing your implementation? I think the reason csv didn't make the cut when adding logging output the first time around was that it didn't implement the same interface as the rest of the encoders.
It shouldn't be too complicated to implement this interface, might need reflection or some extra methods on the message and scm types:
type Encoder interface {
Encode(interface{}) error
}
I don't know golang so my "implementation" is just a hack of the default output. I stripped out the labels and added some commas.
return fmt.Sprintf("%s, %+v\n", msg.Time.Format(TimeFormat), msg.SCM)
func (scm SCM) String() string {
return fmt.Sprintf("%8d, %8d, 0x%04X", scm.ID, scm.Consumption*10, scm.Checksum,)
}
I've been playing with it for about a week now. I started out using it on my raspberry pi but I think it was unable to keep up with all the IQ data coming in even at symbollength=7(rtltcp seems to be having buffer overruns). On my pc it works fine. My smart meter seems to transmit every 30 seconds hopping through 50 different channels with a pattern that repeats every 20 minutes and 6 seconds, give or take. After a lot of data logging on all the frequencies I've finally discovered my meters hopping pattern. I'm currently running a batch file that calls rtl 50 times in a row using the -single=true and using frequencies that work for me, to get 1 reading every 30 seconds. I'm looking forward to the release of your hopping pattern discovery tool. It would be even nicer if we could figure out the algorithm the meter uses to generate the pattern, perhaps its based on the meter id somehow. Also it would be nice if rtlamr had the option to output data in comma separated list format for easier import into a spread sheet. For now I've tweaked my local go files to get csv output but it would still be nice to see it officially supported.
Thanks for all your work on this.