File tree 4 files changed +27
-8
lines changed
4 files changed +27
-8
lines changed Original file line number Diff line number Diff line change @@ -60,19 +60,31 @@ cp config.yaml.example config.yaml
60
60
61
61
Now edit the ` config.yaml ` with your settings and preferences. Here's an example:
62
62
``` yaml
63
+ flash : true
64
+ network_check : true
63
65
label_printer :
64
66
enabled : true
65
67
type : pdf
66
68
name : Brother_QL_810W
67
69
ip : 192.168.1.33
70
+ serial_port_pattern : /dev/cu.usbserial*
68
71
` ` `
69
72
73
+ #### flash
74
+ Set to ` true` to flash the firmware, otherwise firmware will not be modified.
75
+
76
+ # ### network_check
77
+ Set to `true` to run the Alarm Panel Pro network check.
78
+
70
79
# ### label_printer
71
80
* *enabled* - `true` to enable label printing
72
81
* *type* - `zpl` if using a Zebra printer, otherwise `pdf`
73
82
* *name* - The CUPS name of the printer (use `lpstat -a`)
74
83
* *ip* - The IP address of the printer (only needed when using Zebra printers)
75
84
85
+ # ### serial_port_pattern
86
+ A file path pattern to scan for devices connected via USB/UART ports.
87
+
76
88
# # Running
77
89
Run the program by executing it in Ruby :
78
90
` ` ` shell
Original file line number Diff line number Diff line change 1
- serial_port_pattern: /dev/cu.usbserial*
1
+ flash: true
2
+ network_check: true
2
3
label_printer:
3
4
enabled: true
4
5
type: pdf
5
6
name: Brother_QL_810W
6
- ip: 192.168.1.33
7
+ ip: 192.168.1.33
8
+ serial_port_pattern: /dev/cu.usbserial*
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ def self.firmwares
6
6
end
7
7
8
8
def start
9
- flash_firmware
9
+ flash_firmware if @runner . config . flash
10
10
if @runner . config . label_printer [ :enabled ]
11
11
generate_label
12
12
print_label
Original file line number Diff line number Diff line change @@ -34,10 +34,15 @@ def self.firmwares
34
34
end
35
35
36
36
def start
37
- flash_firmware
38
- erase_lfs_region
39
- # get_device_id
40
- return unless network_check
37
+ if @runner . config . flash
38
+ flash_firmware
39
+ erase_lfs_region
40
+ else
41
+ get_device_id
42
+ end
43
+ if @runner . config . network_check
44
+ return unless network_check
45
+ end
41
46
if @runner . config . label_printer [ :enabled ]
42
47
generate_label
43
48
print_label
@@ -122,7 +127,7 @@ def generate_label
122
127
private
123
128
124
129
def ping_test ( ip )
125
- ping = `ping #{ ip } -i 0.5 -c 15 -q`
130
+ ping = `ping #{ ip } -g 56 -G 1500 -h 64 - i 0.5 -q`
126
131
packet_loss = ping . match ( /(\d +\. \d +)% packet loss/ ) [ 1 ] . to_i
127
132
return packet_loss
128
133
end
You can’t perform that action at this time.
0 commit comments