waterfurnace_aurora 0.7.7 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7af20433d8163a332a3d09c36b23af07b95d9beb088d4a0ce69436a54e46e434
4
- data.tar.gz: 29a7c84feb1f58ecb6b0a44538f1a530add179ea95b0285f1739f172730b2d24
3
+ metadata.gz: b8a3d1e80a8e07d73e5efe83005545f360db3475614333fc434885b3e9143092
4
+ data.tar.gz: 97ea735ee8991898734b87f810d273bb8fc2000b011f569e9908f4ebcad4d1fc
5
5
  SHA512:
6
- metadata.gz: 81c6604273350396388be239846997ee151f1b92ac47c270977e63347a5eeea81025eefece7d60cb3f2e374bca65816548bf3b8cc36bf249a1dbec57fbc0cb3a
7
- data.tar.gz: 75ac82e3784f556b13274d5de4e64889023963286a3787e2521fef74ca5fb19ff0c49ea40a35fef7ea95bcae80b463ff84d15e67e4ddce098ffd69a3ead95843
6
+ metadata.gz: 3aea05123fca4194e108b32adde87724547f63e1ef1b9f0a91d4f22856d59b5021f08a998fe3d9956e20f3e745d662001d0beb43d86de69cdd36decb6f5c1af4
7
+ data.tar.gz: 762f87c0790263751934b592b17252b822276bef351141b49da72d42b953eb6eb3fe553037c71117f8d39e0318bf83b70af4b838905d1e80195860439f117bb9
data/exe/aurora_fetch CHANGED
@@ -8,20 +8,31 @@ require "optparse"
8
8
  require "uri"
9
9
  require "yaml"
10
10
 
11
- debug_modbus = yaml = false
11
+ debug_modbus = yaml = ignore_missing_registers = false
12
12
  try_individual = nil
13
13
 
14
14
  options = OptionParser.new do |opts|
15
15
  opts.banner = "Usage: aurora_fetch /path/to/serial/port REGISTERS [options]"
16
16
 
17
17
  opts.separator("")
18
- opts.separator("Use `known` to fetch all identified registers. Use `valid` to fetch all registers that will respond.")
18
+ opts.separator(<<~TEXT)
19
+ Use `known` to fetch all identified registers. Use `valid` to fetch all registers
20
+ that should respond. Use `all` to search the entire ModBus address space. Note that
21
+ logging of current progress is only periodic, and does not log every register it's
22
+ trying to fetch.
23
+ TEXT
19
24
  opts.separator("")
20
25
 
21
- opts.on("--debug-modbus", "Print actual protocol bytes") { debug_modbus = true }
26
+ opts.on("--debug-modbus", "Print actual protocol bytes") do
27
+ debug_modbus = true
28
+ end
22
29
  opts.on("--[no-]try-individual",
23
30
  "Query registers one-by-one if a range has an illegal address. " \
24
31
  "Defaults to true for `valid` and `known` special registers, false otherwise.") { |v| try_individual = v }
32
+ opts.on("--ignore-missing-registers",
33
+ "For YAML input only, just log a warning when a register doesn't exist, instead of failing") do
34
+ ignore_missing_registers = true
35
+ end
25
36
  opts.on("-y", "--yaml", "Output raw values as YAML") { yaml = true }
26
37
  opts.on("-v", "--version", "Print version") do
27
38
  puts Aurora::VERSION
@@ -40,11 +51,11 @@ unless ARGV.length == 2
40
51
  exit 1
41
52
  end
42
53
 
43
- modbus_slave = Aurora::ABCClient.open_modbus_slave(ARGV[0])
54
+ modbus_slave = Aurora::ABCClient.open_modbus_slave(ARGV[0], ignore_missing_registers: ignore_missing_registers)
44
55
  modbus_slave.read_retry_timeout = 15
45
56
  modbus_slave.read_retries = 2
46
- modbus_slave.logger = Logger.new($stdout)
47
- modbus_slave.logger.level = debug_modbus ? :debug : :warn
57
+ Aurora.logger = modbus_slave.logger = Logger.new($stderr)
58
+ modbus_slave.logger.level = debug_modbus ? :debug : :info
48
59
 
49
60
  registers = Aurora::ABCClient.query_registers(modbus_slave, ARGV[1], try_individual: try_individual)
50
61