Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1 require 'influxdb'
- 2 database = 'sensorsDB'
- 3 influxdb = InfluxDB::Client.new database, host: "localhost"
- 4
- 5
- 6 loop do
- 7 tempValue = { :value => rand(0..100) }
- 8 puts tempValue
- 9 influxdb.write_point('temperature',tempValue)
- 10 sleep 1
- 11 end
Advertisement
Add Comment
Please, Sign In to add comment