bemasher / rtlamr-collect

Data aggregation for rtlamr.
GNU Affero General Public License v3.0
171 stars 29 forks source link

Where to put environment variables? #7

Closed poorredneck closed 6 years ago

poorredneck commented 6 years ago

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!

bemasher commented 6 years ago

Environment variables in ~/.profile will need to be exported:

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

You also don't need semi-colon's at the end of each line.

poorredneck commented 6 years ago

Awesome thank you!!!!