Code Monkey home page Code Monkey logo

rtlamr-collect's People

Contributors

bemasher avatar lopsided98 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rtlamr-collect's Issues

Significant Rewrite Upgrade Recovery

Hi Douglas,

Thanks a bunch for writing this. I've been using your rtlamr-collect daemon since Feb 2018 and it's been rock solid for over a year.

Recently, it got flaky. I think it was a Fedora update that did it. So I decided to just get the latest and see if it would fix things. Unfortunately, I didn't read the change logs and things went pear shaped rather quickly.

I think I still have historical data but I'm not an Influx expert so I'm slogging through that right now which is kind of interesting in and of itself.

I was curious, though if you know of some export/import steps to just get to the new schema and keep the old data in tact. Kind of a migration document.

It's not critical but it would be nice to keep my last 12+ months of electric consumption data available.

Thanks and keep up the tweaks and feature enhancements,

Mark

Where to put environment variables?

I know this isn't a specific issue but I'm out of ideas. I have edited ~/.profile and added the variables, rebooted but I still get the error:

someuser@orangepi:~$ rtlamr -format=json -msgtype=idm | rtlamr-collect
15:47:47.545679 decode.go:43: CenterFreq: 912600155
15:47:47.548426 decode.go:44: SampleRate: 2359296
15:47:47.550024 decode.go:45: DataRate: 32768
15:47:47.550459 decode.go:46: ChipLength: 72
15:47:47.550730 decode.go:47: PreambleSymbols: 32
15:47:47.551254 decode.go:48: PreambleLength: 4608
15:47:47.551542 decode.go:49: PacketSymbols: 736
15:47:47.551945 decode.go:50: PacketLength: 105984
15:47:47.552197 decode.go:51: Preamble: 01010101010101010001011010100011
15:47:47.552446 main.go:94: GainCount: 29
15:47:47.560325 main.go:139: COLLECT_INFLUXDB_HOSTNAME undefined

My ~/.profile contains this:

COLLECT_INFLUXDB_HOSTNAME="localhost";
COLLECT_INFLUXDB_USER="someuser";
COLLECT_INFLUXDB_PASS="somepass";
COLLECT_MULTIPLIER="10";
RTLAMR_MSGTYPE="idm";
RTLAMR_FORMAT="json";

I execute from the terminal this command:

rtlamr -format=json -msgtype=idm | rtlamr-collect

I should add that all parts of rtlamr is working fine, I can | output to a log file, have a crontab running and manually processing/parsing the .csv files just to "get it running" and have proof that I can get this far.

Ultimately the beautiful grafana and Cronografs are what I'm after. I'm starting with Cronograf & InfluxDB. I have Cronograf and InfluxDB all working, the rtlamr database was created as outlined in the readme. I'm just having a stupid issue with the environment variables (I am still a linux newbie). I can curl the influxdb and get responses so the database is working/reachable.

Any assistance is greatly appreciated, and many many thanks for these excellent utilities!

Can you give us some info on how to set up influxdb?

I have never used influx and have not found the correct combination of parameters to get it to work.

After much messing around, I got rtlamr-collect to run without spitting out errors, but I don't see any info being inserted into influx.

I am running on linux with influx 2.x.
If I use the "tee" command I can see the json that is being sent to rtlamr-collect and it looks ok, but I don't have any way to diagnose what is going on with the connection to influx.

I tried several setting most of the env params to 'utilities' becase that is what I am monitoring, but in influx I see a bunch of other data in there. It looks like that is used by influx as an example or something.

I changed everything to rtlamr, but I have an empty bucket with no info. I generate and set the access token each time.

Thanks
-John

stumped on "COLLECT_INFLUXDB_TOKEN" undefined

hi.
I hate to bother you, but I've got rtl_tcp running as a service and I can connect to it manually with RTLAMR, see my meter, filter for its ID and message type, output as csv and open it in excel, etc. but I cannot, for the life of me, get RTLAMR-COLLECT.service to start.

The relevant journalctl entry(s) for the service are:

