axpert_rs232 1.0.2 → 1.0.3

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
  SHA1:
3
- metadata.gz: a55f87bf3885c55d1f3d8765a6692ad24cb23b6f
4
- data.tar.gz: a428611424453e3d2822bf6a063ef5896551ac54
3
+ metadata.gz: 60d70ae8b654af6e6c01075786760ae0bdeaa415
4
+ data.tar.gz: 1dc9b6d89cd66fccbdbc1aeb8803043df60486a7
5
5
  SHA512:
6
- metadata.gz: 61875ef2d1849dfb505269808f3451e4632e84f9abeaafb53acf4571c98eaebd0cb3f7a1d1a9e701861deeda3013ab3e8cdb6323a05945cd7d9580378a60133f
7
- data.tar.gz: 001c759d71bb3b6ab3a286204ba7a97bfa672868bba935b664c636c371e5399e2f906df17f8863e330ff077a947daaacbb8cb7ba2f2a316569e49cf475ca68d7
6
+ metadata.gz: 6378823b19402f22e0a0677fd96c3e000f88aca25102f60ab2dc46f1f7a57818b86b0ba85d6fc7fac348950ecb89dba30043bb6cf71eb423ae1db8164876d271
7
+ data.tar.gz: bf1209ae0f494ace81ea289287f680631220c3b53329bfa7ea642b8ce1278d42307879c8e7fc9f67fd43d9c0972b827ff36ecfc6538d3172e8eeee54a87bf8e1
@@ -56,20 +56,20 @@ module AxpertCommands
56
56
  # { grid_voltage: 230.5, grid_current: 11.2, .. }
