my $port = shift @ARGV || '/dev/ttyUSB2';
my $influx_url = shift @ARGV || 'http://10.13.37.229:8186/write?db=telegraf';
$influx_url = 'http://10.13.37.92:8086/write?db=rot13';
+my $measurement = $ENV{MEASUREMENT} || 'dsm501';
my $s = new Device::SerialPort( $port ) || die $!;
$s->baudrate(115200);
$s->parity('none');
$s->stopbits(1);
$s->handshake('none');
-$s->read_char_time(5);
-$s->read_const_time(10);
+$s->read_char_time(0); # don't wait for each char
+$s->read_const_time(200); # ms for complete read
while (1) {
if ( $string !~ m/^#/ ) {
$string =~ s/[\r\n]+$//;
$string =~ s/\s/,/g;
- my $influx = "dsm501,dc=trnjanska $string $t";
+ my $influx = "$measurement,dc=trnjanska $string $t";
print "$influx\n";
system "curl --silent -XPOST '$influx_url' --data-binary '$influx'"
} else {