--------------------------------------------
Feb 17 07:16:41 cubox-i sh[15412]: FATA[2021-02-17 07:16:41.332]/root/go/src/github.com/bemasher/rtlamr-collect/main.go:339 main.lookupEnv "COLLECT_INFLUXDB_TOKEN" undefined
Feb 17 07:16:41 cubox-i systemd[1]: rtlamr-collect.service: Main process exited, code=exited, status=1/FAILURE
Feb 17 07:16:41 cubox-i systemd[1]: rtlamr-collect.service: Failed with result 'exit-code'.
---------------------------------------------

I thought maybe it was the "&" in my influxdb PW but I changed that, and still got the error.
I thought maybe there was a path issue but I checked and /root/go/src/github.com/bemasher/rtlamr-collect is where it is supposed to be.

Have you seen this issue before? Any clues as to where to start. I'm kind of a noob wrt Influxdb but I followed a tutorial and was able to create a user and a database and the influxdb service is running fine as near as I can tell. Any help you can offer would be greatly appreciated. Thanks.

logging: intermittent rtlamr-collect timeout

Have had RTLAMR/Grafana running on an Ornage Pi Lite for about 2 months now. My only issue is after a random amount of time (6 hours, to 6 days) it will stop collecting data on the RTLAMR side. The terminal is saying it is timing out. RTLAMR, RTLTCP, Grafana, Chronograf are all running on the same device.
What is my best option for figuring out why it is timing out?

I was collecting all meters that I can pick up for comparison with my neighbors. CPU load averages .75 so I don't think it's a processing power issue, however I'm going to filter down to just my meter, and my two immediate neighbors to see if that is a contributing factor.

Thank you for your assistance thus far, the first month i was able to not have any gaps in the readings and it was within PENNIES of my actual bill. This is really helping me dive down to what our household does that consumes the most energy, and come up with ways to correct that.

-Jon

Depeding on grafana zoom level, water meter gallons used is different

First of all, awesome program! I already have a grafana setup and InfluxDB instance monitoring my home networking. I've been eyeing up a flume 2 water meter add on but it's over $200. For just the SDR I can accomplish the same thing.

The one thing I'm not so sure about is the scaling in grafana. If I'm zoomed in at 20:50 I see a spike of 150 gallons used. If I'm zoomed out to 3 hour window it looks like 450 gallons used.

image

image

It's set to difference. Should I be setting it to something else?

image

As far as the units... I'm not sure they are right or if I need to divide by 10 for example. At some point I'll fill up a 5 gallon bucket and see if it actually registers as 5.

Thanks

Thanks bemasher, works like a charm. Decoding the r900 on a raspberry with 4 meters and 3 protocols seems to be too much. Missing many packets. Moving the r900 decoding to a separate pi seems to work... did no miss one beat from all 4 meters so far. Thanks for the quick implementation.

Runtime error due to no PowerOutageFlags in NetIDM meters

NetIDM meters dont report the PowerOutageFlags on the json causing AddPoints function to raise a runtime error at the following line:

https://github.com/bemasher/rtlamr-collect/blob/master/main.go#L78

I am not sure how to best fix this as I am not experienced on go, but could you take a look at it? I did comment out the outage and hardcoded it to 1 in the "For each differential interval." loop and it stopped raising the runtime error.

Thanks!

COLLECT_INFLUXDB_HOSTNAME undefined

I've followed rtlamr instructions and can happily stream that data.

I've verified that the rtlamr-collect prerequisites are installed and working, but I've got some error with my env file. Whether I attempt to pipe rtlamr output to rtlamr-collect, or just attempt to run rtlamr-collect directly: I get COLLECT_INFLUXDB_HOSTNAME undefined as a response.

I'm not sure how to get it to correctly read rtlamr-collect.env. I am on a macbook pro (sierra).

Apologies for the setup question - thank you for the work on this project. Happy to help better define or diagnose the issue that I am having.

Where to set envinronment variables (Using Windows)

Hello, thank you for the great work you have done with both rtlamr and rtlamr-collect.

