Skip to content

Instantly share code, notes, and snippets.

@matiaskorhonen
Created August 23, 2019 21:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matiaskorhonen/b339e56b8ee4d1761abd1e30f3a668d9 to your computer and use it in GitHub Desktop.
Save matiaskorhonen/b339e56b8ee4d1761abd1e30f3a668d9 to your computer and use it in GitHub Desktop.
Parse streaming output from rtl_433
require "json"
IO.popen("./rtl_433 -F json") do |io|
while (line = io.gets) do
begin
puts JSON.parse(line).inspect
rescue JSON::ParserError
puts line
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment