|
4 | 4 |
|
5 | 5 | echo "Starting Z-Wave Stack..." |
6 | 6 |
|
| 7 | +# Helper function to prefix output with process name |
| 8 | +run_with_prefix() { |
| 9 | + local prefix="$1" |
| 10 | + shift |
| 11 | + "$@" 2>&1 | while IFS= read -r line; do echo "[$prefix] $line"; done |
| 12 | +} |
| 13 | + |
7 | 14 | # Start 3 controllers |
8 | 15 | echo "Starting Controller 1 (Z-Wave JS) on port 5000..." |
9 | | -./zwave_stack/bin/ZW_zwave_ncp_serial_api_controller.elf --port 5000 --storage ./zwave_stack/storage/controller1 & |
| 16 | +run_with_prefix "Controller1" ./zwave_stack/bin/ZW_zwave_ncp_serial_api_controller.elf --port 5000 --storage ./zwave_stack/storage/controller1 & |
10 | 17 |
|
11 | 18 | echo "Starting Controller 2 (CTT) on port 6001..." |
12 | | -./zwave_stack/bin/ZW_zwave_ncp_serial_api_controller.elf --port 6001 --storage ./zwave_stack/storage/controller2 & |
| 19 | +run_with_prefix "Controller2" ./zwave_stack/bin/ZW_zwave_ncp_serial_api_controller.elf --port 6001 --storage ./zwave_stack/storage/controller2 & |
13 | 20 |
|
14 | 21 | echo "Starting Controller 3 (CTT) on port 6002..." |
15 | | -./zwave_stack/bin/ZW_zwave_ncp_serial_api_controller.elf --port 6002 --storage ./zwave_stack/storage/controller3 & |
| 22 | +run_with_prefix "Controller3" ./zwave_stack/bin/ZW_zwave_ncp_serial_api_controller.elf --port 6002 --storage ./zwave_stack/storage/controller3 & |
16 | 23 |
|
17 | 24 | # Start 2 end devices |
18 | 25 | echo "Starting End Device 1 on port 6003..." |
19 | | -./zwave_stack/bin/ZW_zwave_ncp_serial_api_end_device.elf --port 6003 --storage ./zwave_stack/storage/enddevice1 & |
| 26 | +run_with_prefix "EndDevice1" ./zwave_stack/bin/ZW_zwave_ncp_serial_api_end_device.elf --port 6003 --storage ./zwave_stack/storage/enddevice1 & |
20 | 27 |
|
21 | 28 | echo "Starting End Device 2 on port 6004..." |
22 | | -./zwave_stack/bin/ZW_zwave_ncp_serial_api_end_device.elf --port 6004 --storage ./zwave_stack/storage/enddevice2 & |
| 29 | +run_with_prefix "EndDevice2" ./zwave_stack/bin/ZW_zwave_ncp_serial_api_end_device.elf --port 6004 --storage ./zwave_stack/storage/enddevice2 & |
23 | 30 |
|
24 | 31 | # Start the Zniffer simulator |
25 | 32 | echo "Starting Zniffer on port 4905..." |
26 | | -python3 ./zwave_stack/bin/zniffer.py 1234 & |
| 33 | +run_with_prefix "Zniffer" python3 ./zwave_stack/bin/zniffer.py 1234 & |
27 | 34 |
|
28 | 35 | echo "All Z-Wave binaries started!" |
29 | 36 | echo "Controller 1: localhost:5000 (Z-Wave JS FirstController)" |
|
0 commit comments