I was reading the documentation, and it is clear that we should use the enironment files to configure some parameters, like the host for the influx DB.

However, I am running rtlamr and rtlamt-collect on windows and I am unsure where should I place these files *.env.

Could you kindly assist on this info?

Thank you

SCM+: Cannot unmarshal number

Getting the following error message:

02:40:51.960603 main.go:381: json unmarshal: json: cannot unmarshal number 95326987 into Go value of type uint8

An example of a message that probably generated this (made about 5 minutes prior to the error):

{
	"Time": "2019-01-30T02:35:51.496553495Z",
	"Offset": 0,
	"Length": 0,
	"Type": "SCM+",
	"Message": {
		"FrameSync": 5795,
		"ProtocolID": 30,
		"EndpointType": 156,
		"EndpointID": 95326987,
		"Consumption": 115796,
		"Tamper": 0,
		"PacketCRC": 51378
	}
}

Similar message that is not throwing this error:

{
	"Time": "2019-01-30T02:31:01.422505762Z",
	"Offset": 0,
	"Length": 0,
	"Type": "SCM",
	"Message": {
		"ID": 64633980,
		"Type": 4,
		"TamperPhy": 0,
		"TamperEnc": 1,
		"Consumption": 58882,
		"ChecksumVal": 34959
	}
}

SCM vs. SCM+ problem?

COLLECT_MULTIPLIER - Interpreting Consumption Values in KWh or Wh

I have a question about the COLLECT_MULTIPLIER