57
57
  DEVICE_RATING = OP.new(command: 'QPIRI', parser: lambda do |r|
58
58
  r = r.data[1..-1].split(' ')
59
- { grid_voltage: Float(r[0]),
60
- grid_current: Float(r[1]),
59
+ { utility_voltage: Float(r[0]),
60
+ utility_current: Float(r[1]),
61
61
  output_voltage: Float(r[2]),
62
62
  output_frequency: Float(r[3]),
63
63
  output_current: Float(r[4]),
64
64
  output_va: Integer(r[5], 10),
65
65
  output_watts: Integer(r[6], 10),
66
66
  battery_voltage: Float(r[7]),
67
- battery_recharge_voltage: Float(r[8]),
68
- battery_under_voltage: Float(r[9]),
67
+ battery_bulk_charge_voltage: Float(r[8]),
68
+ battery_cutoff_voltage: Float(r[9]),
69
69
  battery_bulk_charge_voltage: Float(r[10]),
70
70
  battery_float_charge_voltage: Float(r[11]),
71
71
  battery_type: ::AxpertConstants::BATTERY_TYPE[r[12]],
72
- maximum_ac_charge_current: Integer(r[13], 10),
72
+ maximum_utility_charge_current: Integer(r[13], 10),
73
73
  maximum_charge_current: Integer(r[14], 10),
74
74
  input_voltage_sensitivity: CONS::INPUT_VOLTAGE_SENSITIVITY[r[15]],
75
75
  output_source_priority: CONS::OUTPUT_SOURCE_PRIORITY[r[16]],
@@ -78,7 +78,7 @@ module AxpertCommands
78
78
  device_type: CONS::DEVICE_TYPE[r[19]],
79
79
  device_topology: CONS::DEVICE_TOPOLOGY[r[20]],
80
80
  output_mode: CONS::OUTPUT_MODE[r[21]],
81
- battery_redischarge_voltage: Float(r[22]),
81
+ battery_float_charge_voltage: Float(r[22]),
82
82
  pv_parallel_ok_mode: CONS::PV_PARALLEL_OK_MODE[r[23]],
83
83
  pv_power_balance_mode: CONS::PV_POWER_BALANCE_MODE[r[24]] }
84
84
  end)
@@ -115,8 +115,8 @@ module AxpertCommands
115
115
  DEVICE_STATUS = OP.new(command: 'QPIGS', parser: lambda do |r|
116
116
  r = r.data[1..-1].split(' ')
117
117
  status = r[16].chars.map { |c| Boolean(c) }
118
- { grid_voltage: Float(r[0]),
119
- grid_frequency: Float(r[1]),
118
+ { utility_voltage: Float(r[0]),
119
+ utility_frequency: Float(r[1]),
120
120
  output_voltage: Float(r[2]),
121
121
  output_frequency: Float(r[3]),
122
122
  output_va: Integer(r[4], 10),
@@ -126,7 +126,7 @@ module AxpertCommands
126
126
  battery_voltage: Float(r[8]),
127
127
  battery_charge_current: Float(r[9]),
128
128
  battery_capacity_remaining: Integer(r[10], 10),
129
- inverter_heatsink_celsius_temperature: Integer(r[11], 10),
129
+ inverter_temperature_celsius: Integer(r[11], 10),
130
130
  pv_battery_input_current: Integer(r[12], 10),
131
131
  pv_input_voltage: Float(r[13]),
132
132
  solar_charge_controller_battery_voltage: Float(r[14]),
@@ -166,7 +166,7 @@ module AxpertCommands
166
166
  errors << parse.yield('Bus voltage is too high', :fault) if r[2]
167
167
  errors << parse.yield('Bus voltage is too low', :fault) if r[3]
168
168
  errors << parse.yield('Bus soft start failed ', :fault) if r[4]
169
- errors << parse.yield('LINE_FAIL', :warning) if r[5]
169
+ errors << parse.yield('Utility input failure', :warning) if r[5]
170
170
  errors << parse.yield('Output short circuited', :warning) if r[6]
171
171
  errors << parse.yield('Inverter voltage too low', :fault) if r[7]
172
172
  errors << parse.yield('Output voltage is too high', :fault) if r[8]
@@ -207,10 +207,10 @@ module AxpertCommands
207
207
  { output_voltage: Float(r[0]),
208
208
  output_frequency: Float(r[1]),
209
209
  maximum_ac_charge_current: Integer(r[2], 10),
210
- battery_under_voltage: Float(r[3]),
210
+ battery_cutoff_voltage: Float(r[3]),
211
211
  battery_float_charge_voltage: Float(r[4]),
212
212
  battery_bulk_charge_voltage: Float(r[5]),
213
- battery_recharge_voltage: Float(r[6]),
213
+ battery_bulk_charge_voltage: Float(r[6]),
214
214
  maximum_charge_current: Integer(r[7], 10),
215
215
  input_voltage_sensitivity: CONS::INPUT_VOLTAGE_SENSITIVITY[r[8]],
216
216
  output_source_priority: CONS::OUTPUT_SOURCE_PRIORITY[r[9]],
@@ -226,7 +226,7 @@ module AxpertCommands
226
226
  enable_bypass_to_utility_on_overload: Boolean(r[19]),
227
227
  enable_lcd_timeout_escape_to_default_page: Boolean(r[20]),
228
228
  output_mode: CONS::OUTPUT_MODE[r[21]],
229
- battery_redischarge_voltage: Float(r[22]),
229
+ battery_float_charge_voltage: Float(r[22]),
230
230
  pv_parallel_ok_mode: CONS::PV_PARALLEL_OK_MODE[r[23]],
231
231
  pv_power_balance_mode: CONS::PV_POWER_BALANCE_MODE[r[24]] }
232
232
  end)
@@ -282,8 +282,8 @@ module AxpertCommands
282
282
  serial_number: r[1],
283
283
  device_mode: CONS::DEVICE_MODE[r[2]],
284
284
  fault_code: CONS::FAULT_CODE[r[3]],
285
- grid_voltage: Float(r[4]),
286
- grid_frequency: Float(r[5]),
285
+ utility_voltage: Float(r[4]),
286
+ utility_frequency: Float(r[5]),
287
287
  output_voltage: Float(r[6]),
288
288
  output_frequency: Float(r[7]),
289
289
  output_va: Integer(r[8], 10),
@@ -309,7 +309,7 @@ module AxpertCommands
309
309
  maximum_charge_current: Integer(r[22], 10),
310
310
  device_maximum_charge_current: Integer(r[23], 10),
311
311
  pv_input_current: Integer(r[24], 10),
312
- battery_discharge_current: Integer(r[25], 10) }
312
+ battery_redischarge_voltage: Integer(r[25], 10) }
313
313
  end)
314
314
 
315
315
  ##
@@ -28,7 +28,7 @@ class VoltronicDeviceOperation
28
28
  end
29
29
 
30
30
  @read_timeout = Integer(input.fetch(:serial_read_timeout_seconds, 2))
31
- @write_timeout = Integer(input.fetch(:serial_write_timeout_seconds, 2))
31
+ @retry_timeout = Integer(input.fetch(:serial_retry_timeout_milliseconds, 50))
32
32
 
33
33
  @termination_character = begin
34
34
  parse = input.fetch(:serial_termination_character, "\r").to_s
@@ -51,8 +51,8 @@ class VoltronicDeviceOperation
51
51
  while(true)
52
52
  ch = serial.getc # Retrieve a single character from Serial port
53
53
  if ch.nil?
54
- raise ::IOError.new("IO read timeout reached, giving up") if (Time.now.to_i > read_timeout)
55
- sleep 0.1 # 100ms pause before polling again
54
+ raise ::IOError.new("Read timeout reached on serial port, giving up") if (Time.now.to_i > read_timeout)
55
+ sleep (@retry_timeout/1000.0) # Pause before polling again
56
56
  next
57
57
  end
58
58
  parse += ch
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: axpert_rs232
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johan van der Vyver