When I view the RTLAMR data raw, just in format=plain my meter reads dWh I think.... Basically the consumption looks like this: 6122859. I have to divide by 100 to get the KWh (which is what I'm more familiar with, and billed by). So the actual KWh displayed on the meter is 61228.59. Should I leave COLLECT_MULTIPLIER=10?

I guess I can change the data in grafana but I'm not sure if the data I'm looking at is actually being represented in Watt Hours or not. I've attached a screenshot.

5 minute

5 minute2

invalid memory address

Getting invalid memory address or nil pointer dereference. Setup environment variables, database etc. Same error whether IDM or SCM.

pi@raspberrypi:~/go/src/github.com/bemasher/rtlamr-collect $ sudo systemctl status rtlamr-collect
● rtlamr-collect.service - RTLAMR Collector
   Loaded: loaded (/etc/systemd/system/rtlamr-collect.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2019-11-23 01:46:57 GMT; 4min 31s ago
 Main PID: 1185 (sh)
    Tasks: 13 (limit: 4915)
   CGroup: /system.slice/rtlamr-collect.service
           ├─1185 /bin/sh -c /home/pi/go/bin/rtlamr | /home/pi/go/bin/rtlamr-collect
           └─1186 /home/pi/go/bin/rtlamr

Nov 23 01:46:57 raspberrypi sh[1185]: 01:46:57.601003 main.go:119: GainCount: 29
Nov 23 01:46:57 raspberrypi sh[1185]: 01:46:57.644966 main.go:388: preloaded 0 meters
Nov 23 01:51:19 raspberrypi sh[1185]: 01:51:19.655281 main.go:457: rtlamr,endpoint_id=20876520,endpoint_type=7,msg_type=cumulative,protocol=SCM co
Nov 23 01:51:19 raspberrypi sh[1185]: panic: runtime error: invalid memory address or nil pointer dereference
Nov 23 01:51:19 raspberrypi sh[1185]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x24 pc=0x149e4]
Nov 23 01:51:19 raspberrypi sh[1185]: goroutine 1 [running]:
Nov 23 01:51:19 raspberrypi sh[1185]: panic(0x2472f0, 0x1060c010)
Nov 23 01:51:19 raspberrypi sh[1185]:         /usr/lib/go-1.7/src/runtime/panic.go:500 +0x33c
Nov 23 01:51:19 raspberrypi sh[1185]: main.main()
Nov 23 01:51:19 raspberrypi sh[1185]:         /home/pi/go/src/github.com/bemasher/rtlamr-collect/main.go:461 +0xb88
lines 1-19/19 (END)

404 Error

Getting a 404 error connecting to InfluxDB after triple checking credentials and host (same box). Does this require telegraf to work?

image

endpoint_type varying for R900 water meter

For R900 meters, the code is mapping "Unkn1" to endpoint_type.

The R900 water meters in my area (sample size 147), the values of Unkn1 seem to flip between 131 & 163, even on a single meter.

This seems... wrong. I don't think it should be mapped in this way, but I'm not sure what is actually in the field.

Sample data, from my own meter

{"Time":"2022-12-18T01:57:01.888978224Z","Offset":0,"Length":0,"Type":"R900","Message":{"ID":XXX,"Unkn1":163,"NoUse":32,"BackFlow":0,"Consumption":208090,"Unkn3":0,"Leak":0,"LeakNow":0}}
{"Time":"2022-12-18T02:00:45.882235945Z","Offset":0,"Length":0,"Type":"R900","Message":{"ID":XXX,"Unkn1":131,"NoUse":32,"BackFlow":0,"Consumption":208090,"Unkn3":0,"Leak":0,"LeakNow":0}}
{"Time":"2022-12-18T02:01:13.886661769Z","Offset":0,"Length":0,"Type":"R900","Message":{"ID":XXX,"Unkn1":163,"NoUse":32,"BackFlow":0,"Consumption":208090,"Unkn3":0,"Leak":0,"LeakNow":0}}

Environment Variables and InfluxDB Schema

Sorry, wrong button (can't figure out how to delete my own comment: ) Anyways, I think the variable COLLECT_INFLUXDB_HOSTNAME should now include protocol and port not just the hostname (rtlamr-collect.env').

database file 'init.iql':
Am I correct that I can remove the ' continous query' definitions (referencing the 'old' db structure' and use the 'cq.iql' instead?

Thanks

Autostart Issues

bemasher I can't thank you enough for your help, and I hope this is the last problem I have.

I have tried to auto-run the "command" with a crontab, rc.local, and systemd service.

I have a file "log_energy.sh" that is chmod +x executable. It is simply this:

#!/bin/bash
/home/jonboy545/GoCode/bin/rtlamr -filterid=62059972 -format=json -msgtype=idm unique=true | /home/jonboy545/GoCode/bin/rtlamr-collect;

If I'm in a terminal window at ~, and type ./log_energy.sh & disown it works perfectly. Also, if I open a SCREEN instance, execute ./log_energy.sh and then detach from that screen instance it works fine.

So I tried putting that script file into rc.local. I had to put a sleep 120 in there to get it to execute otherwise I think it started too soon. However after a few minutes it rtlamr abruptly stops for some reason. I do not have this issue if I start the log_energy.sh file from a terminal. It will run indefinitely.

This is what my rc.local looks like:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

/bin/sh /root/vnc.sh &

rtl_tcp &

sleep 120

/home/jonboy545/log_energy.sh &


exit 0

So since I'm on an OrangePi running Ubunto 16.04 I tried making a systemd service.

energy.service looks like this: (I followed the guide here: https://askubuntu.com/questions/913838/writing-systemd-script

[Unit]
Description=Energy Monitor Script

[Service]
ExecStart=/home/jonboy545/GoCode/bin/rtlamr -filterid=62059972 -format=json -msgtype=idm unique=true | /home/jonboy545/GoCode/bin/rtlamr-collect

[Install]
WantedBy=multi-user.target

Then chmod 644 energy.service

Then per the instruction: sudo systemctl enable energy.service

For the life of me, I can not get this thing to auto-run at boot reliably!

I'm so sorry for asking all these questions, not related specifically to rtlamr but you have been so responsive I can't help it :-(

Thank you so much in advance,
Jonathan

rtlamr-collect doesn't seem to like output coming from my rtlamr

i'm getting output that looks like this from rtlamr:
{Time:2018-02-19T10:54:34.607 SCM:{ID:XXXXXXXX Type:12 Tamper:{Phy:01 Enc:00} Consumption: 32348 CRC:0xXXXX}}

rtlamr-collect doesn't seem to like it:
12:09:34.634599 main.go:187: invalid character 'T' looking for beginning of object key string

Error parsing encapsulated message

When using rtlamr and rtlamr-collect, I get the following JSON unmarshaling error for any output from rtlamr. I redacted the ID and CHECKSUM in the output and also tee'd the pipe to see what exactly rtlamr-collect was receiving (though I get the same errors with or without tee).

$  rtlamr | tee /dev/pts/1 | rtlamr-collect

09:52:32.620336 flags.go:111: Environment variable "RTLAMR_FILTERID" overrides flag "filterid" with "1053xxxx"
09:52:32.620471 flags.go:111: Environment variable "RTLAMR_FORMAT" overrides flag "format" with "json"
09:52:32.620829 decode.go:45: CenterFreq: 912600155
09:52:32.620842 decode.go:46: SampleRate: 2359296
09:52:32.620849 decode.go:47: DataRate: 32768
09:52:32.620856 decode.go:48: ChipLength: 72
09:52:32.620862 decode.go:49: PreambleSymbols: 21
09:52:32.620868 decode.go:50: PreambleLength: 3024
09:52:32.620874 decode.go:51: PacketSymbols: 96
09:52:32.620880 decode.go:52: PacketLength: 13824
09:52:32.620888 decode.go:59: Protocols: scm
09:52:32.620895 decode.go:60: Preambles: 111110010101001100000
09:52:32.620902 main.go:111: GainCount: 29
09:52:32.621530 main.go:353: connecting to "rtluser"@"http://localhost:8086/"
{"Time":"2019-08-19T09:53:56.069061986-04:00","Offset":0,"Length":0,"Message":{"ID":1053xxxx,"Type":12,"TamperPhy":3,"TamperEnc":0,"Consumption":5587,"ChecksumVal":24xxx}}
09:53:56.069664 main.go:398: json unmarshal: json: Unmarshal(nil)

To get a bit more info, I also made this patch to print out a bit more info:

Index: main.go
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- main.go	(date 1555814264000)
+++ main.go	(date 1566226362704)
@@ -396,6 +396,9 @@
 		err = json.Unmarshal(logMsg.Message, msg)
 		if err != nil {
 			log.Println(errors.Wrap(err, "json unmarshal"))
+			log.Printf("logMsg: %+v\n", logMsg)
+			log.Printf("logMsg.Message: %v\n", string(	logMsg.Message))
+			log.Printf("msg: %+v\n", msg)
 			continue
 		}
 

That produced the following output:

$ rtlamr | tee /dev/pts/1 | rtlamr-collect                                

10:55:11.559172 main.go:353: connecting to "rtluser"@"http://localhost:8086/"
10:55:11.579869 flags.go:111: Environment variable "RTLAMR_FORMAT" overrides flag "format" with "json"
10:55:11.580731 decode.go:45: CenterFreq: 912600155
10:55:11.580763 decode.go:46: SampleRate: 2359296
10:55:11.580767 decode.go:47: DataRate: 32768
10:55:11.580772 decode.go:48: ChipLength: 72
10:55:11.580776 decode.go:49: PreambleSymbols: 21
10:55:11.580784 decode.go:50: PreambleLength: 3024
10:55:11.580789 decode.go:51: PacketSymbols: 96
10:55:11.580793 decode.go:52: PacketLength: 13824
10:55:11.580805 decode.go:59: Protocols: scm
10:55:11.580810 decode.go:60: Preambles: 111110010101001100000
10:55:11.580826 main.go:111: GainCount: 29
{"Time":"2019-08-19T10:55:16.092272358-04:00","Offset":0,"Length":0,"Message":{"ID":3372xxxx,"Type":12,"TamperPhy":0,"TamperEnc":0,"Consumption":143548,"ChecksumVal":29xxx}}
10:55:16.093033 main.go:398: json unmarshal: json: Unmarshal(nil)
10:55:16.093146 main.go:399: logMsg: {Time:2019-08-19 10:55:16.092272358 -0400 EDT Type:}
10:55:16.093201 main.go:400: logMsg.Message: {"ID":3372xxxx,"Type":12,"TamperPhy":0,"TamperEnc":0,"Consumption":143548,"ChecksumVal":29xxx}
10:55:16.093232 main.go:401: msg: <nil>

Let me know if there is any other info that would help

Grafana Dashboards

Could you share the dashboard you made? It looks very good! I've been having trouble getting Grafana to sort the input data by ID, so I can graph it as a bar graph. Any help would be appreciated. Thanks for creating this project!

Create Docker container for rtlamr-collect

Would it be possible to create a Docker container for rtlamr-collect? I already have rtlamr running in a container, and would love to run the collect variant alongside it.

Thank you for all your work thus far! This is really an awesome project.

Go install instructions fail

When you run the current go get github.com/bemasher/rtlamr-collect then you get this as the output.

	'go get' is no longer supported outside a module.
	To build and install a command, use 'go install' with a version,
	like 'go install example.com/cmd@latest'
	For more information, see https://golang.org/doc/go-get-install-deprecation
	or run 'go help get' or 'go help install'. ```

invalid character 'T' looking for beginning of object key string

Running rtlamr shows:
guerilla@guerilla:~/work/bin$ ./rtlamr
{Time:2017-12-21T22:58:44.319 SCM:{ID:34060345 Type: 4 Tamper:{Phy:00 Enc:00} Consumption: 12342 CRC:0x32D5}}
{Time:2017-12-21T22:58:44.873 SCM:{ID:42763095 Type: 5 Tamper:{Phy:03 Enc:00} Consumption: 3966871 CRC:0xF9D1}}

When running ./rtlamr | ./rtlamr-collect I get:
23:01:11.658915 main.go:155: connecting to "user"@"http://localhost:8086"
23:01:11.660034 main.go:130: Preloaded: 0
23:01:11.773823 main.go:179: invalid character 'T' looking for beginning of object key string
23:01:12.831929 main.go:179: invalid character 'T' looking for beginning of object key string

Are there additional requirements that I'm missing in the installation or execution? Seems like the regex used may be incorrect.

Appreciate any help.

unexpected end of JSON input main.main invalid character C /f E M C E .

I have a batch file that I used to be able to run in a second window (ensure I have rtl_tcp running in the first window) but recently I've been experiencing the issue. Here is my batch file:

set COLLECT_INFLUXDB_HOSTNAME=http://192.168.5.202:8086/
set COLLECT_INFLUXDB_BUCKET=utility
set COLLECT_INFLUXDB_MEASUREMENT=utilities
set COLLECT_INFLUXDB_ORG=utility
set COLLECT_INFLUXDB_TOKEN=username:password
set RTLAMR_FORMAT=json

rtlamr -filterid=1550256522 -msgtype=r900 | rtlamr-collect

But when this is run the only screen output I get is this:

INFO[2022-06-29 23:05:55.264]main.go:406 main.main connecting to "http://192.168.5.202:8086/"
INFO[2022-06-29 23:05:55.269]main.go:424 main.main unexpected end of JSON input
INFO[2022-06-29 23:05:55.27]main.go:424 main.main invalid character 'C' looking for beginning of value
INFO[2022-06-29 23:05:55.272]main.go:424 main.main invalid character '\f' looking for beginning of value
INFO[2022-06-29 23:05:55.273]main.go:424 main.main invalid character 'E' looking for beginning of value
INFO[2022-06-29 23:05:55.273]main.go:424 main.main invalid character 'M' looking for beginning of value
INFO[2022-06-29 23:05:55.274]main.go:424 main.main invalid character 'C' looking for beginning of value
INFO[2022-06-29 23:05:55.274]main.go:424 main.main invalid character 'E' looking for beginning of value
INFO[2022-06-29 23:05:55.275]main.go:424 main.main invalid character '.' looking for beginning of value

Eventually, this eats up all my CPU cycles and services begin to crash. I end up losing network connectivity and in Task manager, the font changes into big bold characters like from Windows 3.1 in the early 90's. It gets very difficult to close anything (the computer just beeps at me) but I end up restarting the computer and the resources are back to normal.

I'm not sure what's changed besides the usual Windows 10 update cadence (up to June 2022 cumulative updates now).

Print collected data to stdout

Previous version of rtlamr-collect would print the collected data to stdout and I noticed that current version does not. Is there a flag to turn that on?

Thanks for a great tool!

Not issue, but general question

I was wondering what unit the readings are in within influxdb, I'm using grafana to graph and it's working nicely but my readings all seem really small (300-1500) for a dryer, heater in garage, lights, and vacuums running. The graph does seem to match my usage patterns to a tee, it's just the numbers seem off to me. I just wonder if I need to move the decimal point or something.

add msgtype: r900

rltamr-collect looks awesome - thanks! Will you consider adding support for water consumption (i.e. Neptune r900 meters)? I'd love to use this to visualize water usage.

Diagnosing Influx issues

Hi there,

I'm trying to get the tool setup and running in my network. I've got all the settings set to what I believe they should be, and stdout gives good-looking messages:

TRAC[2021-09-08 15:11:38.585]/home/dan/go/pkg/mod/github.com/bemasher/[email protected]/main.go:418 main.main {"Time":"2021-09-08T15:11:38.584869957-05:00","Offset":0,"Length":0,"Type":"SCM","Message":{"ID":[redacted],"Type":7,"TamperPhy":2,"TamperEnc":3,"Consumption":7361312,"ChecksumVal":20145}}
TRAC[2021-09-08 15:12:36.249]/home/dan/go/pkg/mod/github.com/bemasher/[email protected]/main.go:418 main.main {"Time":"2021-09-08T15:12:36.249756939-05:00","Offset":0,"Length":0,"Type":"SCM","Message":{"ID":[redacted],"Type":7,"TamperPhy":2,"TamperEnc":3,"Consumption":7361316,"ChecksumVal":29852}}

when I go to "Explore" the data in the InfluxDB web UI, I don't get any data points. I queried the bucket with the CLI tool and it also gives no data points.

Assuming there is an issue with my settings (which is likely), how can I go about seeing any errors the tool throws while trying to write data to the Influx API?

Add SCM message type

My power meter outputs the SCM message type, please add support for SCM.

I assume that SCM is trickier because the last reading (with time stamp) must be saved and then subtracted from the next reading to get the power consumption between readings. Not too hard, but can be messy if meter ID(s) are not specified to keep the number of meters in check. I propose limiting SCM support to some low number of meter IDs, perhaps even just one.

I may take a crack at coding SCM support, but I'm a novice programmer and have no experience with Go.

Thanks for these programs. I've been logged my power usage for months now, but not very nicely and I'd like to a proper job of it with InfuxDB.

Unable to build / install

I was able to successfully build and run the rtlamr package. (I can see my meter! Awesome!) Now trying to do the same with this package but getting an error related to influxdb-client-go:

(output below shows versions of influxdb and go)

rdefeo@nuc:~$ echo $GOPATH
/home/rdefeo/go
rdefeo@nuc:~$ go get github.com/bemasher/rtlamr-collect
go/src/github.com/influxdata/influxdb-client-go/api/write/point.go:13:2: no Go files in /home/rdefeo/go/src/github.com/influxdata/line-protocol
rdefeo@nuc:~$ ls ./go/bin/
rtlamr
rdefeo@nuc:~$ apt list influxdb
Listing... Done
influxdb/unknown,now 1.8.10-1 amd64 [installed]
influxdb/unknown 1.8.10-1 i386
rdefeo@nuc:~$ go version
go version go1.13.8 linux/amd64
rdefeo@nuc:~$

Running Ubuntu 20.04. I installed influxdb using sudo apt install influxdb. Perhaps this is a versioning issue? Sorry, not too familiar with how Go manages dependencies. Thoughts?

Using 2 instances on rtlamr-collect

Hello.

Wandering if there a parameter or support for defining the source of rtl_tcp for aggregation.

As in 2 dongles, on different Ips.

Aggregation/influxdb is on IP1, second dongle is on IP2 (doesn't have that much firepower to run rtlamr on it but it's ok with rtl_tcp serving).
Was wondering if i can run a different instance of rtlamr-collect on IP1 with IP2 as it's data source

Invalid character error

I downloaded v1.0.3 of this, along with v0.9.3 of rtlamr. I setup my influxdb configuration and when I run rtlamr | rtlamr-collect, I get this error whenever a consumption message comes in:

INFO[2021-09-13 21:12:45.864]/Users/candicehumpherys/go/src/github.com/bemasher/rtlamr-collect/main.go:424 main.main invalid character 'T' looking for beginning of object key string 

Running rtlamr by itself gives this output for a consumption message:

{Time:2021-09-13T21:15:10.112 SCM+:{ProtocolID:0x1E EndpointType:0x07 EndpointID:1552230918 Consumption:    387439 Tamper:0x0001 PacketCRC:0x0471}}

Note: A few months back I had v1.0.2 and v0.9.2, and everything was working fine.

main.go:427: json unmarshal: json: Unmarshal(nil)

Hi! Thanks for making this great software!

I've run into a bit of a problem... when I run rtlamr-collect, I get the message main.go:427: json unmarshal: json: Unmarshal(nil). I've verified that rtlamr is outputting valid JSON:

$ rtlamr -msgtype="all" -format=json
10:53:34.045567 flags.go:111: Environment variable "RTLAMR_FILTERID" overrides flag "filterid" with "XXX"
10:53:34.046319 decode.go:45: CenterFreq: 912380000
10:53:34.046330 decode.go:46: SampleRate: 2359296
10:53:34.046338 decode.go:47: DataRate: 32768
10:53:34.046356 decode.go:48: ChipLength: 72
10:53:34.046366 decode.go:49: PreambleSymbols: 32
10:53:34.046377 decode.go:50: PreambleLength: 4608
10:53:34.046394 decode.go:51: PacketSymbols: 736
10:53:34.046400 decode.go:52: PacketLength: 105984
10:53:34.046407 decode.go:59: Protocols: scm,scm+,idm,r900
10:53:34.046413 decode.go:60: Preambles: 111110010101001100000,0001011010100011,01010101010101010001011010100011,00000000000000001110010101100100
10:53:34.046419 main.go:111: GainCount: 29
{"Time":"2020-09-13T10:53:43.338550439-06:00","Offset":0,"Length":0,"Message":{"ID":XXX,"Unkn1":163,"NoUse":0,"BackFlow":0,"Consumption":4058505,"Unkn3":0,"Leak":2,"LeakNow":0}}

Any ideas why unmarshaling is returning nil?

Thanks much!

Error Message Install

go get github.com/bemasher/rtlamr-collect
# github.com/influxdata/influxdb-client-go/api/http
/root/go/src/github.com/influxdata/influxdb-client-go/api/http/service.go:100:14: undefined: "net/http".NewRequestWithContext
root@raspberrypi:/home/pi# 

I have already installed golang and rtlamr. working as expected
I get same error attempting to install on various raspberry images

Feature Request: r900, Leak information

Would it be possible to extract the LEAKINFORMATION from the r900 protocol as well?
Here what my water meter is broadcasting:
{Time:2019-01-24T08:06:24.878 R900:{ID:1471517160 Unkn1:0xA1 NoUse: 0 BackFlow:0 Consumption: 2381589 Unkn3:0x00 Leak:15 LeakNow:3}}
I assume it would be possible to set/create an alert in Grafana when a leak occurs...
Thanks

Database provisioning

I've installed rtlamr and found my meter (THANKS!) now trying to do the database thing. Installed Influxdb on Ubuntu 16.04, started it with influxd from the CLI and now trying to do this

Provisioning influxdb can be done using the included initial schema (assuming you have the influx cli client installed):

influx -host "host" -username 'user' -password 'pass' -path "init.iql"

Best I can tell nothing is happening and no database is being created. I'm sure I'm missing something. Rtlamr-collect is installed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.