├── .gitattributes
├── .gitignore
├── ATX_Adapter_board
├── Images
│ ├── PC_ATX_board.jpg
│ ├── PC_MB_SW_extender.png
│ ├── X540-T1_full_height_bracket.jpg
│ ├── X540-T1_full_height_bracket.png
│ └── X540-T1_low_profile_bracket.jpg
├── Production
│ ├── bom.csv
│ ├── designators.csv
│ ├── gerber.zip
│ ├── netlist.ipc
│ └── positions.csv
└── README.md
├── ATX_Switch_Interface_adaptor
├── Board
│ ├── Images
│ │ └── ATX_SW_Interface.png
│ ├── Production
│ │ ├── ATX_SW_Interface.zip
│ │ ├── bom.csv
│ │ └── positions.csv
│ └── README.md
├── Case
│ ├── Images
│ │ └── ATX_SW_Interface_v1.mp4
│ ├── Production
│ │ ├── ATX SW If box base v1.3mf
│ │ ├── ATX SW If box base v1.step
│ │ ├── ATX SW Interface box Top v1.3mf
│ │ └── ATX SW Interface box Top v1.step
│ └── README.md
├── Images
│ ├── ATX_SW_Interface.png
│ ├── CP2112_USB_to_I2C_SMBUS_1-500x500.png
│ ├── atx_switch_interface_board_1.jpg
│ ├── i2c_device_detect.png
│ └── i2cdetect_output.png
└── README.md
├── ATX_Switches
├── Boards
│ ├── Daughter_board
│ │ ├── Images
│ │ │ └── Daughter_board_TH_socket_v1.png
│ │ ├── Production
│ │ │ ├── gerber.zip
│ │ │ ├── modified_IC_bom.csv
│ │ │ └── modified_positions.csv
│ │ └── README.md
│ ├── Main_board
│ │ ├── Images
│ │ │ └── Main_board_TH_socket_v1.png
│ │ ├── Production
│ │ │ ├── gerber.zip
│ │ │ ├── modified_bom.csv
│ │ │ └── modified_positions.csv
│ │ └── README.md
│ └── README.md
├── Cases
│ ├── Images
│ │ ├── 4-port_case_assembled_LHS.png
│ │ ├── 4-port_case_assembled_RHS.png
│ │ ├── 4-port_case_top.png
│ │ ├── 8-port_case_assembled_LHS.png
│ │ ├── 8-port_case_assembled_RHS.png
│ │ ├── 8-port_case_middle.png
│ │ ├── 8-port_case_top.png
│ │ └── Case_bottom.png
│ ├── Production
│ │ ├── ATX Switch 4-port top - 2 colour.3mf
│ │ ├── ATX Switch 4-port top - 2 colour.step
│ │ ├── ATX Switch 8-port middle.3mf
│ │ ├── ATX Switch 8-port middle.step
│ │ ├── ATX Switch 8-port top.3mf
│ │ ├── ATX Switch 8-port top.step
│ │ ├── ATX Switch bottom.3mf
│ │ └── ATX Switch bottom.step
│ └── README.md
├── Images
│ ├── Daughter_board_TH_socket_v1.png
│ └── Main_board_TH_socket_v1.png
└── README.md
├── DIY_PiKVM
├── ATX_Switch_connector_board_for_Pi
│ ├── Images
│ │ ├── ATX_connector_board_rotate.jpg
│ │ ├── Numbered_ATX_board_connector_bottom_v1.png
│ │ └── Numbered_ATX_board_connector_top_v1.png
│ ├── Production
│ │ ├── ATX_Breakout_board_v1_1.zip
│ │ ├── bom.csv
│ │ ├── designators.csv
│ │ ├── netlist.ipc
│ │ └── positions.csv
│ └── README.md
├── Case
│ ├── Images
│ │ └── DIY_PiKVM_v2_case.jpg
│ ├── Production
│ │ ├── DIY_PiKVM_ATXSW_v1_Back.stl
│ │ └── DIY_PiKVM_ATXSW_v1_Front.stl
│ └── README.md
├── Images
│ ├── Latest_DIY_unit_2024-03-25_gimp4.png
│ ├── Numbered_ATX_board_connector_bottom_v1.png
│ ├── Numbered_ATX_board_connector_top_v1.png
│ └── USB-C_PWR_Splitter5V_no_barrel_jack.jpg
├── README.md
└── Scripts
│ ├── ATX_Switch_software_install_guide.pdf
│ ├── ATX_python_scripts
│ ├── atx_xh_hk4401.py
│ └── etc
│ │ └── atx_switch
│ │ ├── atx_change_port.py
│ │ ├── atx_kvm_mapping.yaml
│ │ ├── atx_switch_initialisation.yaml
│ │ ├── change_atx_from_kvm.py
│ │ ├── port_test_1.py
│ │ ├── port_test_2.py
│ │ ├── port_test_3.py
│ │ ├── port_test_4.py
│ │ ├── select1.py
│ │ ├── select2.py
│ │ ├── select3.py
│ │ ├── select4.py
│ │ └── test_port_led.py
│ ├── Modified_kvmd_files
│ ├── bin
│ │ └── initialise_atx_switches
│ ├── boot
│ │ └── config.txt
│ ├── etc
│ │ └── kvmd
│ │ │ ├── fan.ini
│ │ │ ├── override_with_kvm_mapping.yaml
│ │ │ └── override_without_kvm_mapping.yaml
│ └── initialise_atx_switches.service
│ └── README.md
├── Images
├── ATX_Switch_4_2024-03-25.png
├── ATX_Switch_4_back_angle_v1.png
├── ATX_Switch_8_2024-03-25.png
├── ATX_Switch_8_back_angle_v1.png
├── ATX_Switch_Interface_adaptor.png
├── DIY_PiKVM_for_ATX_Switch_v1.png
├── Latest_DIY_unit_2024-03-25_gimp4.png
├── PiKVM_ATX_op1.mp4
├── PiKVM_ATX_op2.mp4
├── Typical_deployment_architecture_v1.png
├── Typical_deployment_commercial_pikvm_v1.png
├── Typical_deployment_diy_pikvm_v1.png
├── WebUI_Source_menu.png
└── atx_switch_interface_1.png
├── LICENSE.md
├── README.md
└── Rough_costs
├── README.md
└── rough_costs.pdf
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | /.obsidian
3 |
--------------------------------------------------------------------------------
/ATX_Adapter_board/Images/PC_ATX_board.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/ATX_Adapter_board/Images/PC_ATX_board.jpg
--------------------------------------------------------------------------------
/ATX_Adapter_board/Images/PC_MB_SW_extender.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/ATX_Adapter_board/Images/PC_MB_SW_extender.png
--------------------------------------------------------------------------------
/ATX_Adapter_board/Images/X540-T1_full_height_bracket.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/ATX_Adapter_board/Images/X540-T1_full_height_bracket.jpg
--------------------------------------------------------------------------------
/ATX_Adapter_board/Images/X540-T1_full_height_bracket.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/ATX_Adapter_board/Images/X540-T1_full_height_bracket.png
--------------------------------------------------------------------------------
/ATX_Adapter_board/Images/X540-T1_low_profile_bracket.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/ATX_Adapter_board/Images/X540-T1_low_profile_bracket.jpg
--------------------------------------------------------------------------------
/ATX_Adapter_board/Production/bom.csv:
--------------------------------------------------------------------------------
1 | Designator,Footprint,Quantity,Value,LCSC Part #,
2 | "H1, H2",MountingHole_3.2mm_M3_Pad,2,MountingHole_Pad,,
3 | J1,RJHSE5381,1,RJHSE-5381,,https://www.aliexpress.com/item/32728838902.html?spm=a2g0o.order_list.order_list_main.308.71011802gTyL6x
4 | "J10, J4, J6, J8",PinSocket_1x02_P2.54mm_Vertical,4,Conn_01x02,,
5 | "J3, J5, J7, J9",PinHeader_1x02_P2.54mm_Vertical,4,Conn_01x02,,
6 |
--------------------------------------------------------------------------------
/ATX_Adapter_board/Production/designators.csv:
--------------------------------------------------------------------------------
1 | G***:1
2 | H1:1
3 | H2:1
4 | J1:1
5 | J10:1
6 | J3:1
7 | J4:1
8 | J5:1
9 | J6:1
10 | J7:1
11 | J8:1
12 | J9:1
13 |
--------------------------------------------------------------------------------
/ATX_Adapter_board/Production/gerber.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/ATX_Adapter_board/Production/gerber.zip
--------------------------------------------------------------------------------
/ATX_Adapter_board/Production/netlist.ipc:
--------------------------------------------------------------------------------
1 | P CODE 00
2 | P UNITS CUST 0
3 | P arrayDim N
4 | 317/LED?HDD+ J9 -1 D0394PA00X+027460Y-023070X0669Y0669R000S0
5 | 317/LED?HDD- J9 -2 D0394PA00X+027460Y-024070X0669Y0669R000S0
6 | 367N/C J1 D1299UA00X+019169Y-019470X1299Y0000R090S0
7 | 367N/C J1 D1299UA00X+019169Y-024470X1299Y0000R090S0
8 | 317/LED?PWR+ J1 -1 D0370PA00X+020169Y-023369X0576Y0576R090S0
9 | 317/LED?PWR- J1 -2 D0370PA00X+020870Y-022969X0576Y0000R090S0
10 | 317/LED?HDD+ J1 -3 D0370PA00X+020169Y-022569X0576Y0000R090S0
11 | 317/BTN?PWR- J1 -4 D0370PA00X+020870Y-022170X0576Y0000R090S0
12 | 317/BTN?PWR+ J1 -5 D0370PA00X+020169Y-021770X0576Y0000R090S0
13 | 317/LED?HDD- J1 -6 D0370PA00X+020870Y-021371X0576Y0000R090S0
14 | 317/BTN?RST+ J1 -7 D0370PA00X+020169Y-020971X0576Y0000R090S0
15 | 317/BTN?RST- J1 -8 D0370PA00X+020870Y-020571X0576Y0000R090S0
16 | 317LASH}K_1-PAD9) J1 -9 D0370PA00X+022768Y-024671X0576Y0000R090S0
17 | 317ASH}K_2-PAD10) J1 -10 D0370PA00X+022768Y-023769X0576Y0000R090S0
18 | 317(J1-A.K-PAD11) J1 -11 D0370PA00X+022768Y-020171X0576Y0000R090S0
19 | 317ASH}K_3-PAD12) J1 -12 D0370PA00X+022768Y-019269X0576Y0000R090S0
20 | 317GND J1 -MH1 D0638PA00X+020520Y-025171X0957Y0000R090S0
21 | 317GND J1 -MH2 D0638PA00X+020520Y-018769X0957Y0000R090S0
22 | 317/BTN?PWR+ J3 -1 D0394PA00X+027460Y-019670X0669Y0669R000S0
23 | 317/BTN?PWR- J3 -2 D0394PA00X+027460Y-020670X0669Y0669R000S0
24 | 317GND H1 -1 D1260PA00X+019488Y-008012X2520Y0000R000S0
25 | 317/BTN?RST+ J5 -1 D0394PA00X+027460Y-016480X0669Y0669R000S0
26 | 317/BTN?RST- J5 -2 D0394PA00X+027460Y-017480X0669Y0669R000S0
27 | 317/BTN?RST+ J6 -1 D0394PA00X+025400Y-016480X0669Y0669R000S0
28 | 317/BTN?RST- J6 -2 D0394PA00X+025400Y-017480X0669Y0669R000S0
29 | 317/LED?PWR+ J7 -1 D0394PA00X+027460Y-026290X0669Y0669R000S0
30 | 317/LED?PWR- J7 -2 D0394PA00X+027460Y-027290X0669Y0669R000S0
31 | 317/LED?HDD+ J10 -1 D0394PA00X+025400Y-023070X0669Y0669R000S0
32 | 317/LED?HDD- J10 -2 D0394PA00X+025400Y-024070X0669Y0669R000S0
33 | 317/BTN?PWR+ J4 -1 D0394PA00X+025400Y-019670X0669Y0669R000S0
34 | 317/BTN?PWR- J4 -2 D0394PA00X+025400Y-020670X0669Y0669R000S0
35 | 317/LED?PWR+ J8 -1 D0394PA00X+025400Y-026290X0669Y0669R000S0
36 | 317/LED?PWR- J8 -2 D0394PA00X+025400Y-027290X0669Y0669R000S0
37 | 317GND H2 -1 D1260PA00X+019488Y-029272X2520Y0000R000S0
38 | 999
39 |
--------------------------------------------------------------------------------
/ATX_Adapter_board/Production/positions.csv:
--------------------------------------------------------------------------------
1 | Designator,Mid X,Mid Y,Rotation,Layer
2 | J1,51.1048,-55.8038,270.0,top
3 | J10,64.491,-59.8478,0.0,top
4 | J3,69.7484,-51.2368,0.0,top
5 | J4,64.491,-51.2118,0.0,top
6 | J5,69.7484,-43.1342,0.0,top
7 | J6,64.491,-43.1092,0.0,top
8 | J7,69.7484,-68.0516,0.0,top
9 | J8,64.491,-68.0266,0.0,top
10 | J9,69.7484,-59.8728,0.0,top
11 |
--------------------------------------------------------------------------------
/ATX_Adapter_board/README.md:
--------------------------------------------------------------------------------
1 | ##### ATX breakout adapter for insertion inside case of managed device (PC / Server).
2 |
3 |
4 |
5 |
6 |
7 | Compatible with pinout of [PiKVM ATX control board](https://docs.pikvm.org/atx_board/#pinout) enabling connection to managed devices ATX header, and its case controls (where appropriate).
8 |
9 | The board is **self-assembly** and provides two banks of 4x 2-pin connectors for motherboard (MB) and case connectivity respectively. The connector rows are labelled with the ATX header / case connector that they relate to - Reset button (RST_BTN); Power button (PWR_BTN); Hard drive activity LED (HDD_LED) and Power LED (PWR_LED).
10 |
11 | In reality the MB and Case banks are 1:1 connected so can be connected to either ATX header or case cables provided that compatible 2-pin connectors are installed. However to reduce the risk of mix-up during installation my preferred approach has been to use:
12 |
13 | - Male connectors to support case connectivity (if this is to be used), as case cables are normally provided with female plugs on their ends.
14 |
15 | - Female connectors to support ATX header connectivity.
16 |
17 | - Note - this requires the use of Male-Female Dupont ribbon cable (or similar) to allow connection to the male headers on the motherboard.
18 |
19 | - My preference has been to use a PC motherboard switch extender for this - mainly as the ends are labelled, which reduces installation risk. However I also think they look better than multicoloured ribbon cable. They are more expensive though!
20 |
21 |
22 |
23 |
24 |
25 | The board has been designed to work with the metal brackets for the single port Intel X540-T1 NIC which are available in both full height and low profile variants:
26 |
27 | |  |  |
28 | | --------------------------------------------- | --------------------------------------------- |
29 |
30 | These are available from a number of vendors (which keep changing).
31 |
32 | At the time of writing the cheapest available was from a vendor on AliExpress:
33 |
34 | - [Full Height](https://www.aliexpress.us/item/3256804856153513.html?spm=a2g0o.productlist.main.3.d777281cjyfICR&algo_pvid=43fd2ca8-fdaa-4724-b255-38cb94d674ff&algo_exp_id=43fd2ca8-fdaa-4724-b255-38cb94d674ff-1&pdp_npi=4%40dis%21GBP%211.60%211.60%21%21%2113.94%2113.94%21%40211b441e17135936427566107e7dde%2112000032784801700%21sea%21US%214412103182%21&curPageLogUid=pC5GEaC1rl1W&utparam-url=scene%3Asearch%7Cquery_from%3A)
35 | - [Low Profile](https://www.aliexpress.us/item/3256805210264567.html?spm=a2g0o.productlist.main.5.d777281cjyfICR&algo_pvid=43fd2ca8-fdaa-4724-b255-38cb94d674ff&algo_exp_id=43fd2ca8-fdaa-4724-b255-38cb94d674ff-2&pdp_npi=4%40dis%21GBP%211.60%211.60%21%21%2113.94%2113.94%21%40211b441e17135936427566107e7dde%2112000032895051446%21sea%21US%214412103182%21&curPageLogUid=1LfviPZIJG9c&utparam-url=scene%3Asearch%7Cquery_from%3A)
36 |
37 |
--------------------------------------------------------------------------------
/ATX_Switch_Interface_adaptor/Board/Images/ATX_SW_Interface.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/ATX_Switch_Interface_adaptor/Board/Images/ATX_SW_Interface.png
--------------------------------------------------------------------------------
/ATX_Switch_Interface_adaptor/Board/Production/ATX_SW_Interface.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/ATX_Switch_Interface_adaptor/Board/Production/ATX_SW_Interface.zip
--------------------------------------------------------------------------------
/ATX_Switch_Interface_adaptor/Board/Production/bom.csv:
--------------------------------------------------------------------------------
1 | Designator,Footprint,Quantity,Value,LCSC Part #
2 | "J1, J2",RJHSE5381,2,RJHSE-5381,
3 | J3,PinHeader_2x04_P2.54mm_Vertical,1,Conn_02x04_Top_Bottom,
4 | U1,CP2112 Debug Board,1,~,
5 |
--------------------------------------------------------------------------------
/ATX_Switch_Interface_adaptor/Board/Production/positions.csv:
--------------------------------------------------------------------------------
1 | Designator,Mid X,Mid Y,Rotation,Layer
2 | J1,97.157,-59.1053,270.0,top
3 | J2,140.1308,-68.7095,90.0,top
4 | J3,130.5968,-85.9994,90.0,top
5 | U1,106.2736,-81.0768,0.0,top
6 |
--------------------------------------------------------------------------------
/ATX_Switch_Interface_adaptor/Board/README.md:
--------------------------------------------------------------------------------
1 | # ATX Switch Interface board
2 |
3 |
4 |
5 |
6 |
7 | Basically this simple board just takes the I2C outputs and power from the CP2112 debug board (connected to PiKVM via USB), together with the active GPIO pins from the ATX port, and maps these to the pin configuration used by the ATX Switch.
8 |
9 | Consists of:
10 |
11 | - PCB
12 | - 2x RJ45 connectors
13 | - 1x 7x2row female (socket) connector - 2.54mm
14 | - 1x 4x2row male (pin) connector - 2.54mm
15 | - CP2112 debug board (with 7x2row pin connector soldered to underside)
16 | - 2x M2.5 11mm brass standoffs
17 | - 4x M2.5x5mm flat head bolts
18 |
19 |
--------------------------------------------------------------------------------
/ATX_Switch_Interface_adaptor/Case/Images/ATX_SW_Interface_v1.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/ATX_Switch_Interface_adaptor/Case/Images/ATX_SW_Interface_v1.mp4
--------------------------------------------------------------------------------
/ATX_Switch_Interface_adaptor/Case/Production/ATX SW If box base v1.3mf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/ATX_Switch_Interface_adaptor/Case/Production/ATX SW If box base v1.3mf
--------------------------------------------------------------------------------
/ATX_Switch_Interface_adaptor/Case/Production/ATX SW Interface box Top v1.3mf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/ATX_Switch_Interface_adaptor/Case/Production/ATX SW Interface box Top v1.3mf
--------------------------------------------------------------------------------
/ATX_Switch_Interface_adaptor/Case/README.md:
--------------------------------------------------------------------------------
1 | # ATX Switch Interface case
2 |
3 |
4 |
5 |
6 |
7 |
8 | https://github.com/user-attachments/assets/1a655d50-f39f-413e-b5ea-170363b08b48
9 |
10 |
11 | Consists of:
12 |
13 | - Printed in PLA
14 | - Uses [M2.5 (OD3.5) 6mm heat inserts](https://www.aliexpress.com/item/1005004975376499.html) within the support pillars to allow for repeated opening / closing.
15 |
16 | Case parts are fastened together with 4x 12mm countersunk black M2.5 bolts.
17 |
18 |
--------------------------------------------------------------------------------
/ATX_Switch_Interface_adaptor/Images/ATX_SW_Interface.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/ATX_Switch_Interface_adaptor/Images/ATX_SW_Interface.png
--------------------------------------------------------------------------------
/ATX_Switch_Interface_adaptor/Images/CP2112_USB_to_I2C_SMBUS_1-500x500.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/ATX_Switch_Interface_adaptor/Images/CP2112_USB_to_I2C_SMBUS_1-500x500.png
--------------------------------------------------------------------------------
/ATX_Switch_Interface_adaptor/Images/atx_switch_interface_board_1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/ATX_Switch_Interface_adaptor/Images/atx_switch_interface_board_1.jpg
--------------------------------------------------------------------------------
/ATX_Switch_Interface_adaptor/Images/i2c_device_detect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/ATX_Switch_Interface_adaptor/Images/i2c_device_detect.png
--------------------------------------------------------------------------------
/ATX_Switch_Interface_adaptor/Images/i2cdetect_output.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/ATX_Switch_Interface_adaptor/Images/i2cdetect_output.png
--------------------------------------------------------------------------------
/ATX_Switch_Interface_adaptor/README.md:
--------------------------------------------------------------------------------
1 | # ATX Switch Interface
2 |
3 | ## Design Criteria
4 |
5 | After producing the ATX Switch / DIY PiKVM combination for my home environment, I revisited whether it would be possible to use the ATX Switch with one of the standard PiKVM's.
6 |
7 | The main interface to the ATX Switch environment is the relevant GPIO pins, and I2C. However the PiKVM devices were fixed units - with no expansion capability unless you used existing ports, or 'hacked' the units (which most people won't want to do!).
8 |
9 | Therefore it was necessary to determine if the provided ports could be utilised / re-purposed.
10 |
11 | The standard ATX port on the PiKVM has a fixed pinout, but the relevant GPIO pins could be mapped externally to the configuration used by the ATX Switch.
12 |
13 | Which left the need to provide an I2C interface.
14 |
15 | The only other ports available for use on the PiKVM were the USB ports, so it was decided to look at providing a USB<-->I2C interface.
16 |
17 | A number of USB<-->I2C adaptors were reviewed based on functionality / availability / support / cost .....
18 |
19 | It was determined that the CP2112 HID USB to SMBus / I2C Bridge had kernel support within Arch Linux[^1], and was available in a relatively inexpensive 'debug board' package:
20 |
21 |
22 |
23 |
24 |
25 | This board was tested in the ATX Switch environment and supported the required functionality, with minimal code changes.
26 |
27 | A simple board was then constructed incorporating the CP2112 board and a pair of RJ45 connectors, to provide the interface between the PiKVM and ATX Switch.
28 |
29 |
30 |
31 |
32 |
33 |
34 | >[!NOTE]
35 | >
36 | >The CP2112 board also supports GPIO expansion, although this capability was not specifically required for the purpose of this interface adaptor. It may be possible however for this approach to be used to control the ATX functionality (via the ATX Switch) by remapping GPIO pins in the PiKVM code.
37 | >
38 | >Accordingly four of the CP2112 board GPIO pins (3, 4, 5, 6) have been configured so that they can be jumpered to ATX Switch functionality (RSTB, PWRB, HDDL, PWRL) if desired[^2].
39 | >
40 | >$\color{red}{\textsf{THIS FUNCTIONALITY HAS NOT BEEN TESTED!!!}}$
41 |
42 |
43 |
44 | ## Required Parts
45 |
46 | - [3D printed case](./Case/README.md)
47 | - [ATX Switch Interface board](./Board/README.md)
48 | - CP2112 debug board
49 | - 4x M2.5x10 countersunk bolts[^3]
50 | - USB-A to micro-USB cable
51 | - 2x 8-wire Ethernet cables
52 |
53 |
54 |
55 | ## Installation
56 |
57 | Connect the ATX Switch Interface to the PiKVM (as per the overview diagram in the introduction)
58 |
59 | - 8-wire Ethernet cable between the ATX port on the PiKVM and the ATX port on the Interface
60 | - USB cable between spare port on the PiKVM and the micro-USB port on the Interface
61 |
62 | Connect ATX Switch Interface to the ATX Switch using an 8-wire Ethernet cable.
63 |
64 | Start the PiKVM and determine the BUS ID of the CP2112 controller in the ATX Switch Interface by running the command: **i2cdetect -l**
65 |
66 | The output should be similar to:
67 |
68 |
69 |
70 |
71 | In the above we can see that the CP2112 controller is on bus 23
72 |
73 | Verify that the CP2112 I2C controller is working and can see the attached ATX Switch(es) by using the command : **i2cdetect -r -y 23** (substitute the bus ID determined above for the last value, if necessary)
74 |
75 | >[!NOTE]
76 | >
77 | >The CP2112 module is unable to use the I2C quick write capability, so the **-r** parameter must be used to get proper output.
78 |
79 | The output should be similar to:
80 |
81 |
82 |
83 |
84 | Here we can see that there are 2x ATX Switches configured at addresses 0x20 and 0x21
85 |
86 |
87 |
88 | Update the value in the 'i2c_bus_id' field in the ATX Switch environment configuration file (**atx_switch_initialisation.yaml**) to reflect the bus ID determined[^4]
89 |
90 | Configure the rest of the ATX Switch environment within the PiKVM (using the approach defined in the DIY PiKVM [Scripts](../DIY_PiKVM/Scripts/README.md) area).
91 |
92 | >[!NOTE]
93 | >
94 | >Ensure that the PiKVM kernel has been updated to include CP2112 support by running **pikvm-update**
95 |
96 | ###### Footnotes
97 |
98 | [^1]: Initially it was determined that the PiKVM kernel had not been built with CP2112 support included, but Max kindly reconfigured the kernel to re-instate support - my thanks for this.
99 |
100 | [^2]: If this approach were to be used then make sure that nothing is connected to the ATX port connector (RJ45) on the interface unit - as the ATX port on the PiKVM will still be physically connected to the assigned GPIO pins on the Raspberry Pi.
101 |
102 | [^3]: Can use screws but will need to reduce size of affixing hole in case top
103 |
104 | [^4]: The original ATX Switch environment scripts had the 'standard' Pi4 internal bus ID (=1) hardcoded in two locations. These could be manually changed quite easily, but it was decided to include the bus_id as a configurable item and the code was changed to use this value from the configuration file.
105 |
106 |
--------------------------------------------------------------------------------
/ATX_Switches/Boards/Daughter_board/Images/Daughter_board_TH_socket_v1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/ATX_Switches/Boards/Daughter_board/Images/Daughter_board_TH_socket_v1.png
--------------------------------------------------------------------------------
/ATX_Switches/Boards/Daughter_board/Production/gerber.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/ATX_Switches/Boards/Daughter_board/Production/gerber.zip
--------------------------------------------------------------------------------
/ATX_Switches/Boards/Daughter_board/Production/modified_IC_bom.csv:
--------------------------------------------------------------------------------
1 | Designator,Footprint,Quantity,Value,Do Not Populate,LCSC Part #,Potential Source
2 | "C1, C2, C3",603,3,100nF,,C14663,
3 | "H2, H3, H5, H6",MountingHole_2.7mm_M2.5_DIN965_Pad_TopBottom,4,MountingHole_Pad,,,
4 | J1,PinSocket_2x06_P2.54mm_Vertical,1,Conn_02x06_Odd_Even,DNP,C2935986,
5 | J2,AMPHENOL_RJHSE-5381-04,1,RJHSE-5381-04,DNP,,https://www.aliexpress.com/item/32730855182.html?spm=a2g0o.order_list.order_list_main.315.f030180241DGLo
6 | "R10, R2, R3, R4, R5, R6, R7, R8, R9",603,8,4.7k,,C23162,
7 | "R11, R12, R13, R14, R15, R16, R17, R18, R19, R20, R21, R22, R23, R24, R25, R26, R27",603,17,390,,C23151,
8 | "U1, U2, U3",DIP-16_W7.62mm_Socket_LongPads,3,CD4052B,DNP,C507162,
9 | "U10, U11, U12, U13, U14, U15, U16, U17, U18, U19, U4, U5, U6, U7, U8, U9",DIP-4_W7.62mm_Socket_LongPads,16,LTV-817,DNP,C109225,
10 |
--------------------------------------------------------------------------------
/ATX_Switches/Boards/Daughter_board/Production/modified_positions.csv:
--------------------------------------------------------------------------------
1 | Designator,Mid X,Mid Y,Rotation,Layer
2 | C1,121.1321,-91.6217,0,top
3 | C2,121.4159,-62.6886,0,top
4 | C3,121.4159,-34.7139,0,top
5 | J1,130.293,-123.6703,90,top
6 | J2,169.2009,-79.647,90,top
7 | R10,149.2465,-85.9231,0,top
8 | R11,128.5211,-108.0742,180,top
9 | R12,141.986,-108.1024,180,top
10 | R13,128.7937,-85.9167,180,top
11 | R14,140.3096,-85.9282,0,top
12 | R15,129.3876,-64.0326,180,top
13 | R16,142.171,-64.2333,180,top
14 | R17,128.6634,-41.5141,180,top
15 | R18,143.2306,-41.5544,180,top
16 | R19,135.89,-118.5164,180,top
17 | R2,113.8174,-116.1796,180,top
18 | R20,149.606,-118.6688,180,top
19 | R21,136.2295,-96.5034,180,top
20 | R22,148.836,-96.5034,180,top
21 | R23,136.1582,-74.6771,0,top
22 | R24,147.7518,-74.7522,180,top
23 | R25,137.2,-52.2,0,top
24 | R26,150.9494,-52.1,0,top
25 | R27,156.9974,-115.0112,180,top
26 | R3,135.89,-108.204,0,top
27 | R4,148.9964,-108.1024,0,top
28 | R5,135.8682,-85.9231,180,top
29 | R6,135.9086,-41.5141,0,top
30 | R7,148.9506,-64.2343,0,top
31 | R8,149.3055,-41.6276,0,top
32 | R9,136.1876,-64.1894,180,top
33 | U1,114.3031,-95.3278,270,top
34 | U10,135.9712,-92.4283,90,top
35 | U11,149.3471,-92.404,90,top
36 | U12,128.5635,-57.4422,270,top
37 | U13,141.8191,-57.4223,270,top
38 | U14,136.2159,-70.7659,90,top
39 | U15,149.4232,-70.8081,90,top
40 | U16,128.3657,-34.8889,270,top
41 | U17,142.1381,-34.941,270,top
42 | U18,136.0369,-48.2324,90,top
43 | U19,149.6794,-48.2324,90,top
44 | U2,114.3024,-65.8546,270,top
45 | U3,113.9599,-37.916,270,top
46 | U4,128.2685,-101.6212,270,top
47 | U5,141.5926,-101.7581,270,top
48 | U6,135.8809,-114.6898,90,top
49 | U7,149.0175,-114.7804,90,top
50 | U8,128.366,-79.2482,270,top
51 | U9,141.7979,-79.2333,270,top
52 |
--------------------------------------------------------------------------------
/ATX_Switches/Boards/Daughter_board/README.md:
--------------------------------------------------------------------------------
1 | # Daughter board
2 |
3 |
4 |
5 | This board is a mirror of the de/multiplexor, managed device isolation, and 4-port connector functionality of the Main board.
6 |
7 | It was designed to sit above the Main board, with the same port orientation, and bridged via the 12-pin (2x6) connector.
8 |
9 | It is attached to the main board via 4x [M2.5 18mm brass standoffs](https://www.aliexpress.com/item/1005003320815605.html) (with associated [M2.5 6mm bolts](https://www.aliexpress.com/item/1005003294513501.html)), and is shaped to allow for the support posts in the 3D printed case. All mounting holes are M2.5 and align with the matching holes on the Main board.
10 |
11 | The board was also designed to enable access to the jumpers on the Main board once it was attached.
12 |
13 | As per the Main board the isolation components can be either SSRs or optocouplers.
14 |
15 | Again sockets were used for test purposes and can be omitted from board creation.
16 |
17 |
18 |
19 | ### Daughter board presence check
20 |
21 | The only additional functionality that this board provides is support of a daughter board presence test. This consists of the ability to use the 2nd channel on the third CD4052B to check for a high ('1') signal DB_test line when the second RJ45 port of the daughter board is selected. Basically each of the RJ45 ports on the daughter board are selected sequentially and the value returned from DB_test (via I2C) is read. All ports should read low ('0') apart from the second port, so the sequence read should be - 0,1,0,0.
22 |
23 | In theory you don't have to check all of the ports - could just verify that port2 on daughterboard returns ‘1’, but checking that one of the others returns ‘0’ may be a useful sense check. Ensure that the selected port value is also returned for verification.
24 |
25 | May be worth doing multiple reads on port 2 (or the full sequence) just to ensure that you aren’t getting a floating value. i.e. 10 or 20 consecutive reads with same value consistently returned gives confidence – this only gets done during initialisation so isn’t really any particular overhead.
26 |
27 | As mentioned in the main board description, if I2C_HDD jumper is set to enable reading of HDD_LED status via I2C then the daughter board test functionality will not work as the 2nd channel on the third CD4052B will not be enabled.
28 |
29 |
--------------------------------------------------------------------------------
/ATX_Switches/Boards/Main_board/Images/Main_board_TH_socket_v1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/ATX_Switches/Boards/Main_board/Images/Main_board_TH_socket_v1.png
--------------------------------------------------------------------------------
/ATX_Switches/Boards/Main_board/Production/gerber.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/ATX_Switches/Boards/Main_board/Production/gerber.zip
--------------------------------------------------------------------------------
/ATX_Switches/Boards/Main_board/Production/modified_bom.csv:
--------------------------------------------------------------------------------
1 | Designator,Footprint,Quantity,Value,LCSC Part #,Do Not Place,,Potential Source,Notes
2 | "C1, C11",603,2,1uF,C15849,,,,
3 | "C10, C2, C4, C5, C6, C7, C8, C9",603,8,100nF,C14663,,,,
4 | "H1, H2, H3, H4, H5, H6, H7, H8",MountingHole_2.7mm_M2.5_DIN965_Pad_TopBottom,8,MountingHole_Pad,,,,,
5 | "J1, J2",RJHSE5381,2,RJHSE-5381,,DNP,,https://www.aliexpress.com/item/32728838902.html,
6 | J10,PinHeader_2x03_P2.54mm_Vertical,1,Conn_02x03_Odd_Even,C5116479,DNP,,,Optional - not required if piano switch used
7 | "J11, J5, J7, J8, J9",PinHeader_1x03_P2.54mm_Vertical,5,Conn_01x03,C429954,DNP,,,
8 | J3,PinSocket_2x06_P2.54mm_Vertical,1,Conn_02x06_Odd_Even,C2935986,DNP,,https://www.aliexpress.com/item/32851433725.html,Need 6-pin double row sockets (12-pin total)
9 | J4,BarrelJack_Horizontal_163-179PH-EX,1,163-179PH-EX,C194407,DNP,,https://www.aliexpress.com/item/4001206395694.html,
10 | J6,AMPHENOL_RJHSE-5381-04,1,RJHSE-5381-04,,DNP,,https://www.aliexpress.com/item/32730855182.html,
11 | "R1, R15, R16, R17, R18, R19, R2, R20, R21, R22, R3, R31, R32, R33, R34, R39, R4, R40, R5, R6, R7, R8, R9",603,23,390,C23151,,,,
12 | "R10, R11, R12, R23, R24, R25, R26, R27, R28, R29, R30, R35, R36, R41, R42",603,15,4.7k,C23162,,,,
13 | "R13, R14, R37, R38",603,4,10K,C25804,,,,
14 | S2,NDP03TV,1,NDP-03T-V,C126880,DNP,,https://www.aliexpress.com/item/32963042282.html,Need 3-pole piano switch
15 | "U1, U2, U3",DIP-16_W7.62mm_Socket_LongPads,3,CD4052B,C507162,DNP,,,
16 | "U10, U11, U12, U13, U14, U15, U16, U17, U18, U20, U21, U22, U23, U24, U25, U26, U5, U7, U8, U9",DIP-4_W7.62mm_Socket_LongPads,20,LTV-817,C109225,DNP,,,
17 | U19,TSSOP-8_3x3mm_P0.65mm,1,"74LVC2G32DP,125",C548635,,,,
18 | U27,SOIC-8_3.9x4.9mm_P1.27mm,1,ISO1540,C179739,,,,
19 | U28,SOT-89-3_Handsoldering,1,TPMCP1702T-3302E/MB,C3040635,,,,
20 | U4,DIP-18_W7.62mm_Socket_LongPads,1,MCP23008-xP,,DNP,,https://www.mouser.co.uk/ProductDetail/Microchip-Technology/MCP23008-E-P?qs=8FMarzwez060sofcCmNWdQ%3D%3D,
21 | U6,SOT-23-6_Handsoldering,1,SN74LVC2G04DBVR,C10428,,,,
22 |
--------------------------------------------------------------------------------
/ATX_Switches/Boards/Main_board/Production/modified_positions.csv:
--------------------------------------------------------------------------------
1 | Designator,Mid X,Mid Y,Rotation,Layer
2 | C1,19.8882,-13.081,90,top
3 | C10,16.0782,-68.707,90,top
4 | C11,19.8882,-17.6022,90,top
5 | C2,6.8793,-74.2317,0,top
6 | C4,48.6664,-61.7728,0,top
7 | C5,50.1904,-32.4104,180,top
8 | C6,48.5394,-4.2926,0,top
9 | C7,35.56,-75.9206,90,top
10 | C8,48.768,-87.4268,180,top
11 | C9,48.768,-89.7128,180,top
12 | J1,5.3888,-58.8737,270,top
13 | J10,5.075,-81.5086,0,top
14 | J11,25.4682,-64.7683,180,top
15 | J2,5.3888,-36.8006,270,top
16 | J3,57.3528,-92.4106,0,top
17 | J4,11.2638,-13.8507,0,top
18 | J5,20.7264,-86.8022,270,top
19 | J6,96.2874,-48.7466,0,top
20 | J7,25.2523,-23.0361,180,top
21 | J8,25.4809,-27.9383,180,top
22 | J9,25.407,-69.3149,180,top
23 | R1,80.0608,-40.2844,180,top
24 | R10,9.4488,-92.8878,270,top
25 | R11,12.6238,-92.964,270,top
26 | R12,15.7988,-92.9132,270,top
27 | R13,14.6304,-81.9658,0,top
28 | R14,14.6558,-85.6996,0,top
29 | R15,55.5419,-77.1139,180,top
30 | R16,55.9054,-54.9628,180,top
31 | R17,69.1134,-76.8858,180,top
32 | R18,69.0711,-54.9628,180,top
33 | R19,55.9879,-33.0723,180,top
34 | R2,63.179,-43.7168,0,top
35 | R20,69.1918,-33.273,180,top
36 | R21,56.1848,-10.541,180,top
37 | R22,70.231,-10.541,180,top
38 | R23,62.484,-33.0723,180,top
39 | R24,75.9714,-33.274,0,top
40 | R25,61.4934,-10.541,0,top
41 | R26,75.9714,-10.541,0,top
42 | R27,76.2673,-54.9628,0,top
43 | R28,60.6044,-54.9628,0,top
44 | R29,74.6506,-76.8858,0,top
45 | R3,76.581,-65.6336,180,top
46 | R30,61.7474,-77.1139,0,top
47 | R31,21.1666,-42.3703,90,top
48 | R32,21.2346,-47.6804,270,top
49 | R33,36.6268,-53.721,90,top
50 | R34,36.6254,-59.5168,270,top
51 | R35,21.3289,-58.8517,270,top
52 | R36,21.3289,-53.2336,90,top
53 | R37,6.8793,-71.8187,0,top
54 | R38,5.7171,-67.8058,90,top
55 | R39,13.7028,-20.32,180,top
56 | R4,63.2503,-65.5431,180,top
57 | R40,8.0285,-67.8312,270,top
58 | R41,36.703,-83.6422,90,top
59 | R42,69.4788,-88.7984,180,top
60 | R5,76.327,-87.4268,180,top
61 | R6,63.4238,-86.9442,180,top
62 | R7,64.0334,-21.7678,0,top
63 | R8,78.0034,-21.6154,0,top
64 | R9,88.011,-13.9192,0,top
65 | S2,2.31,-81.5086,270,top
66 | U1,40.98,-6.955,270,top
67 | U10,55.3868,-48.2879,270,top
68 | U11,62.992,-61.468,90,top
69 | U12,55.5843,-26.4819,270,top
70 | U13,63.236,-40.0549,90,top
71 | U14,55.3865,-3.9286,270,top
72 | U15,63.0577,-17.2721,90,top
73 | U16,32.9338,-59.7773,90,top
74 | U17,32.9338,-52.5576,90,top
75 | U18,55.2893,-70.6609,270,top
76 | U19,48.488,-94.1458,180,top
77 | U2,41.3239,-34.895,270,top
78 | U20,76.0383,-83.8201,90,top
79 | U21,68.8187,-48.273,270,top
80 | U22,76.3679,-61.4437,90,top
81 | U23,68.8399,-26.462,270,top
82 | U24,76.444,-40.0978,90,top
83 | U25,69.1589,-3.9807,270,top
84 | U26,76.7002,-17.2721,90,top
85 | U27,14.2707,-73.2411,270,top
86 | U28,27.0208,-13.8684,180,top
87 | U3,41.3239,-64.3675,270,top
88 | U4,25.4,-75.1579,270,top
89 | U5,25.2883,-35.0583,270,top
90 | U6,43.5556,-89.088,180,top
91 | U7,25.2958,-42.3876,270,top
92 | U8,68.6134,-70.7978,270,top
93 | U9,62.8982,-83.7444,90,top
94 |
--------------------------------------------------------------------------------
/ATX_Switches/Boards/Main_board/README.md:
--------------------------------------------------------------------------------
1 | # Main board
2 |
3 |
4 |
5 | ## Physical aspects
6 |
7 | The size of the PCB was determined from a number of factors:
8 |
9 | - 100mm x 100mm is the cut-off point for cheaper boards from a number of PCB manufacturers
10 | - It gave a larger space to work with while I was learning how to use Kicad.
11 | - I'd decided to use Through Hole (TH) components[^1] for ease of hand soldering, and they tend to be larger than SMD devices.
12 | - It worked well with the size of the larger components (primarily the 4-port RJ45 connector).
13 | - It also worked well with the 3D printed case.
14 |
15 | I could have made it smaller (particularly after the design had been tested), but I was happy with the result so it stayed as it was[^2].
16 |
17 | The original boards were 2-layer and worked fine, however when I produced the final iteration the price of 4-layer boards wasn't that much more (in the quantities I was after) - so I decided to produce a 4-layer for the experience, and because it looks neater.
18 |
19 | The use of sockets was to enable pin compatible replacements to be tested, particularly w.r.to SSRs vs. optocouplers (but also for different manufacturers variants / equivalents). It also makes it easier to replace a component if one is faulty. The intention was to solder the components directly to the PCB once a final decision had been made on component choice - but by the time I'd finished testing I had a few boards that were already socketed, so I just used them.
20 |
21 | The RJ45 connectors were chosen to have integral LED's which allowed them to be used for indication purposes:
22 |
23 | - In the case of the 4-port RJ45 connector the green LED indicates if the port is selected (the amber LED is not used);
24 | - In the case of the single RJ45 that is used for connecting to the DIY PiKVM (the one nearest the address switch) the green LED indicates whether there is power to the ATX Switch unit, and the amber LED indicates if there is an active connection to the DIY PiKVM.
25 | - Neither of the LEDs on the daisy-chain (expansion) single RJ45 connector are used.
26 |
27 | A barrel port power connector was chosen as it is simpler, more robust to install / operate.
28 |
29 | A 3-pole piano switch was chosen for the address selector because it is easier to operate from outside the case, and just looks neater[^3]. The default I2C address for the ATX Switch is 0x20 - all address selection switch levers positioned at '0'.
30 |
31 | The mounting holes in the corners are M3 to match with the mounting posts in the 3D printed case(s), and the remaining mounting holes are M2.5 to allow for attaching the [daughter board](../Daughter_board/README.md).
32 |
33 |
34 |
35 | ## Active components
36 |
37 | The list of all components is provided in the Bill Of Materials (BOM) included with the production files for the board.
38 |
39 | **MCP23008 I2C I/O expander** - in addition to the addressing capability mentioned previously, this device provides for an additional 8x GPIO pins to extend the DIY PiKVM capability. These are configured to enable:
40 |
41 | - selection between main board and daughter board operation (or neither when the associated ATX Switch is not being addressed)
42 | - selection between the 4-ports that are connected to managed devices
43 | - I/O capability for I2C based ATX operations
44 | - test for presence of daughter board (if environment configured correctly)
45 |
46 | **CD4052B 4:1, 2-channel general purpose de/multiplexor** - this provides the mechanism for splitting the PiKVM assigned (GPIO) ATX pins to each of the ports via the isolation components. These latter can be either Solid State Relays (SSRs) or optocouplers depending on how much the user wants to pay vs. their concern over being able to wire up the managed device correctly (polarity of the ATX header on the motherboard).
47 |
48 | There are three CD4052B components on the board: two of these enable switching the 4x ATX GPIO pins between the managed devices; whilst the third enables the green LED on the RJ45 port for the selected managed device to be lit, in order to provide a visual indication of which port is active.
49 |
50 | **Isolation components** - there are two main areas of isolation on the board:
51 |
52 | - Connectivity to the DIY PiKVM - which is divided into:
53 | - I2C isolation using an **ISO1540 low-power bidirectional I2C isolator**
54 | - ATX GPIO pin isolation using **LTV-817** optocouplers
55 | - If compatibility with the other isolators on the board was required (single component type) then the selected SSRs could be substituted here at increased cost.
56 | - These also provided a signal boost to the downstream ATX Switches.
57 | - Connectivity to the ATX Adapters on the managed devices.
58 | - The recommended isolator (from the PiKVM v2 design) was the G3VM-61A1 MOSFET relay, which is an SSR - but is relatively expensive, and for a while was suffering supply issues.
59 | - Alternative pin-compatible SSRs were available (a number of which were considered) but the one selected was the **KAQY214**.
60 | - A much cheaper approach however was to use an optocoupler. A number of products that were pin-compatible with the SSRs were considered, but the chosen component was the **LTV-817-C**. *This was the approach I used for most of my boards, as I was comfortable with installing the ATX Adapter boards correctly*.
61 |
62 |
63 |
64 | ## Configuration options
65 |
66 |
67 | $\color{purple}{\textsf{Choosing between GPIO and I2C operation of ATX functions}}$
68 |
69 | The board was primarily designed to enable extension of the existing PiKVM ATX functionality (using the assigned GPIO pins) to multiple managed devices. However, the capability to operate these ATX functions via I2C was also added - thus reducing the number of required connections to the PiKVM to four (4): Ground; +3.3v; I2C SCL; and I2C SDA.
70 |
71 | In order to support this capability a set of 3-pin plug connectors were added to the board (J7, J8, J9, J11) and were labelled with their associated ATX operation.
72 |
73 | Connecting a jumper between the middle pin and 'RJ' on a function bridges the associated optocoupler from the relevant DIY PiKVM GPIO pin to the selected managed device.
74 |
75 | Connecting the jumper between the middle pin and the label bridges the associated GPIO pin from the MCP23008 (which can be addressed via I2C) to the selected managed device.
76 |
77 | **Default** - *connect all jumpers between middle pins and 'RJ'*
78 |
79 | $\color{purple}{\textsf{Ability to test for presence of Daughter board}}$
80 |
81 | This was an option that was originally provided to allow the presence of a daughter board to be determined by the ATX Switch code during DIY PiKVM initialisation. This capability was deprecated when it was decided to include HDD LED into I2C operations[^4], and a jumper was included to allow selection between DB_test and I2C_HDD operation. As current functionality does not support I2C based ATX operations through the PiKVM WebUI this jumper should be connected between the middle pin and DB_test.
82 |
83 | **Default** - *connect middle pin to DB_test*
84 |
85 |
86 |
87 | ## Optional parts
88 |
89 | There are a number of components on the ATX Switch main board that can be considered optional if desired (and if you are really trying to minimise cost / effort) at the expense of flexibility:
90 |
91 | - If you only want 4-port ATX Switches then you can omit the daughter-board connector (J3) on the main board.
92 | - If you are only going to use GPIO ATX operations then you can hardwire the selections rather than using connector pins and jumpers.
93 | - The address switch can be replaced by a dual 3-pin connector (potentially right-angled) and jumpers, or the address could even be hard-wired.
94 | - If only one Switch is required (either 4-port or 8-port) then can omit the 2nd (single) RJ45 connector that is used for daisy-chaining switches together. Note however, that the 3D printed case will still have an opening for the connector unless you change it.
95 |
96 | To be honest though I didn't feel that the savings were worth the loss in flexibility.
97 |
98 | The main savings relate to the use of optocouplers rather than SSRs, provided that you are comfortable making the correct connection on the motherboard of the managed device.
99 |
100 |
101 |
102 | ###### Footnotes
103 |
104 | [^1]: For the most part, although there were a few components that were only available in SMD, which I got assembled by the PCB manufacturer.
105 | [^2]: I even did a Surface Mount Device (SMD) based design for all of the active components, which again could have been somewhat smaller and allowed more use of PCB manufacturers assembly capability - but there were quite a lot of connectors that were needed and were cheaper in TH variant. Additionally some active components (e.g. MCP23008) were a lot cheaper in TH than their SMD equivalents - at least when I started this (it may have changed now). Also I believed (perhaps wrongly) that most people would find it more difficult to solder SMD components than TH.
Finally, if you want to get the PCB manufacturers to assemble the full board for you then you need to either: select all components from what they stock; OR arrange for your own components to be shipped to / be stored by them. I was doing this as a hobby, not as a business!
106 | [^3]: An alternative could have been to use a right-angled two row, 3-pole connector with jumpers - but this would be more fiddly to configure and would run the risk of losing the jumpers.
107 | [^4]: It was uncertain whether the polling frequency for HDD status of a managed device would be practical via I2C, or whether this would have any adverse impact upon other PiKVM operations. Until a mechanism to enable ATX operations via I2C from the PiKVM WebUI is produced / tested then this cannot be confirmed. I suspect that it will be fine, therefore decided to include the option to enable I2C_HDD - however, due to the availability of GPIO pins on the MCP23008 it was necessary to dual purpose the daughter board test pin.
108 |
--------------------------------------------------------------------------------
/ATX_Switches/Boards/README.md:
--------------------------------------------------------------------------------
1 | This sub-folder contains the details on the ATX Switch [main board](./Main_board/README.md) (4-port operation), and [daughter board](./Daughter_board/README.md) (additional 4-port operation) components.
--------------------------------------------------------------------------------
/ATX_Switches/Cases/Images/4-port_case_assembled_LHS.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/ATX_Switches/Cases/Images/4-port_case_assembled_LHS.png
--------------------------------------------------------------------------------
/ATX_Switches/Cases/Images/4-port_case_assembled_RHS.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/ATX_Switches/Cases/Images/4-port_case_assembled_RHS.png
--------------------------------------------------------------------------------
/ATX_Switches/Cases/Images/4-port_case_top.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/ATX_Switches/Cases/Images/4-port_case_top.png
--------------------------------------------------------------------------------
/ATX_Switches/Cases/Images/8-port_case_assembled_LHS.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/ATX_Switches/Cases/Images/8-port_case_assembled_LHS.png
--------------------------------------------------------------------------------
/ATX_Switches/Cases/Images/8-port_case_assembled_RHS.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/ATX_Switches/Cases/Images/8-port_case_assembled_RHS.png
--------------------------------------------------------------------------------
/ATX_Switches/Cases/Images/8-port_case_middle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/ATX_Switches/Cases/Images/8-port_case_middle.png
--------------------------------------------------------------------------------
/ATX_Switches/Cases/Images/8-port_case_top.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/ATX_Switches/Cases/Images/8-port_case_top.png
--------------------------------------------------------------------------------
/ATX_Switches/Cases/Images/Case_bottom.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/ATX_Switches/Cases/Images/Case_bottom.png
--------------------------------------------------------------------------------
/ATX_Switches/Cases/Production/ATX Switch 4-port top - 2 colour.3mf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/ATX_Switches/Cases/Production/ATX Switch 4-port top - 2 colour.3mf
--------------------------------------------------------------------------------
/ATX_Switches/Cases/Production/ATX Switch 8-port middle.3mf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/ATX_Switches/Cases/Production/ATX Switch 8-port middle.3mf
--------------------------------------------------------------------------------
/ATX_Switches/Cases/Production/ATX Switch 8-port top.3mf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/ATX_Switches/Cases/Production/ATX Switch 8-port top.3mf
--------------------------------------------------------------------------------
/ATX_Switches/Cases/Production/ATX Switch bottom.3mf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/ATX_Switches/Cases/Production/ATX Switch bottom.3mf
--------------------------------------------------------------------------------
/ATX_Switches/Cases/README.md:
--------------------------------------------------------------------------------
1 | # ATX Switch Cases
2 |
3 | 3D printed case designs are available for both 4-port and 8-port ATX Switches
4 |
5 | ## 4-port - (ATX SWITCH 4)
6 |
7 | |  |
|
8 | | ------------------------------------------- | ----------------------------------------------------- |
9 | |  |
|
10 |
11 | Consists of:
12 |
13 | - Printed in PLA
14 | - Common base
15 | - ATX Switch 4 top
16 | - Configured with cut-outs for the connectors on the main board and ventilation holes (not that the unit generates much heat)
17 | - Uses [M3(OD4.5) 6mm heat inserts](https://www.aliexpress.com/item/1005006042691803.html?) within the support pillars to allow for repeated opening / closing.
18 |
19 | Case parts are fastened together with 4x 14mm countersunk black M3 bolts.
20 |
21 |
22 |
23 | ## 8-port - (ATX SWITCH 8)
24 |
25 | |  |  |  |
26 | | ----------------------------- | ------------------------------------ | --------------------------------- |
27 |
28 | |  |  |
29 | | ------------------------------------------- | ------------------------------------------- |
30 |
31 | Consists of:
32 |
33 | - Printed in PLA
34 | - Common base
35 | - Middle layer
36 | - Configured with cut-outs for the connectors on the main board and ventilation holes (not that the unit generates much heat)
37 | - ATX Switch 8 top
38 | - Provides ventilation holes
39 | - Uses [M3(OD4.5) 6mm heat inserts](https://www.aliexpress.com/item/1005006042691803.html?) within the support pillars to allow for repeated opening / closing.
40 |
41 | Case parts are fastened together with 4x 35mm countersunk black M3 bolts.
42 |
43 |
44 |
45 | >[!NOTE]
46 | >The use of heat inserts is not compulsory but the inner diameter of the mounting hole on the pillars will probably need to be adjusted if M3 screws (or bolts) are to be used on their own.
47 |
48 | >[!TIP]
49 | >Case surface stability can be improved by attaching (4x) 10x2mm self adhesive rubber feet to the underside of the base in the indentations provided.
50 |
51 |
--------------------------------------------------------------------------------
/ATX_Switches/Images/Daughter_board_TH_socket_v1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/ATX_Switches/Images/Daughter_board_TH_socket_v1.png
--------------------------------------------------------------------------------
/ATX_Switches/Images/Main_board_TH_socket_v1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/ATX_Switches/Images/Main_board_TH_socket_v1.png
--------------------------------------------------------------------------------
/ATX_Switches/README.md:
--------------------------------------------------------------------------------
1 | # ATX Switches (4 & 8 port)
2 |
3 | ## Design criteria
4 |
5 | The ATX switches were designed with the following criteria in mind:
6 |
7 | - Expandable - to support varying numbers of managed devices
8 | - Isolation - to prevent damage between managed devices, and DIY PiKVM controller
9 | - PiKVM compatibility - in so far as possible
10 | - Simplicity
11 | - Ease of construction / testing - assuming basic soldering skills
12 | - Substitution - using pin compatible components. e.g. the user can decide whether to use SSRs or optocouplers (which are a fair bit cheaper) to provide the interface to the managed devices.
13 | - Education / interest for me - tools / processes / techniques / vendors / components / etc.
14 |
15 |
16 |
17 | As mentioned previously I originally had considered creating a solution based on a distributed MCU based architecture, but while the experimentation with this was interesting I eventually decided that it was more complex than was necessary for my purpose. I therefore decided to create a solution based on discrete components, with the communication between the PiKVM environment and the ATX Switch(es) being restricted to I2C and the relevant GPIO pins used for ATX operations.
18 |
19 | > [!NOTE]
20 | > At the time I started this exercise the only PiKVM available was the v3 (HAT and pre-built unit), with the main restriction being that it only supported 1080p @50Hz - and the majority of this functionality could be enabled via a v2 (DIY) approach.
21 | >
22 | > Since then the v4 has been released with support for 1080p @60Hz, along with other features, which is not easily replicable with a DIY build (an approach that **is not** supported by the PiKVM team). So it is possible that a distributed (bus based) approach may have worked better in the long term...? However I still prefer the simplicity of the approach taken - perhaps a future expansion may be to produce a '*networked*' controller that can communicate between the PiKVM and the ATX Switch environment. OR maybe the PiKVM team will make the ATX port configurable...? Anyway I digress.
23 |
24 | The majority of HDMI KVM's that were being used within the community were 4-port or 8-port, as these were large enough for the bulk of home environments. Therefore I opted to create a 4-port main board that could be expanded to 8-ports by the addition of a daughter board - thus saving cost on some of the common components: Pi4 isolation (I2C and GPIO); I2C expander; power supply; Address selection switch; and various connectors.
25 |
26 | | Main Board | Daughter board |
27 | | ----------------------------------------- | --------------------------------------------- |
28 | |  |  |
29 |
30 | However, being aware of larger HDMI KVM switches (and the ability to daisy-chain some HDMI KVM switches), I decided to design the ATX Switch to also allow expansion of the I2C and GPIO channels from the Pi4.
31 |
32 | An MCP23008 I2C I/O expander provides three address pins enabling 8x ATX Switches to be daisy-chained, giving a theoretical managed device capacity between 32 - 64 (**I've never tested to this capacity!**).
33 |
34 | Signal isolation is provided on both the DIY PiKVM and managed device sides of the ATX Switch.
35 |
36 | An RJ45 extender port (nearest to the power socket) enables the I2C and GPIO signals from the DIY PiKVM to be forwarded to the downstream ATX Switches in a daisy chained environment.
37 |
38 | The pinout for the connection between the DIY PiKVM and the ATX Switch is custom (due to the signals required)[^1], however it does use the same GPIO pins as used within the PiKVM thus ensuring that ATX operations from within the WebUI are the same. Also the pinout used for the ports that connect to the managed devices is the same as that used by the PiKVM for its [ATX port](https://docs.pikvm.org/atx_board/#pinout).
39 |
40 | Further criteria are covered in the [Main board](./Boards/Main_board/README.md) section.
41 |
42 |
43 |
44 | ## Required Parts
45 |
46 | - [3D printed case](./Cases/README.md)
47 | - 4-port or 8-port variant
48 | - [Main board](./Boards/Main_board/README.md) (4-port)
49 | - plus [Daughter board](./Boards/Daughter_board/README.md) (for 8-port)
50 | - Power supply - 5V, 2.1mm barrel jack
51 | - 4x M3 countersunk bolts[^2] (14mm for 4-port case, 35mm for 8-port case)
52 |
53 | - 4x 10x2mm self adhesive rubber feet
54 |
55 |
56 |
57 | ## Installation / Operation
58 |
59 | As designed, installation / operation of the ATX switch is straightforward, with most of the configuration complexity happening on the DIY PiKVM controller.
60 |
61 | ###### Basic PiKVM GPIO ATX operation
62 |
63 | 1. Set the internal jumpers on the [main board](./Boards/Main_board/README.md) before sealing the case.
64 | 1. Currently, as I2C ATX operations are not supported yet, all jumpers (RST_BTN; PWR_BTN; HDD_LED; PWR_LED) should be set to 'RJ'.
65 | 2. Set the remaining jumper to DB_test - this is a software configurable item which may not be used, but if I2C operations are not being used then the I2C_HDD functionality is not required.
66 | 2. Set the address of the ATX Switch using the address selection switch levers.
67 | 1. If only one ATX Switch is to be deployed it is recommended that this be left at the default 0x20, however it can be changed provided that the matching address is configured in the **atx_switch_initialisation.yaml** file on the DIY PiKVM
68 | 3. Connect the output ports from the ATX Switch to the [ATX Adapter board](../ATX_Adapter_board/README.md) on the corresponding managed device using an 8-wire Ethernet cable[^3].
69 | 4. Connect the DIY PiKVM to the ATX Switch (RJ45 port nearest the address switch) via an 8-wire Ethernet cable[^3].
70 | 5. Plug in the 5V power supply.
71 | 1. The green LED on the RJ45 port should illuminate.
72 | 6. When the DIY PiKVM is powered on / booted the amber LED on the RJ45 port should illuminate
73 | 1. There is an option within the ATX Switch software (on the DIY PiKVM) to run a port test at initialisation. If this is configured then during the boot process the ATX Switch should cycle through port selection, which will be indicated by the port green LEDs switching on and off one at a time.
74 |
75 |
76 |
77 | ###### Extended (daisy-chain) operation
78 |
79 | 1. Perform the above steps for each switch, but in the case of the extra switches ensure that the address is set to a unique value (in the range 0x20 - 0x27).
80 | 2. Connect the switches together using 8-wire Ethernet cable(s) [^3]
81 | 1. When power is applied then the downstream ATX Switches should have both the green and amber LEDs illuminated (on the DIY PiKVM RJ45 connector). This indicates that there is power to the ATX Switch (green), and that it is connected to the upstream switch (amber).
82 | 2. The amber LED on the first ATX Switch in the chain will only be illuminated when the DIY PiKVM is powered-up / booted.
83 |
84 |
85 |
86 | ###### Custom I2C operation
87 |
88 | The ATX Switch **can** support ATX operations using I2C commands, but not from the PiKVM WebUI environment currently. These need to be performed using Linux commands such as **i2cset / i2cget**.
89 |
90 | In order to support this mode of operation the above steps still need to be performed but the internal jumpers need to be set to support I2C operations. i.e. moved away from the 'RJ' side to the other side.
91 |
92 | If you want to get the HDD_LED status via I2C it is also necessary to switch the jumper from DB_test to I2C_HDD. This will lose the ability to test for presence of a daughter board, but this is less of an issue once the environment is operational.
93 |
94 | The use of I2C for ATX operations also needs to be configured in the **atx_switch_initialisation.yaml** file on the DIY PiKVM (set **atx_ops** to **i2c**).
95 |
96 |
97 | >[!NOTE]
98 | >It is possible to have a mix of ATX Switches supporting standard GPIO and I2C operations in a daisy-chain (only one type per switch) - however this is an advanced use case.
99 |
100 |
101 |
102 |
103 |
104 | ###### Footnotes
105 |
106 | [^1]: As the pinout of the PiKVM port is not configurable unfortunately
107 | [^2]: Can use screws but will need to reduce size of affixing hole in case top.
108 |
109 | [^3]: All Ethernet cables are to be straight (568B <--> 568B), not cross-over. All cable lengths should be kept to the minimum length possible to reduce likelihood of signal / power degradation.
110 |
111 |
--------------------------------------------------------------------------------
/DIY_PiKVM/ATX_Switch_connector_board_for_Pi/Images/ATX_connector_board_rotate.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/DIY_PiKVM/ATX_Switch_connector_board_for_Pi/Images/ATX_connector_board_rotate.jpg
--------------------------------------------------------------------------------
/DIY_PiKVM/ATX_Switch_connector_board_for_Pi/Images/Numbered_ATX_board_connector_bottom_v1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/DIY_PiKVM/ATX_Switch_connector_board_for_Pi/Images/Numbered_ATX_board_connector_bottom_v1.png
--------------------------------------------------------------------------------
/DIY_PiKVM/ATX_Switch_connector_board_for_Pi/Images/Numbered_ATX_board_connector_top_v1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/DIY_PiKVM/ATX_Switch_connector_board_for_Pi/Images/Numbered_ATX_board_connector_top_v1.png
--------------------------------------------------------------------------------
/DIY_PiKVM/ATX_Switch_connector_board_for_Pi/Production/ATX_Breakout_board_v1_1.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/DIY_PiKVM/ATX_Switch_connector_board_for_Pi/Production/ATX_Breakout_board_v1_1.zip
--------------------------------------------------------------------------------
/DIY_PiKVM/ATX_Switch_connector_board_for_Pi/Production/bom.csv:
--------------------------------------------------------------------------------
1 | Designator,Footprint,Quantity,Value,LCSC Part #,Potential source
2 | J1,RHDR40W64P254_2X20_5130X500X1625P,1,PRT-16763,,https://www.aliexpress.com/item/1005005366790021.html?spm=a2g0o.order_list.order_list_main.33.71011802gTyL6x
3 | J2,HDRRA4W64P0X254_1X4_1001X318X635P,1,171857-0004,,https://www.aliexpress.com/item/1005002905132620.html?spm=a2g0o.order_list.order_list_main.68.71011802gTyL6x
4 | J3,RJHSE5381,1,RJHSE-5381,,https://www.aliexpress.com/item/32728838902.html?spm=a2g0o.order_list.order_list_main.308.71011802gTyL6x
5 | J4,PinHeader_1x05_P2.54mm_Vertical,1,Conn_01x05_Pin,,
6 | "J5, J6",PinHeader_1x04_P2.54mm_Horizontal,2,Conn_01x04_Pin,,
7 | J7,PinHeader_1x02_P2.54mm_Vertical,1,Conn_01x02_Pin,,
8 | J9,JST_SH_SM04B-SRSS-TB_1x04-1MP_P1.00mm_Horizontal,1,Conn_01x04_MountingPin,,https://www.aliexpress.com/item/4001225684969.html?spm=a2g0o.order_list.order_list_main.11.71011802gTyL6x
9 | R1,805,1,4.7K,,
10 |
--------------------------------------------------------------------------------
/DIY_PiKVM/ATX_Switch_connector_board_for_Pi/Production/designators.csv:
--------------------------------------------------------------------------------
1 | J1:1
2 | J2:1
3 | J3:1
4 | J4:1
5 | J5:1
6 | J6:1
7 | J7:1
8 | J9:1
9 | R1:1
10 |
--------------------------------------------------------------------------------
/DIY_PiKVM/ATX_Switch_connector_board_for_Pi/Production/netlist.ipc:
--------------------------------------------------------------------------------
1 | P CODE 00
2 | P UNITS CUST 0
3 | P arrayDim N
4 | 317/3.3V VIA MD0157PA00X+067030Y-026400X0315Y0000R000S3
5 | 317/5V VIA MD0157PA00X+045530Y-024085X0315Y0000R000S3
6 | 317NET-(J6-PIN_4) VIA MD0157PA00X+046660Y-022945X0315Y0000R000S3
7 | 317NET-(J1-PAD15) VIA MD0157PA00X+063252Y-021995X0315Y0000R000S3
8 | 317NET-(J1-PAD15) VIA MD0157PA00X+067150Y-024900X0315Y0000R000S3
9 | 317NET-(J1-PAD18) VIA MD0157PA00X+063460Y-026780X0315Y0000R000S3
10 | 317NET-(J9-PIN_2) VIA MD0157PA00X+042590Y-022190X0315Y0000R000S3
11 | 317/3.3V J1 -1 D0433PA00X+038040Y-021540X0650Y0650R000S0
12 | 317/5V J1 -2 D0433PA00X+038040Y-020540X0650Y0000R000S0
13 | 317NET-(J4-PIN_4) J1 -3 D0433PA00X+039040Y-021540X0650Y0000R000S0
14 | 317CTED-(J1-PAD4) J1 -4 D0433PA00X+039040Y-020540X0650Y0000R000S0
15 | 317NET-(J4-PIN_3) J1 -5 D0433PA00X+040040Y-021540X0650Y0000R000S0
16 | 317/GND J1 -6 D0433PA00X+040040Y-020540X0650Y0000R000S0
17 | 317CTED-(J1-PAD7) J1 -7 D0433PA00X+041040Y-021540X0650Y0000R000S0
18 | 317CTED-(J1-PAD8) J1 -8 D0433PA00X+041040Y-020540X0650Y0000R000S0
19 | 317CTED-(J1-PAD9) J1 -9 D0433PA00X+042040Y-021540X0650Y0000R000S0
20 | 317TED-(J1-PAD10) J1 -10 D0433PA00X+042040Y-020540X0650Y0000R000S0
21 | 317TED-(J1-PAD11) J1 -11 D0433PA00X+043040Y-021540X0650Y0000R000S0
22 | 317NET-(J6-PIN_4) J1 -12 D0433PA00X+043040Y-020540X0650Y0000R000S0
23 | 317NET-(J1-PAD13) J1 -13 D0433PA00X+044040Y-021540X0650Y0000R000S0
24 | 317TED-(J1-PAD14) J1 -14 D0433PA00X+044040Y-020540X0650Y0000R000S0
25 | 317NET-(J1-PAD15) J1 -15 D0433PA00X+045040Y-021540X0650Y0000R000S0
26 | 317NET-(J1-PAD16) J1 -16 D0433PA00X+045040Y-020540X0650Y0000R000S0
27 | 317TED-(J1-PAD17) J1 -17 D0433PA00X+046040Y-021540X0650Y0000R000S0
28 | 317NET-(J1-PAD18) J1 -18 D0433PA00X+046040Y-020540X0650Y0000R000S0
29 | 317TED-(J1-PAD19) J1 -19 D0433PA00X+047040Y-021540X0650Y0000R000S0
30 | 317TED-(J1-PAD20) J1 -20 D0433PA00X+047040Y-020540X0650Y0000R000S0
31 | 317TED-(J1-PAD21) J1 -21 D0433PA00X+048040Y-021540X0650Y0000R000S0
32 | 317NET-(J9-PIN_4) J1 -22 D0433PA00X+048040Y-020540X0650Y0000R000S0
33 | 317TED-(J1-PAD23) J1 -23 D0433PA00X+049040Y-021540X0650Y0000R000S0
34 | 317TED-(J1-PAD24) J1 -24 D0433PA00X+049040Y-020540X0650Y0000R000S0
35 | 317/GND1 J1 -25 D0433PA00X+050040Y-021540X0650Y0000R000S0
36 | 317TED-(J1-PAD26) J1 -26 D0433PA00X+050040Y-020540X0650Y0000R000S0
37 | 317TED-(J1-PAD27) J1 -27 D0433PA00X+051040Y-021540X0650Y0000R000S0
38 | 317TED-(J1-PAD28) J1 -28 D0433PA00X+051040Y-020540X0650Y0000R000S0
39 | 317TED-(J1-PAD29) J1 -29 D0433PA00X+052040Y-021540X0650Y0000R000S0
40 | 317TED-(J1-PAD30) J1 -30 D0433PA00X+052040Y-020540X0650Y0000R000S0
41 | 317TED-(J1-PAD31) J1 -31 D0433PA00X+053040Y-021540X0650Y0000R000S0
42 | 317NET-(J9-PIN_2) J1 -32 D0433PA00X+053040Y-020540X0650Y0000R000S0
43 | 317TED-(J1-PAD33) J1 -33 D0433PA00X+054040Y-021540X0650Y0000R000S0
44 | 317TED-(J1-PAD34) J1 -34 D0433PA00X+054040Y-020540X0650Y0000R000S0
45 | 317NET-(J6-PIN_2) J1 -35 D0433PA00X+055040Y-021540X0650Y0000R000S0
46 | 317TED-(J1-PAD36) J1 -36 D0433PA00X+055040Y-020540X0650Y0000R000S0
47 | 317TED-(J1-PAD37) J1 -37 D0433PA00X+056040Y-021540X0650Y0000R000S0
48 | 317NET-(J6-PIN_3) J1 -38 D0433PA00X+056040Y-020540X0650Y0000R000S0
49 | 317/GND2 J1 -39 D0433PA00X+057040Y-021540X0650Y0000R000S0
50 | 317TED-(J1-PAD40) J1 -40 D0433PA00X+057040Y-020540X0650Y0000R000S0
51 | 317/GND2 J4 -1 D0394PA00X+060750Y-028250X0669Y0669R180S0
52 | 317J4-PIN_2-PAD2) J4 -2 D0394PA00X+060750Y-027250X0669Y0669R180S0
53 | 317NET-(J4-PIN_3) J4 -3 D0394PA00X+060750Y-026250X0669Y0669R180S0
54 | 317NET-(J4-PIN_4) J4 -4 D0394PA00X+060750Y-025250X0669Y0669R180S0
55 | 317/5V J4 -5 D0394PA00X+060750Y-024250X0669Y0669R180S0
56 | 367N/C J3 D1299UA00X+067320Y-028829X1299Y0000R270S0
57 | 367N/C J3 D1299UA00X+067320Y-023829X1299Y0000R270S0
58 | 317/3.3V J3 -1 D0370PA00X+066320Y-024931X0576Y0576R270S0
59 | 317/GND2 J3 -2 D0370PA00X+065619Y-025330X0576Y0000R270S0
60 | 317NET-(J1-PAD13) J3 -3 D0370PA00X+066320Y-025730X0576Y0000R270S0
61 | 317NET-(J1-PAD16) J3 -4 D0370PA00X+065619Y-026130X0576Y0000R270S0
62 | 317NET-(J1-PAD15) J3 -5 D0370PA00X+066320Y-026529X0576Y0000R270S0
63 | 317NET-(J1-PAD18) J3 -6 D0370PA00X+065619Y-026929X0576Y0000R270S0
64 | 317NET-(J4-PIN_3) J3 -7 D0370PA00X+066320Y-027328X0576Y0000R270S0
65 | 317NET-(J4-PIN_4) J3 -8 D0370PA00X+065619Y-027728X0576Y0000R270S0
66 | 317LASH}K_1-PAD9) J3 -9 D0370PA00X+063722Y-023628X0576Y0000R270S0
67 | 317ASH}K_2-PAD10) J3 -10 D0370PA00X+063722Y-024530X0576Y0000R270S0
68 | 317(J3-A.K-PAD11) J3 -11 D0370PA00X+063722Y-028129X0576Y0000R270S0
69 | 317ASH}K_3-PAD12) J3 -12 D0370PA00X+063722Y-029030X0576Y0000R270S0
70 | 317NET-(J7-PIN_2) J3 -MH1 D0638PA00X+065970Y-023128X0957Y0000R270S0
71 | 317ED-(J3-PADMH2) J3 -MH2 D0638PA00X+065970Y-029530X0957Y0000R270S0
72 | 317/GND2 J5 -1 D0394PA00X+056660Y-023690X0669Y0669R090S0
73 | 317/5V J5 -2 D0394PA00X+055660Y-023690X0669Y0669R090S0
74 | 317NET-(J4-PIN_3) J5 -3 D0394PA00X+054660Y-023690X0669Y0669R090S0
75 | 317NET-(J4-PIN_4) J5 -4 D0394PA00X+053660Y-023690X0669Y0669R090S0
76 | 317/GND2 J7 -1 D0394PA00X+061468Y-021050X0669Y0669R270S0
77 | 317NET-(J7-PIN_2) J7 -2 D0394PA00X+062468Y-021050X0669Y0669R270S0
78 | 317/GND1 J6 -1 D0394PA00X+048640Y-023660X0669Y0669R090S0
79 | 317NET-(J6-PIN_2) J6 -2 D0394PA00X+049640Y-023660X0669Y0669R090S0
80 | 317NET-(J6-PIN_3) J6 -3 D0394PA00X+050640Y-023660X0669Y0669R090S0
81 | 317NET-(J6-PIN_4) J6 -4 D0394PA00X+051640Y-023660X0669Y0669R090S0
82 | 317/GND J2 -1 D0433PA00X+041550Y-023070X0650Y0650R000S0
83 | 317/5V J2 -2 D0433PA00X+040550Y-023070X0650Y0000R000S0
84 | 317NET-(J9-PIN_4) J2 -3 D0433PA00X+039550Y-023070X0650Y0000R000S0
85 | 317NET-(J9-PIN_2) J2 -4 D0433PA00X+038550Y-023070X0650Y0000R000S0
86 | 327/5V J9 -1 A02X+045517Y-023370X0236Y0610R180S1
87 | 327NET-(J9-PIN_2) J9 -2 A02X+045124Y-023370X0236Y0610R180S1
88 | 327/GND J9 -3 A02X+044730Y-023370X0236Y0610R180S1
89 | 327NET-(J9-PIN_4) J9 -4 A02X+044336Y-023370X0236Y0610R180S1
90 | 327OUNTPIN-PADMP) J9 -MP A02X+046029Y-024896X0472Y0709R180S1
91 | 327OUNTPIN-PADMP) J9 -MP A02X+043824Y-024896X0472Y0709R180S1
92 | 327NET-(J9-PIN_2) R1 -1 A02X+052544Y-022560X0472Y0551R180S1
93 | 327/GND1 R1 -2 A02X+051756Y-022560X0472Y0551R180S1
94 | 999
95 |
--------------------------------------------------------------------------------
/DIY_PiKVM/ATX_Switch_connector_board_for_Pi/Production/positions.csv:
--------------------------------------------------------------------------------
1 | Designator,Mid X,Mid Y,Rotation,Layer
2 | J1,120.9516,-53.3666,0.0,top
3 | J2,101.727,-64.2928,180.0,bottom
4 | J3,168.5778,-66.8767,90.0,top
5 | J4,154.305,-66.68,180.0,top
6 | J5,140.1164,-64.5476,270.0,top
7 | J6,127.3456,-64.4714,270.0,bottom
8 | J7,157.4038,-53.467,90.0,top
9 | J9,114.1142,-61.3598,0.0,bottom
10 | R1,132.461,-57.3024,0.0,bottom
11 |
--------------------------------------------------------------------------------
/DIY_PiKVM/ATX_Switch_connector_board_for_Pi/README.md:
--------------------------------------------------------------------------------
1 | ## ATX Connector board
2 |
3 | 
4 |
5 | This board provides an RJ45 connector that is mapped to the following GPIO pins to enable ATX Switch operation from a PiKVM enabled Pi4.
6 |
7 |
8 | | Function | Pi4 GPIO pin (physical) | Pi4 (Logical) | RJ45 pin |
9 | | :--------: | :--------------------------------------------: | :-----------: | :------: |
10 | | +3.3V | 1 (but could also be 17) | | 1 |
11 | | Ground | 6, 25, and 39 (but could be 9, 14, 20, 30, 34) | | 2 |
12 | | RST button | 13 | GPIO 27 | 3 |
13 | | PWR button | 16 | GPIO 23 | 4 |
14 | | HDD LED | 15 | GPIO 22 | 5 |
15 | | PWR LED | 18 | GPIO 24 | 6 |
16 | | I2C SCL | 5 | GPIO3 | 7 |
17 | | I2C SDA | 3 | GPIO 2 | 8 |
18 |
19 |
20 | The board is **self-assembly** and includes connectors for a [mini RTC (Real Time Clock) module](https://www.aliexpress.com/item/32828162429.html) and the various elements included in the case:
21 |
22 | - Pi4 GPIO expansion header
23 | - The design uses a [2x20 three layer heightened 2.54mm GPIO header](https://www.aliexpress.com/item/1005005366790021.html) to provide clearance to Pi4 USB3 / Ethernet connectors, and match up with the mounting slots in the case front.
24 |
25 | - OLED header
26 | - Fan (PWM enabled) header
27 | - [KF2510 3+1P male connector](https://www.aliexpress.com/item/1005002905132620.html) provided for keyed operation with Noctua NF-A4x10 5V PWM fan. Can also be used with 2-4pin fans using Dupont 2.54mm female connectors.
28 | - [4-pin SH1.0 connector](https://www.aliexpress.com/item/4001225684969.html) for use with suitable fans (e.g. new Pi5 40x40x10 PWM fan)
29 | - Note1 - PWM pin is grounded via 4.7Kohm resistor to enable fan to be stopped when PiKVM is halted.
30 | - Note2 - Tacho (RPM) pin is available but doesn't always seem to work reliably with PiKVM software (sometimes reports that fan is not working). I didn't investigate this exhaustively as PWM operation worked fine, so just ended up not configuring the 'hall_pin' in /etc/kvmd/fan.ini
31 |
32 | - Audio header (from C790 HDMI-to-CSI adapter)
33 |
34 | *Note - the alternative pins detailed for +3.3V and Ground are in case you want to wire up your own RJ45 connector.*
35 |
--------------------------------------------------------------------------------
/DIY_PiKVM/Case/Images/DIY_PiKVM_v2_case.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/DIY_PiKVM/Case/Images/DIY_PiKVM_v2_case.jpg
--------------------------------------------------------------------------------
/DIY_PiKVM/Case/Production/DIY_PiKVM_ATXSW_v1_Back.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/DIY_PiKVM/Case/Production/DIY_PiKVM_ATXSW_v1_Back.stl
--------------------------------------------------------------------------------
/DIY_PiKVM/Case/Production/DIY_PiKVM_ATXSW_v1_Front.stl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/DIY_PiKVM/Case/Production/DIY_PiKVM_ATXSW_v1_Front.stl
--------------------------------------------------------------------------------
/DIY_PiKVM/Case/README.md:
--------------------------------------------------------------------------------
1 | #### 3D printed Case for DIY PiKVM that supports ATX Switch operation
2 |
3 |
4 |
5 |
6 |
7 | Printed in PLA the case supports:
8 |
9 | - Pi4
10 | - Power splitter from 8086.com
11 | - C790 to provide HDMI-CSI video capture (and audio if required)
12 | - ATX Switch connector (RJ45 configured with GPIO connectivity for ATX Switch)
13 | - 40x40x10 fan
14 |
15 |
--------------------------------------------------------------------------------
/DIY_PiKVM/Images/Latest_DIY_unit_2024-03-25_gimp4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/DIY_PiKVM/Images/Latest_DIY_unit_2024-03-25_gimp4.png
--------------------------------------------------------------------------------
/DIY_PiKVM/Images/Numbered_ATX_board_connector_bottom_v1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/DIY_PiKVM/Images/Numbered_ATX_board_connector_bottom_v1.png
--------------------------------------------------------------------------------
/DIY_PiKVM/Images/Numbered_ATX_board_connector_top_v1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/DIY_PiKVM/Images/Numbered_ATX_board_connector_top_v1.png
--------------------------------------------------------------------------------
/DIY_PiKVM/Images/USB-C_PWR_Splitter5V_no_barrel_jack.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/DIY_PiKVM/Images/USB-C_PWR_Splitter5V_no_barrel_jack.jpg
--------------------------------------------------------------------------------
/DIY_PiKVM/README.md:
--------------------------------------------------------------------------------
1 | # DIY PiKVM Section
2 |
3 | 
4 |
5 | The *DIY PiKVM for ATX Switch* consists of:
6 |
7 | ## Hardware
8 |
9 | - [3D printed case](./Case/README.md)
10 | - Pi4 (suitable for PiKVM)
11 | - [Power splitter](https://www.tindie.com/products/8086net/usb-cpwr-splitter/) from 8086.com
12 | - Barrel jack version not required, although will fit.
13 |
14 | - [Angled USB-C cable](https://www.startech.com/en-gb/cables/r2ccr-15c-usb-cable) connecting Power splitter to Pi4 USC-C power supply port
15 | - Other cables / adaptors can potentially be used but I found this item to be best for the available space / bend.
16 |
17 | - [C790](https://geekworm.com/products/c790) to provide HDMI-CSI2 video capture
18 | - FPC 15-pin cable should also be supplied
19 | - (audio if required using supplied I2S cable)
20 |
21 | - [ATX Switch connector](./ATX_Switch_connector_board_for_Pi/README.md) (RJ45 configured with GPIO connectivity for ATX Switch)
22 | - [0.91 inch OLED screen](https://www.aliexpress.com/item/1005005281308478.html) (typically white / yellow / blue)
23 | - 4-pin female-to-female dupont ribbon cable
24 |
25 | - 4x 2mm silicone cushion mat self adhesive rubber feet
26 | - **Optional** - 40x40x10 fan (preferably PWM). Few types tested:
27 | - [Noctua NF-A4x10 5V PWM](https://noctua.at/en/nf-a4x10-pwm)
28 | - [Pi5 PWM fan](https://thepihut.com/products/4010-cooler-black-fan-for-raspberry-pi-5?variant=42684803907779)
29 | - [GeeekPi PWM fan](https://www.amazon.co.uk/GeeekPi-Raspberry-Adjustable-40x40x10mm-Radiator/dp/B092ZF995F?th=1)
30 | - There are others, but not tested.
31 |
32 |
33 | The case construction allows for mainly tool-less assembly, however the following bolts / connectors **are** used in the build of the unit:
34 |
35 | - 2x M3 35mm bolts for connecting the front and back of the case together.
36 | - I used [black hex socket head bolts](https://www.aliexpress.com/item/1005005832717344.html) (to match in with the black PLA) together with [M3(OD4.5) 6mm heat inserts](https://www.aliexpress.com/item/1005006042691803.html) in the case back to provide a good fit that can be opened / closed easily. The use of heat inserts is not compulsory but the inner diameter of the mounting hole on the back case will probably need to be adjusted if M3 screws (or bolts) are to be used on their own.
37 | - 4x M3 15mm bolts / nuts to fasten the fan into place
38 | - I used [black D4(M3) screw book binding post screws](https://www.aliexpress.com/item/32789781458.html) together with rubber washers to provide a good looking finish with the Noctua NF-A4x10 5V PWM fan.
39 | - **Optional** - depending on preference, an M2.5 brass standoff spacer (18mm) can be used in conjunction with 2x M2.5 6mm low flat screws to fasten the ATX Switch connector board to the Raspberry Pi4. This is not essential as the case construction will hold the components together, but may provide rigidity during assembly.
40 |
41 |
42 |
43 | ### Hardware Assembly
44 |
45 | 1. Install the fan in the top of the case back
46 |
47 | 2. Attach the ATX Switch connector board to the Pi 4b GPIO header
48 |
49 | 1. If desired affix the brass standoff spacer between the GPIO header and the Pi 4b Ethernet port
50 | 1. Do **not** affix spacer at back of Pi4 and ATXCB as this will prevent the unit sliding into the supporting slots at the rear of the case.
51 |
52 | 3. Connect one end of the 4-pin female-to-female dupont cable to the OLED pins noting which dupont wire is connected to which OLED pin. Connect the other end of the dupont cable to the OLED connector on the ATX Switch connector board (ATXCB) - the pinout should be:
53 |
54 | 
55 | 
56 |
57 |
58 | | OLED Screen pins | ATXCB OLED connector |
59 | | ---------------- | -------------------------- |
60 | | GND | ${\textsf{\color{blue}L}}$ |
61 | | VCC | ${\textsf{\color{blue}K}}$ |
62 | | SCL | ${\textsf{\color{blue}J}}$ |
63 | | SDA | ${\textsf{\color{blue}I}}$ |
64 |
65 | 4. Connect the straight end of the Angled USB-C cable to the single USB-C connector on the power splitter, and fit the power splitter into the case (should just slide in).
66 |
67 | 5. If audio is required then connect the dupont connectors from the cable supplied with the C790 to the relevant pins on the ATXCB. These are:
68 |
69 | | C790 I2S connector | Dupont connector | ATXCB connector |
70 | | ------------------ | ---------------- | ------------------------- |
71 | | GND | 1 | ${\textsf{\color{red}E}}$ |
72 | | WFS | 2 | ${\textsf{\color{red}F}}$ |
73 | | SD | 3 | ${\textsf{\color{red}G}}$ |
74 | | SCK | 4 | ${\textsf{\color{red}H}}$ |
75 |
76 | Connect the SH1 plug on the I2S cable to the socket on the C790. Refer to the [Geekworm wiki](https://wiki.geekworm.com/C790) for further details.
77 |
78 | Note - this has not been tested fully.
79 |
80 | 6. Connect the 15-pin FPC cable to the connector on the C790 (blue tag should be visible when viewing top of board).
81 |
82 | 7. Insert the C790 HDMI-to-CSI board into the slots on the inside front of the case with the HDMI connector located in the relevant (shaped) hole.
83 |
84 | 8. Place the Pi4 onto the bottom of the case back with the USB / Ethernet ports towards the front.
85 |
86 | 9. Connect the angled USB-C connector to the Power port (USB-C) to the rear left hand side of the Pi4.
87 |
88 | 10. Connect the Fan cable to the relevant header on the ATXCB
89 |
90 | 
91 | 
92 |
93 | 1. If it is a Noctua fan then the plug is keyed which defines direction.
94 |
95 | 2. If it is a Pi5 PWM fan then it connects to the SH1 connector, which is also directional.
96 |
97 | 3. If a GeeekPi (or other generic) PWM fan is used then the Fans dupont wires can be connected to the same connector used by the Noctua with the following pinout:
98 |
99 | | GeeekPi (generic) PWM | Noctua / dupont connector |
100 | | --------------------- | --------------------------- |
101 | | GND (Black) | $\color{green}{\textsf{D}}$ |
102 | | +5V (Red) | $\color{green}{\textsf{C}}$ |
103 | | PWM (Blue) | $\color{green}{\textsf{A}}$ |
104 |
105 | If RPM wire is available then can try connecting this to pin $\color{green}{\textsf{B}}$, but I had issues with getting this to work reliably so ended up only configuring the **fan.ini** file to support PWM operation (which worked fine).
106 |
107 | 11. Connect the free end of the 15-pin FPC cable into the Pi4 CSI port (blue tag towards the USB connectors).
108 |
109 | 12. Slide the Pi4 and ATXCB assembly into the slots in the front of the case (the USB and RJ45 connectors should nest into the relevant cut-outs in the case front).
110 |
111 | 13. Position the OLED screen into the relevant slot on the LHS of the case back, and gently slide the front and back of the case together, ensuring that the Pi4 slides into the supporting slots in the back of the case.
112 |
113 | 1. It will be necessary to tuck in (/ fold) the various cables during this activity in order to get everything in without causing disconnections.
114 | 2. Make sure that the FPC cable does not come out of its socket.
115 | 3. It may be necessary to repeat this exercise a couple of times to get everything seated correctly.
116 |
117 | 14. Fasten the front and back of the case together with the M3 35mm bolts.
118 |
119 | 15. Once the software has been installed / configured, insert the SD card into the Pi4, power-up and test.
120 |
121 |
122 |
123 |
124 | ## Software
125 |
126 | - [PiKVM v3 box software](https://files.pikvm.org/images/)
127 | - The latest image tested with is **v3-hdmi-rpi4-box-20240417.img.xz** with the following additions / modifications.
128 | - [ATX Switch related](./Scripts/README.md)
129 | - python scripts
130 | - PiKVM configuration file changes
131 |
--------------------------------------------------------------------------------
/DIY_PiKVM/Scripts/ATX_Switch_software_install_guide.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/DIY_PiKVM/Scripts/ATX_Switch_software_install_guide.pdf
--------------------------------------------------------------------------------
/DIY_PiKVM/Scripts/ATX_python_scripts/atx_xh_hk4401.py:
--------------------------------------------------------------------------------
1 | # =========================================================================== #
2 | # #
3 | # KVMD - The main PiKVM daemon. #
4 | # ATX Switch - KVM driver modified to enable integration with ATX switch #
5 | # #
6 | # Copyright (C) 2018-2024 Maxim Devaev #
7 | # 2021-2021 Sebastian Goscik #
8 | # 2023-2024 techlobo #
9 | # #
10 | # This program is free software: you can redistribute it and/or modify #
11 | # it under the terms of the GNU General Public License as published by #
12 | # the Free Software Foundation, either version 3 of the License, or #
13 | # (at your option) any later version. #
14 | # #
15 | # This program is distributed in the hope that it will be useful, #
16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
18 | # GNU General Public License for more details. #
19 | # #
20 | # You should have received a copy of the GNU General Public License #
21 | # along with this program. If not, see . #
22 | # #
23 | # =========================================================================== #
24 |
25 |
26 | import re
27 | import multiprocessing
28 | import functools
29 | import errno
30 | import time
31 | import os
32 | import sys
33 | sys.path.append("/etc/atx_switch/")
34 |
35 | from typing import Callable
36 | from typing import Any
37 |
38 | import serial
39 |
40 | from ...logging import get_logger
41 |
42 | from ... import aiotools
43 | from ... import aiomulti
44 | from ... import aioproc
45 |
46 | from ...yamlconf import Option
47 |
48 | from ...validators.basic import valid_number
49 | from ...validators.basic import valid_float_f01
50 | from ...validators.os import valid_abs_path
51 | from ...validators.hw import valid_tty_speed
52 |
53 | from . import GpioDriverOfflineError
54 | from . import BaseUserGpioDriver
55 |
56 | from change_atx_from_kvm import *
57 |
58 |
59 | # =====
60 | class Plugin(BaseUserGpioDriver): # pylint: disable=too-many-instance-attributes
61 | def __init__(
62 | self,
63 | instance_name: str,
64 | notifier: aiotools.AioNotifier,
65 |
66 | device_path: str,
67 | speed: int,
68 | read_timeout: float,
69 | ) -> None:
70 |
71 | super().__init__(instance_name, notifier)
72 |
73 | self.__device_path = device_path
74 | self.__speed = speed
75 | self.__read_timeout = read_timeout
76 |
77 | self.__ctl_queue: "multiprocessing.Queue[int]" = multiprocessing.Queue()
78 | self.__channel_queue: "multiprocessing.Queue[int | None]" = multiprocessing.Queue()
79 | self.__channel: (int | None) = -1
80 |
81 | self.__proc: (multiprocessing.Process | None) = None
82 | self.__stop_event = multiprocessing.Event()
83 |
84 | @classmethod
85 | def get_plugin_options(cls) -> dict:
86 | return {
87 | "device": Option("", type=valid_abs_path, unpack_as="device_path"),
88 | "speed": Option(19200, type=valid_tty_speed),
89 | "read_timeout": Option(2.0, type=valid_float_f01),
90 | }
91 |
92 | @classmethod
93 | def get_pin_validator(cls) -> Callable[[Any], Any]:
94 | return functools.partial(valid_number, min=0, max=3, name="ATX_XH-HK4401 channel")
95 |
96 | def prepare(self) -> None:
97 | assert self.__proc is None
98 | self.__proc = multiprocessing.Process(target=self.__serial_worker, daemon=True)
99 | self.__proc.start()
100 |
101 | async def run(self) -> None:
102 | while True:
103 | (got, channel) = await aiomulti.queue_get_last(self.__channel_queue, 1)
104 | if got and self.__channel != channel:
105 | self.__channel = channel
106 | self._notifier.notify()
107 |
108 | async def cleanup(self) -> None:
109 | if self.__proc is not None:
110 | if self.__proc.is_alive():
111 | get_logger(0).info("Stopping %s daemon ...", self)
112 | self.__stop_event.set()
113 | if self.__proc.is_alive() or self.__proc.exitcode is not None:
114 | self.__proc.join()
115 |
116 | async def read(self, pin: str) -> bool:
117 | if not self.__is_online():
118 | raise GpioDriverOfflineError(self)
119 | return (self.__channel == int(pin))
120 |
121 | async def write(self, pin: str, state: bool) -> None:
122 | if not self.__is_online():
123 | raise GpioDriverOfflineError(self)
124 | if state:
125 | self.__ctl_queue.put_nowait(int(pin))
126 |
127 | # =====
128 |
129 | def __is_online(self) -> bool:
130 | return (
131 | self.__proc is not None
132 | and self.__proc.is_alive()
133 | and self.__channel is not None
134 | )
135 |
136 | def __serial_worker(self) -> None:
137 | logger = aioproc.settle(str(self), f"gpio-atx_xh-hk4401-{self._instance_name}")
138 | while not self.__stop_event.is_set():
139 | try:
140 | with self.__get_serial() as tty:
141 | data = b""
142 | self.__channel_queue.put_nowait(-1)
143 |
144 | # Wait for first port heartbeat to set correct channel (~2 sec max)
145 | while True:
146 | (channel, data) = self.__recv_channel(tty, data)
147 | if channel is not None:
148 | self.__channel_queue.put_nowait(channel)
149 | break
150 |
151 | while not self.__stop_event.is_set():
152 | (channel, data) = self.__recv_channel(tty, data)
153 | if channel is not None:
154 | self.__channel_queue.put_nowait(channel)
155 |
156 | (got, channel) = aiomulti.queue_get_last_sync(self.__ctl_queue, 0.1) # type: ignore
157 | if got:
158 | assert channel is not None
159 | self.__send_channel(tty, channel)
160 |
161 | except Exception as err:
162 | self.__channel_queue.put_nowait(None)
163 | if isinstance(err, serial.SerialException) and err.errno == errno.ENOENT: # pylint: disable=no-member
164 | logger.error("Missing %s serial device: %s", self, self.__device_path)
165 | else:
166 | logger.exception("Unexpected %s error", self)
167 | time.sleep(1)
168 |
169 | def __get_serial(self) -> serial.Serial:
170 | return serial.Serial(self.__device_path, self.__speed, timeout=self.__read_timeout)
171 |
172 | def __recv_channel(self, tty: serial.Serial, data: bytes) -> tuple[(int | None), bytes]:
173 | channel: (int | None) = None
174 | if tty.in_waiting:
175 | data += tty.read_all()
176 | found = re.findall(b"AG0[1-4]gA", data)
177 | if found:
178 | try:
179 | channel = int(found[-1][2:4]) - 1
180 | except Exception:
181 | channel = None
182 | data = data[-12:]
183 |
184 | # Check if system just been initialised, and if so set ATX port to match the selected KVM channel
185 | if os.path.exists('/var/tmp/atx_switch/atx_kvm_first_time'):
186 | if channel != None:
187 | os.remove('/var/tmp/atx_switch/atx_kvm_first_time')
188 | logger.info(f'Setting initial ATX port to match KVM channel...{channel + 1}')
189 | change_atx_from_kvm(channel + 1)
190 |
191 | return (channel, data)
192 |
193 | def __send_channel(self, tty: serial.Serial, channel: int) -> None:
194 | assert 0 <= channel <= 3
195 | cmd = "SW{port}\r\nAG{port:02d}gA".format(port=(channel + 1)).encode()
196 | tty.write(cmd)
197 | tty.flush()
198 |
199 | # Set ATX selected port to match KVM channel number
200 | change_atx_from_kvm(channel + 1)
201 |
202 | def __str__(self) -> str:
203 | return f"ATX_XH-HK4401({self._instance_name})"
204 |
205 | __repr__ = __str__
206 |
--------------------------------------------------------------------------------
/DIY_PiKVM/Scripts/ATX_python_scripts/etc/atx_switch/atx_change_port.py:
--------------------------------------------------------------------------------
1 | # ========================================================================== #
2 | # #
3 | # ATX Switch #
4 | # #
5 | # atx_change_port.py - script to change ATX operation focus to #
6 | # specified switch unit (address) and port #
7 | # #
8 | # Copyright (C) 2023-2024 techlobo #
9 | # #
10 | # This program is free software: you can redistribute it and/or modify #
11 | # it under the terms of the GNU General Public License as published by #
12 | # the Free Software Foundation, either version 3 of the License, or #
13 | # (at your option) any later version. #
14 | # #
15 | # This program is distributed in the hope that it will be useful, #
16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
18 | # GNU General Public License for more details. #
19 | # #
20 | # You should have received a copy of the GNU General Public License #
21 | # along with this program. If not, see . # # #
22 | # ========================================================================== #
23 |
24 | import yaml
25 | import smbus2
26 | import logging
27 | import systemd.journal
28 |
29 | address_present = 'yes'
30 |
31 | # Set up logging
32 | logger = logging.getLogger('ATX_Logger')
33 | journal_handler = systemd.journal.JournalHandler(SYSLOG_IDENTIFIER='ATX')
34 | formatter = logging.Formatter('%(asctime)s [%(levelname)s] - %(message)s', datefmt='%Y-%m-%d %H:%M:%S')
35 | journal_handler.setFormatter(formatter)
36 |
37 | logger.addHandler(journal_handler)
38 |
39 | print(logger.handlers)
40 |
41 | def setup_logging(debug_flag):
42 | logger.setLevel(logging.DEBUG if debug_flag else logging.INFO)
43 |
44 | def set_gpio_register(i2c_bus_id, address, value):
45 | global address_present
46 | bus = smbus2.SMBus(i2c_bus_id)
47 | address_present = 'yes'
48 | try:
49 | bus.write_byte_data(address, 0x09, value)
50 | # handle remote IO error 121 which normally means that an addressed slave device is not
51 | # present at the address provided
52 | except IOError as e:
53 | if e.errno == 121:
54 | logger.error(f"Switch at I2C address 0x{hex(address)[2:]} - Device is NOT present.")
55 | address_present = 'no'
56 | else:
57 | logger.error(f"An error occurred while accessing Switch at I2C address 0x{hex(address)[2:]}: {str(e)}")
58 |
59 |
60 | def atx_change_port(switch_address, port_num):
61 | # Read sw_addresses from atx_operational.yaml
62 | with open("/var/tmp/atx_switch/atx_operational.yaml", "r") as yaml_file:
63 | data = yaml.safe_load(yaml_file)
64 |
65 | debug_flag = data.get("debug_flag")
66 | i2c_bus_id = data.get("i2c_bus_id")
67 | sw_addresses = data.get("sw_addresses", {})
68 |
69 | setup_logging(debug_flag)
70 |
71 | # Loop through the devices at sw_addresses on I2C bus
72 | # for device, address in sw_addresses.items():
73 | for i in range(0, len(sw_addresses)):
74 | address = sw_addresses[i]
75 | set_gpio_register(i2c_bus_id, address, 0x00)
76 | if (address_present == 'no'):
77 | sw_addresses.remove(address)
78 | logger.warning(f"Switch address {hex(address)} removed from atx_operational.yaml file")
79 |
80 | # Set the MCP23008 GPIO register for the specified device
81 | if switch_address in sw_addresses:
82 | set_gpio_register(i2c_bus_id, switch_address, 0x03 + port_num)
83 | logger.info(f"Port '{port_num}' on Switch 0x{hex(switch_address)[2:]} selected")
84 |
85 | # Update the atx_operational.yaml file
86 | # performed here so that only change if register update successful, otherwise values remain as was
87 | data["current_sw_address"] = switch_address
88 | data["current_port_num"] = port_num
89 |
90 | else:
91 | logger.warning(f"Switch address '{switch_address}' not found in sw_addresses.")
92 |
93 |
94 | def hexint_presenter(dumper, data):
95 | return dumper.represent_int(hex(data))
96 | yaml.add_representer(int, hexint_presenter)
97 |
98 | with open("/var/tmp/atx_switch/atx_operational.yaml", "w") as yaml_file:
99 | yaml.dump(data, yaml_file, default_flow_style=False)
100 | # Note - If use safe_dump then data is presented in decimal not hex format!!
101 |
--------------------------------------------------------------------------------
/DIY_PiKVM/Scripts/ATX_python_scripts/etc/atx_switch/atx_kvm_mapping.yaml:
--------------------------------------------------------------------------------
1 | kvm_switch_mapping:
2 | - channel: 1
3 | atx_switch_port:
4 | switch_address: 0x20
5 | port_number: 1
6 |
7 | - channel: 2
8 | atx_switch_port:
9 | switch_address: 0x20
10 | port_number: 2
11 |
12 | - channel: 3
13 | atx_switch_port:
14 | switch_address: 0x20
15 | port_number: 3
16 |
17 | - channel: 4
18 | atx_switch_port:
19 | switch_address: 0x20
20 | port_number: 4
21 |
22 | # Add more mappings as needed
23 |
--------------------------------------------------------------------------------
/DIY_PiKVM/Scripts/ATX_python_scripts/etc/atx_switch/atx_switch_initialisation.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | debug_flag: False
3 | i2c_bus_id: 1
4 | num_switches: 2
5 | my_switch_1:
6 | - i2c_address: 0x20
7 | - num_ports: 4
8 | - atx_ops: gpio
9 | - db_test: 'no'
10 | - port_select_test: 'no'
11 | my_switch_2:
12 | - i2c_address: 0x21
13 | - num_ports: 8
14 | - atx_ops: gpio
15 | - db_test: 'no'
16 | - port_select_test: 'no'
17 | my_switch_3:
18 | - i2c_address: 0x22
19 | - num_ports: 8
20 | - atx_ops: i2c
21 | - db_test: 'no'
22 | - port_select_test: 'no'
23 | ...
24 |
--------------------------------------------------------------------------------
/DIY_PiKVM/Scripts/ATX_python_scripts/etc/atx_switch/change_atx_from_kvm.py:
--------------------------------------------------------------------------------
1 | # ========================================================================== #
2 | # #
3 | # ATX Switch #
4 | # #
5 | # change_atx_from_kvm.py - script to change ATX operational focus #
6 | # to device (address) / port associated #
7 | # with KVM channel number #
8 | # #
9 | # Copyright (C) 2023-2024 techlobo #
10 | # #
11 | # This program is free software: you can redistribute it and/or modify #
12 | # it under the terms of the GNU General Public License as published by #
13 | # the Free Software Foundation, either version 3 of the License, or #
14 | # (at your option) any later version. #
15 | # #
16 | # This program is distributed in the hope that it will be useful, #
17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
19 | # GNU General Public License for more details. #
20 | # #
21 | # You should have received a copy of the GNU General Public License #
22 | # along with this program. If not, see . # # #
23 | # ========================================================================== #
24 |
25 | import yaml
26 |
27 | from atx_change_port import *
28 |
29 | # Set up logging
30 | # logging handler configured via atx_change_port
31 |
32 | print(logger.handlers)
33 |
34 | def load_mapping(file_path):
35 | with open(file_path, 'r') as file:
36 | mapping_data = yaml.safe_load(file)
37 | return mapping_data['kvm_switch_mapping']
38 |
39 | def find_atx_switch_port(channel, mapping):
40 | for entry in mapping:
41 | if entry['channel'] == channel:
42 | return entry['atx_switch_port']
43 | return None
44 |
45 | def get_atx_switch_port(file_path, channel_to_find):
46 | mapping = load_mapping(file_path)
47 | atx_switch_port = find_atx_switch_port(channel_to_find, mapping)
48 |
49 | if atx_switch_port:
50 | switch_address = atx_switch_port['switch_address']
51 | port_number = atx_switch_port['port_number']
52 | return switch_address, port_number
53 | else:
54 | return None, None
55 |
56 | def change_atx_from_kvm(channel_to_find):
57 | atx_kvm_yaml_file = '/etc/atx_switch/atx_kvm_mapping.yaml'
58 | switch_address, port_number = get_atx_switch_port(atx_kvm_yaml_file, channel_to_find)
59 |
60 | if switch_address is not None and port_number is not None:
61 | atx_change_port(switch_address, port_number)
62 | else:
63 | logger.error(f"No mapping found for channel {channel_to_find}.")
64 |
65 |
--------------------------------------------------------------------------------
/DIY_PiKVM/Scripts/ATX_python_scripts/etc/atx_switch/port_test_1.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 | from test_port_led import *
3 |
4 | check_port(0x20, 1)
5 |
6 |
--------------------------------------------------------------------------------
/DIY_PiKVM/Scripts/ATX_python_scripts/etc/atx_switch/port_test_2.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 | from test_port_led import *
3 |
4 | check_port(0x20, 2)
5 |
6 |
--------------------------------------------------------------------------------
/DIY_PiKVM/Scripts/ATX_python_scripts/etc/atx_switch/port_test_3.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 | from test_port_led import *
3 |
4 | check_port(0x20, 3)
5 |
--------------------------------------------------------------------------------
/DIY_PiKVM/Scripts/ATX_python_scripts/etc/atx_switch/port_test_4.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 | from test_port_led import *
3 |
4 | check_port(0x20, 4)
5 |
6 |
--------------------------------------------------------------------------------
/DIY_PiKVM/Scripts/ATX_python_scripts/etc/atx_switch/select1.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | #
3 | from atx_change_port import *
4 |
5 | atx_change_port(0x20, 1)
6 |
--------------------------------------------------------------------------------
/DIY_PiKVM/Scripts/ATX_python_scripts/etc/atx_switch/select2.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | #
3 | from atx_change_port import *
4 |
5 | atx_change_port(0x20, 2)
6 |
--------------------------------------------------------------------------------
/DIY_PiKVM/Scripts/ATX_python_scripts/etc/atx_switch/select3.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | #
3 | from atx_change_port import *
4 |
5 | atx_change_port(0x20, 3)
6 |
--------------------------------------------------------------------------------
/DIY_PiKVM/Scripts/ATX_python_scripts/etc/atx_switch/select4.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | #
3 | from atx_change_port import *
4 |
5 | atx_change_port(0x20, 4)
6 |
--------------------------------------------------------------------------------
/DIY_PiKVM/Scripts/ATX_python_scripts/etc/atx_switch/test_port_led.py:
--------------------------------------------------------------------------------
1 | # ========================================================================== #
2 | # #
3 | # ATX Switch #
4 | # #
5 | # test_port_led.py - script called via CMDRET api to verify #
6 | # active device (address) / port in the environment #
7 | # #
8 | # Copyright (C) 2023-2024 techlobo #
9 | # #
10 | # This program is free software: you can redistribute it and/or modify #
11 | # it under the terms of the GNU General Public License as published by #
12 | # the Free Software Foundation, either version 3 of the License, or #
13 | # (at your option) any later version. #
14 | # #
15 | # This program is distributed in the hope that it will be useful, #
16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
18 | # GNU General Public License for more details. #
19 | # #
20 | # You should have received a copy of the GNU General Public License #
21 | # along with this program. If not, see . # # #
22 | # ========================================================================== #
23 |
24 | import yaml
25 | import logging
26 | import sys
27 |
28 | def check_port(switch_addr, port_num):
29 | # Read switch address and port number from atx_operational.yaml
30 | with open("/var/tmp/atx_switch/atx_operational.yaml", "r") as yaml_file:
31 | data = yaml.safe_load(yaml_file)
32 |
33 | # debug_flag = data.get("debug_flag")
34 | cur_sw_addr = data.get("current_sw_address", {})
35 | cur_port_num = data.get("current_port_num", {})
36 |
37 | if cur_sw_addr == switch_addr:
38 | if cur_port_num == port_num:
39 | sys.exit (0)
40 | else:
41 | sys.exit (-1)
42 | else:
43 | sys.exit (-1)
44 |
--------------------------------------------------------------------------------
/DIY_PiKVM/Scripts/Modified_kvmd_files/bin/initialise_atx_switches:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # ========================================================================== #
3 | # #
4 | # ATX Switch #
5 | # #
6 | # initialise_atx_switches - script to verify presence, and configure #
7 | # operation of ATX switch units available #
8 | # via I2C from DIY PiKVM control unit #
9 | # #
10 | # Copyright (C) 2023-2024 techlobo #
11 | # #
12 | # This program is free software: you can redistribute it and/or modify #
13 | # it under the terms of the GNU General Public License as published by #
14 | # the Free Software Foundation, either version 3 of the License, or #
15 | # (at your option) any later version. #
16 | # #
17 | # This program is distributed in the hope that it will be useful, #
18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of #
19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
20 | # GNU General Public License for more details. #
21 | # #
22 | # You should have received a copy of the GNU General Public License #
23 | # along with this program. If not, see . # # #
24 | # ========================================================================== #
25 |
26 |
27 | import os
28 | import sys
29 | import time
30 | import yaml
31 | import smbus2
32 | import logging
33 | import systemd.journal
34 | from numbers import Number
35 |
36 | # Set up logging
37 | logger = logging.getLogger('ATX_Logger')
38 | journal_handler = systemd.journal.JournalHandler(SYSLOG_IDENTIFIER='ATX')
39 | formatter = logging.Formatter('%(asctime)s [%(levelname)s] - %(message)s', datefmt='%Y-%m-%d %H:%M:%S')
40 | journal_handler.setFormatter(formatter)
41 |
42 | logger.addHandler(journal_handler)
43 |
44 | def setup_logging(debug_flag):
45 | logger.setLevel(logging.DEBUG if debug_flag else logging.INFO)
46 |
47 | # Define valid parameter values
48 | VALID_I2C_ADDRESSES = [0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27]
49 | VALID_NUM_PORTS = [4, 8]
50 | VALID_ATX_OPS = ['i2c', 'gpio']
51 | VALID_DB_TEST = ['yes', 'no']
52 | VALID_PORT_SELECT_TEST = ['yes', 'no']
53 | VALID_DEBUG_FLAG_TEST = [True, False]
54 |
55 | # define variables
56 | sw_addresses = []
57 |
58 | # Dictionary attribute offsets
59 | num_dict_offset_attributes = 5
60 | i2c_address_dict_offset = 10
61 | num_ports_dict_offset = 10
62 | atx_ops_dict_offset = 10
63 | db_test_dict_offset = 10
64 | port_select_test_dict_offset = 10
65 |
66 | def daughterboard_test(i2c_bus, i2c_address):
67 | # Set IODIR register to 0x30 (binary 00110000)
68 | i2c_bus.write_byte_data(i2c_address, 0x00, 0x30)
69 |
70 | # Perform Daughter Board test
71 | check_value = 0
72 | db_test_message = "Daughter board is ABSENT"
73 | for port_number in [0x08, 0x09, 0x0A, 0x0B]:
74 | i2c_bus.write_byte_data(i2c_address, 0x09, port_number)
75 | time.sleep(1)
76 | gpio_register_value = i2c_bus.read_byte_data(i2c_address, 0x09)
77 | check_value = (check_value << 1) + gpio_register_value - port_number
78 | if check_value == 0x40:
79 | db_test_message = "Daughter board is PRESENT"
80 | break
81 |
82 | logger.info(f"ATX_Switch_{switch_num} - {db_test_message}")
83 |
84 | # Check if the YAML file exists
85 | config_file_path = "/etc/atx_switch/atx_switch_initialisation.yaml"
86 | if not os.path.exists(config_file_path):
87 | logger.error("The YAML configuration file is not present.")
88 |
89 | sys.exit(1)
90 |
91 | # Load the YAML configuration
92 | with open(config_file_path, 'r') as config_file:
93 | config = yaml.safe_load(config_file)
94 |
95 | # Validate debug_flag
96 | debug_flag = config.get('debug_flag')
97 | if debug_flag not in VALID_DEBUG_FLAG_TEST:
98 | logger.error(f"Invalid 'debug_flag' value: {debug_flag}")
99 | sys.exit(1)
100 |
101 | setup_logging(debug_flag)
102 |
103 | # Validate i2c_bus_id
104 | # can't be certain of range, but must be a number!
105 | i2c_bus_id = config.get('i2c_bus_id')
106 | if not (isinstance(i2c_bus_id, Number)):
107 | logger.error(f"No numeric i2c_bus_id provided")
108 | sys.exit(1)
109 |
110 | # Validate num_switches
111 | num_switches = config.get('num_switches')
112 | if not (1 <= num_switches <= 8):
113 | logger.error(f"Invalid 'num_switches' value: {num_switches}")
114 | sys.exit(1)
115 |
116 | # Check if the number of my_switch_X entries equals num_switches
117 | switch_entries = [f'my_switch_{i}' for i in range(1, num_switches + 1)]
118 | if not all(entry in config for entry in switch_entries):
119 | logger.error(f"Number of 'my_switch_X' entries does not match 'num_switches': {num_switches}")
120 | sys.exit(1)
121 |
122 | # Initialize the I2C bus
123 | i2c_bus = smbus2.SMBus(i2c_bus_id)
124 | devices_found = 0
125 |
126 | # Check each switch entry
127 | for switch_num in range(1, num_switches + 1):
128 | switch_entry = config[f'my_switch_{switch_num}']
129 |
130 | # check that all fields are present
131 | for i in range(0, len(switch_entry)):
132 | if "i2c_address" in switch_entry[i]:
133 | i2c_address_dict_offset = i
134 | if "num_ports" in switch_entry[i]:
135 | num_ports_dict_offset = i
136 | if "atx_ops" in switch_entry[i]:
137 | atx_ops_dict_offset = i
138 | if "db_test" in switch_entry[i]:
139 | db_test_dict_offset = i
140 | if "port_select_test" in switch_entry[i]:
141 | port_select_test_dict_offset = i
142 |
143 | if 10 in (i2c_address_dict_offset, num_ports_dict_offset, atx_ops_dict_offset, db_test_dict_offset, port_select_test_dict_offset):
144 | if i2c_address_dict_offset == 10:
145 | logger.error(f"Missing 'i2c_address' attribute in 'My_switch_{switch_num}")
146 | if num_ports_dict_offset == 10:
147 | logger.error(f"Missing 'num_ports' attribute in 'My_switch_{switch_num}")
148 | if atx_ops_dict_offset == 10:
149 | logger.error(f"Missing 'atx_ops' attribute in 'My_switch_{switch_num}")
150 | if db_test_dict_offset == 10:
151 | logger.error(f"Missing 'db_test' attribute in 'My_switch_{switch_num}")
152 | if port_select_test_dict_offset == 10:
153 | logger.error(f"Missing 'port_select_test' attribute in 'My_switch_{switch_num}")
154 |
155 | logger.debug(f"Switch is {switch_entry}")
156 |
157 | try:
158 | i2c_address = switch_entry[0].get('i2c_address')
159 | except IndexError as e:
160 | logger.error(f" {e} - missing parameter 'i2c_address'")
161 |
162 | if i2c_address not in VALID_I2C_ADDRESSES:
163 | logger.error(f"'my_switch_{switch_num}' - Invalid 'i2c_address' value : 0x{hex(i2c_address)[2:]}")
164 | sys.exit(1)
165 |
166 | logger.debug(f"switchnum is {switch_num}")
167 | logger.debug(f"i2caddress is 0x{hex(i2c_address)[2:]}")
168 |
169 | try:
170 | num_ports = switch_entry[1].get('num_ports')
171 | except IndexError as e:
172 | logger.error(f" {e} - missing parameter 'num_ports'")
173 |
174 | if num_ports not in VALID_NUM_PORTS:
175 | logger.error(f"'my_switch_{switch_num}' - Invalid 'num_ports' value : {num_ports}")
176 | sys.exit(1)
177 |
178 | logger.debug(f"numports are {num_ports}")
179 |
180 | try:
181 | atx_ops = switch_entry[2].get('atx_ops')
182 | except IndexError as e:
183 | logger.error(f" {e} - missing parameter 'atx_ops'")
184 |
185 | if atx_ops not in VALID_ATX_OPS:
186 | logger.error(f"'my_switch_{switch_num}' - Invalid 'atx_ops' value : {atx_ops}")
187 | sys.exit(1)
188 |
189 | logger.debug(f"atxops are {atx_ops}")
190 |
191 | try:
192 | db_test = switch_entry[3].get('db_test')
193 | except IndexError as e:
194 | logger.error(f" {e} - missing parameter 'db_test'")
195 |
196 | if db_test not in VALID_DB_TEST:
197 | logger.error(f"'my_switch_{switch_num}' - Invalid 'db_test' value : {db_test}")
198 | sys.exit(1)
199 |
200 | logger.debug(f"dbtest is {db_test}")
201 |
202 | try:
203 | port_select_test = switch_entry[4].get('port_select_test')
204 | except IndexError as e:
205 | logger.error(f" {e} - missing parameter 'port_select'")
206 |
207 | if port_select_test not in VALID_PORT_SELECT_TEST:
208 | logger.error(f"'my_switch_{switch_num}' - Invalid 'port_select_test' value : {port_select_test}")
209 | sys.exit(1)
210 |
211 | logger.debug(f"port_select_test is {port_select_test}")
212 |
213 | try:
214 | # Verify the device on the I2C bus
215 | i2c_bus.read_byte(i2c_address)
216 | devices_found += 1
217 | logger.info(f"'my_switch_{switch_num}' at I2C address 0x{hex(i2c_address)[2:]} - Device is present.")
218 | sw_addresses .append(i2c_address)
219 |
220 | # Set IODIR register and perform other operations if the device is present
221 | i2c_bus.write_byte_data(i2c_address, 0x00, 0x30)
222 | i2c_bus.write_byte_data(i2c_address, 0x09, 0x00)
223 |
224 | if db_test == 'yes':
225 | daughterboard_test(i2c_bus, i2c_address)
226 |
227 | if port_select_test == 'yes':
228 | for port_number in range(1, num_ports + 1):
229 | i2c_bus.write_byte_data(i2c_address, 0x09, 0x03 + port_number)
230 | time.sleep(1)
231 | i2c_bus.write_byte_data(i2c_address, 0x09, 0x00)
232 |
233 | # handle remote IO error 121 which normally means that an addressed slave device is not
234 | # present at the address provided
235 | except IOError as e:
236 | if e.errno == 121:
237 | logger.error(f"'my_switch_{switch_num}' at I2C address 0x{hex(i2c_address)[2:]} - Device is NOT present.")
238 | else:
239 | logger.error(f"An error occurred while accessing 'my_switch_{switch_num}': {str(e)}")
240 |
241 | # Display the result
242 | if devices_found == 0:
243 | logger.error("No ATX Switches are present.")
244 |
245 | # create the operational YAML file
246 | operational_data = {
247 | "i2c_bus_id": i2c_bus_id,
248 | "sw_addresses": sw_addresses,
249 | "current_sw_address": 0,
250 | "current_port_num": 0,
251 | "debug_flag": debug_flag
252 | }
253 |
254 | def hexint_presenter(dumper, operational_data):
255 | return dumper.represent_int(hex(operational_data))
256 | yaml.add_representer(int, hexint_presenter)
257 |
258 | directory_path = '/var/tmp/atx_switch'
259 | filename = os.path.join(directory_path, 'atx_operational.yaml')
260 | os.makedirs(directory_path, exist_ok=True)
261 | with open(filename, "w") as yaml_file:
262 | yaml.dump(operational_data, yaml_file, default_flow_style=False)
263 | # Note - If use safe_dump then data is presented in decimal not hex format!!
264 | os.chmod(directory_path, 0o777)
265 | os.chmod(filename, 0o666)
266 |
267 | kvm_mapping_filename = "/etc/atx_switch/atx_kvm_mapping.yaml"
268 | atx_kvm_first_time_filename = "/var/tmp/atx_switch/atx_kvm_first_time"
269 |
270 | if os.path.exists(kvm_mapping_filename):
271 | with open(atx_kvm_first_time_filename, 'w') as atx_kvm_first_time_file:
272 | os.chmod(atx_kvm_first_time_filename, 0o666)
--------------------------------------------------------------------------------
/DIY_PiKVM/Scripts/Modified_kvmd_files/boot/config.txt:
--------------------------------------------------------------------------------
1 | # See /boot/overlays/README for all available options
2 | initramfs initramfs-linux.img followkernel
3 |
4 | hdmi_force_hotplug=1
5 | gpu_mem=128
6 | enable_uart=1
7 | dtoverlay=tc358743
8 | dtoverlay=disable-bt
9 | dtoverlay=dwc2,dr_mode=peripheral
10 | dtparam=act_led_gpio=13
11 |
12 | # HDMI audio capture
13 | dtoverlay=tc358743-audio
14 |
15 | # SPI (AUM)
16 | dtoverlay=spi0-1cs
17 |
18 | # I2C (display)
19 | dtparam=i2c_arm=on
20 |
21 | # Clock
22 | dtoverlay=i2c-rtc,ds1307
23 |
--------------------------------------------------------------------------------
/DIY_PiKVM/Scripts/Modified_kvmd_files/etc/kvmd/fan.ini:
--------------------------------------------------------------------------------
1 | [main]
2 | pwm_pin = 12
3 |
4 | [speed]
5 | idle = 20
6 | low = 20
7 |
8 | [server]
9 | unix = /run/kvmd/fan.sock
10 | unix_rm = 1
11 | unix_mode = 666
12 |
--------------------------------------------------------------------------------
/DIY_PiKVM/Scripts/Modified_kvmd_files/etc/kvmd/override_with_kvm_mapping.yaml:
--------------------------------------------------------------------------------
1 | kvmd:
2 | gpio:
3 | drivers:
4 | port1:
5 | type: cmd
6 | cmd: [/etc/atx_switch/select1.py]
7 | port2:
8 | type: cmd
9 | cmd: [/etc/atx_switch/select2.py]
10 | port3:
11 | type: cmd
12 | cmd: [/etc/atx_switch/select3.py]
13 | port4:
14 | type: cmd
15 | cmd: [/etc/atx_switch/select4.py]
16 | p1_led:
17 | type: cmdret
18 | cmd: [/etc/atx_switch/port_test_1.py]
19 | p2_led:
20 | type: cmdret
21 | cmd: [/etc/atx_switch/port_test_2.py]
22 | p3_led:
23 | type: cmdret
24 | cmd: [/etc/atx_switch/port_test_3.py]
25 | p4_led:
26 | type: cmdret
27 | cmd: [/etc/atx_switch/port_test_4.py]
28 | hk:
29 | type: atx_xh_hk4401
30 | device: /dev/ttyUSB0
31 | scheme:
32 | port1:
33 | driver: port1
34 | pin: 0
35 | mode: output
36 | switch: false
37 | port2:
38 | driver: port2
39 | pin: 1
40 | mode: output
41 | switch: false
42 | port3:
43 | driver: port3
44 | pin: 2
45 | mode: output
46 | switch: false
47 | port4:
48 | driver: port4
49 | pin: 3
50 | mode: output
51 | switch: false
52 | prt1_led:
53 | driver: p1_led
54 | pin: 0
55 | mode: input
56 | prt2_led:
57 | driver: p2_led
58 | pin: 1
59 | mode: input
60 | prt3_led:
61 | driver: p3_led
62 | pin: 2
63 | mode: input
64 | prt4_led:
65 | driver: p4_led
66 | pin: 3
67 | mode: input
68 | ch0_led:
69 | driver: hk
70 | pin: 0
71 | mode: input
72 | ch1_led:
73 | driver: hk
74 | pin: 1
75 | mode: input
76 | ch2_led:
77 | driver: hk
78 | pin: 2
79 | mode: input
80 | ch3_led:
81 | driver: hk
82 | pin: 3
83 | mode: input
84 | ch0_button:
85 | driver: hk
86 | pin: 0
87 | mode: output
88 | switch: false
89 | ch1_button:
90 | driver: hk
91 | pin: 1
92 | mode: output
93 | switch: false
94 | ch2_button:
95 | driver: hk
96 | pin: 2
97 | mode: output
98 | switch: false
99 | ch3_button:
100 | driver: hk
101 | pin: 3
102 | mode: output
103 | switch: false
104 | view:
105 | header:
106 | title: Source
107 | table:
108 | - []
109 | - ["#Input 1", ch0_led, "ch0_button|Select", "port1|ATX1", prt1_led]
110 | - []
111 | - ["#Input 2", ch1_led, "ch1_button|Select", "port2|ATX2", prt2_led]
112 | - []
113 | - ["#Input 3", ch2_led, "ch2_button|Select", "port3|ATX3", prt3_led]
114 | - []
115 | - ["#Input 4", ch3_led, "ch3_button|Select", "port4|ATX4", prt4_led]
116 | - []
117 |
--------------------------------------------------------------------------------
/DIY_PiKVM/Scripts/Modified_kvmd_files/etc/kvmd/override_without_kvm_mapping.yaml:
--------------------------------------------------------------------------------
1 | kvmd:
2 | gpio:
3 | drivers:
4 | port1:
5 | type: cmd
6 | cmd: [/etc/atx_switch/select1.py]
7 | port2:
8 | type: cmd
9 | cmd: [/etc/atx_switch/select2.py]
10 | port3:
11 | type: cmd
12 | cmd: [/etc/atx_switch/select3.py]
13 | port4:
14 | type: cmd
15 | cmd: [/etc/atx_switch/select4.py]
16 | p1_led:
17 | type: cmdret
18 | cmd: [/etc/atx_switch/port_test_1.py]
19 | p2_led:
20 | type: cmdret
21 | cmd: [/etc/atx_switch/port_test_2.py]
22 | p3_led:
23 | type: cmdret
24 | cmd: [/etc/atx_switch/port_test_3.py]
25 | p4_led:
26 | type: cmdret
27 | cmd: [/etc/atx_switch/port_test_4.py]
28 | hk:
29 | type: xh_hk4401
30 | device: /dev/ttyUSB0
31 | scheme:
32 | port1:
33 | driver: port1
34 | pin: 0
35 | mode: output
36 | switch: false
37 | port2:
38 | driver: port2
39 | pin: 1
40 | mode: output
41 | switch: false
42 | port3:
43 | driver: port3
44 | pin: 2
45 | mode: output
46 | switch: false
47 | port4:
48 | driver: port4
49 | pin: 3
50 | mode: output
51 | switch: false
52 | prt1_led:
53 | driver: p1_led
54 | pin: 0
55 | mode: input
56 | prt2_led:
57 | driver: p2_led
58 | pin: 1
59 | mode: input
60 | prt3_led:
61 | driver: p3_led
62 | pin: 2
63 | mode: input
64 | prt4_led:
65 | driver: p4_led
66 | pin: 3
67 | mode: input
68 | ch0_led:
69 | driver: hk
70 | pin: 0
71 | mode: input
72 | ch1_led:
73 | driver: hk
74 | pin: 1
75 | mode: input
76 | ch2_led:
77 | driver: hk
78 | pin: 2
79 | mode: input
80 | ch3_led:
81 | driver: hk
82 | pin: 3
83 | mode: input
84 | ch0_button:
85 | driver: hk
86 | pin: 0
87 | mode: output
88 | switch: false
89 | ch1_button:
90 | driver: hk
91 | pin: 1
92 | mode: output
93 | switch: false
94 | ch2_button:
95 | driver: hk
96 | pin: 2
97 | mode: output
98 | switch: false
99 | ch3_button:
100 | driver: hk
101 | pin: 3
102 | mode: output
103 | switch: false
104 | view:
105 | header:
106 | title: Source
107 | table:
108 | - []
109 | - ["#Input 1", ch0_led, "ch0_button|Select", "port1|ATX1", prt1_led]
110 | - []
111 | - ["#Input 2", ch1_led, "ch1_button|Select", "port2|ATX2", prt2_led]
112 | - []
113 | - ["#Input 3", ch2_led, "ch2_button|Select", "port3|ATX3", prt3_led]
114 | - []
115 | - ["#Input 4", ch3_led, "ch3_button|Select", "port4|ATX4", prt4_led]
116 | - []
117 |
--------------------------------------------------------------------------------
/DIY_PiKVM/Scripts/Modified_kvmd_files/initialise_atx_switches.service:
--------------------------------------------------------------------------------
1 | [Unit]
2 | Description=Initialise_ATX_switches - configuration utility for ATX switches
3 | After=network-online.target ntp.service
4 | ConditionPathExists=/dev/i2c-1
5 |
6 | [Service]
7 | Type=simple
8 | ExecStart=/usr/bin/initialise_atx_switches
9 | TimeoutStopSec=3
10 |
11 | [Install]
12 | WantedBy=multi-user.target
13 |
--------------------------------------------------------------------------------
/DIY_PiKVM/Scripts/README.md:
--------------------------------------------------------------------------------
1 | #### Python scripts and modified PiKVM (kvmd) files required to enable operation of the ATX Switches from the PiKVM WebUI.
2 |
3 | The files in this directory / sub-directories currently support WebUI ATX operations via the assigned GPIO pins.
4 |
5 | Performing ATX operations via I2C has **not** yet been implemented.
6 |
7 | Examples of the new scripts required for ATX Switch operation are provided in '[ATX python scripts](./ATX_python_scripts)', and will need configuring for the target environment as described in the installation guide.
8 |
9 | Examples of the modified 'kvmd' scripts, together with requisite service files, are provided in '[Modified kvmd files](./Modified_kvmd_files)'.
10 |
11 | The installation steps for configuring PiKVM to operate with the ATX Switch are provided in the [ATX Switch software environment install guide](./ATX_Switch_software_install_guide.pdf) (PDF).
12 |
13 | *Note - the actual number of scripts to be installed, and the required configuration data, will be dependent upon the architecture of the installed environment.*
14 |
15 |
--------------------------------------------------------------------------------
/Images/ATX_Switch_4_2024-03-25.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/Images/ATX_Switch_4_2024-03-25.png
--------------------------------------------------------------------------------
/Images/ATX_Switch_4_back_angle_v1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/Images/ATX_Switch_4_back_angle_v1.png
--------------------------------------------------------------------------------
/Images/ATX_Switch_8_2024-03-25.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/Images/ATX_Switch_8_2024-03-25.png
--------------------------------------------------------------------------------
/Images/ATX_Switch_8_back_angle_v1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/Images/ATX_Switch_8_back_angle_v1.png
--------------------------------------------------------------------------------
/Images/ATX_Switch_Interface_adaptor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/Images/ATX_Switch_Interface_adaptor.png
--------------------------------------------------------------------------------
/Images/DIY_PiKVM_for_ATX_Switch_v1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/Images/DIY_PiKVM_for_ATX_Switch_v1.png
--------------------------------------------------------------------------------
/Images/Latest_DIY_unit_2024-03-25_gimp4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/Images/Latest_DIY_unit_2024-03-25_gimp4.png
--------------------------------------------------------------------------------
/Images/PiKVM_ATX_op1.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/Images/PiKVM_ATX_op1.mp4
--------------------------------------------------------------------------------
/Images/PiKVM_ATX_op2.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/Images/PiKVM_ATX_op2.mp4
--------------------------------------------------------------------------------
/Images/Typical_deployment_architecture_v1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/Images/Typical_deployment_architecture_v1.png
--------------------------------------------------------------------------------
/Images/Typical_deployment_commercial_pikvm_v1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/Images/Typical_deployment_commercial_pikvm_v1.png
--------------------------------------------------------------------------------
/Images/Typical_deployment_diy_pikvm_v1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/Images/Typical_deployment_diy_pikvm_v1.png
--------------------------------------------------------------------------------
/Images/WebUI_Source_menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/Images/WebUI_Source_menu.png
--------------------------------------------------------------------------------
/Images/atx_switch_interface_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/Images/atx_switch_interface_1.png
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 |
2 | GNU GENERAL PUBLIC LICENSE
3 | Version 3, 29 June 2007
4 |
5 | Copyright (C) 2007 Free Software Foundation, Inc.
6 | Everyone is permitted to copy and distribute verbatim copies
7 | of this license document, but changing it is not allowed.
8 |
9 | Preamble
10 |
11 | The GNU General Public License is a free, copyleft license for
12 | software and other kinds of works.
13 |
14 | The licenses for most software and other practical works are designed
15 | to take away your freedom to share and change the works. By contrast,
16 | the GNU General Public License is intended to guarantee your freedom to
17 | share and change all versions of a program--to make sure it remains free
18 | software for all its users. We, the Free Software Foundation, use the
19 | GNU General Public License for most of our software; it applies also to
20 | any other work released this way by its authors. You can apply it to
21 | your programs, too.
22 |
23 | When we speak of free software, we are referring to freedom, not
24 | price. Our General Public Licenses are designed to make sure that you
25 | have the freedom to distribute copies of free software (and charge for
26 | them if you wish), that you receive source code or can get it if you
27 | want it, that you can change the software or use pieces of it in new
28 | free programs, and that you know you can do these things.
29 |
30 | To protect your rights, we need to prevent others from denying you
31 | these rights or asking you to surrender the rights. Therefore, you have
32 | certain responsibilities if you distribute copies of the software, or if
33 | you modify it: responsibilities to respect the freedom of others.
34 |
35 | For example, if you distribute copies of such a program, whether
36 | gratis or for a fee, you must pass on to the recipients the same
37 | freedoms that you received. You must make sure that they, too, receive
38 | or can get the source code. And you must show them these terms so they
39 | know their rights.
40 |
41 | Developers that use the GNU GPL protect your rights with two steps:
42 | (1) assert copyright on the software, and (2) offer you this License
43 | giving you legal permission to copy, distribute and/or modify it.
44 |
45 | For the developers' and authors' protection, the GPL clearly explains
46 | that there is no warranty for this free software. For both users' and
47 | authors' sake, the GPL requires that modified versions be marked as
48 | changed, so that their problems will not be attributed erroneously to
49 | authors of previous versions.
50 |
51 | Some devices are designed to deny users access to install or run
52 | modified versions of the software inside them, although the manufacturer
53 | can do so. This is fundamentally incompatible with the aim of
54 | protecting users' freedom to change the software. The systematic
55 | pattern of such abuse occurs in the area of products for individuals to
56 | use, which is precisely where it is most unacceptable. Therefore, we
57 | have designed this version of the GPL to prohibit the practice for those
58 | products. If such problems arise substantially in other domains, we
59 | stand ready to extend this provision to those domains in future versions
60 | of the GPL, as needed to protect the freedom of users.
61 |
62 | Finally, every program is threatened constantly by software patents.
63 | States should not allow patents to restrict development and use of
64 | software on general-purpose computers, but in those that do, we wish to
65 | avoid the special danger that patents applied to a free program could
66 | make it effectively proprietary. To prevent this, the GPL assures that
67 | patents cannot be used to render the program non-free.
68 |
69 | The precise terms and conditions for copying, distribution and
70 | modification follow.
71 |
72 | TERMS AND CONDITIONS
73 |
74 | 0. Definitions.
75 |
76 | "This License" refers to version 3 of the GNU General Public License.
77 |
78 | "Copyright" also means copyright-like laws that apply to other kinds of
79 | works, such as semiconductor masks.
80 |
81 | "The Program" refers to any copyrightable work licensed under this
82 | License. Each licensee is addressed as "you". "Licensees" and
83 | "recipients" may be individuals or organizations.
84 |
85 | To "modify" a work means to copy from or adapt all or part of the work
86 | in a fashion requiring copyright permission, other than the making of an
87 | exact copy. The resulting work is called a "modified version" of the
88 | earlier work or a work "based on" the earlier work.
89 |
90 | A "covered work" means either the unmodified Program or a work based
91 | on the Program.
92 |
93 | To "propagate" a work means to do anything with it that, without
94 | permission, would make you directly or secondarily liable for
95 | infringement under applicable copyright law, except executing it on a
96 | computer or modifying a private copy. Propagation includes copying,
97 | distribution (with or without modification), making available to the
98 | public, and in some countries other activities as well.
99 |
100 | To "convey" a work means any kind of propagation that enables other
101 | parties to make or receive copies. Mere interaction with a user through
102 | a computer network, with no transfer of a copy, is not conveying.
103 |
104 | An interactive user interface displays "Appropriate Legal Notices"
105 | to the extent that it includes a convenient and prominently visible
106 | feature that (1) displays an appropriate copyright notice, and (2)
107 | tells the user that there is no warranty for the work (except to the
108 | extent that warranties are provided), that licensees may convey the
109 | work under this License, and how to view a copy of this License. If
110 | the interface presents a list of user commands or options, such as a
111 | menu, a prominent item in the list meets this criterion.
112 |
113 | 1. Source Code.
114 |
115 | The "source code" for a work means the preferred form of the work
116 | for making modifications to it. "Object code" means any non-source
117 | form of a work.
118 |
119 | A "Standard Interface" means an interface that either is an official
120 | standard defined by a recognized standards body, or, in the case of
121 | interfaces specified for a particular programming language, one that
122 | is widely used among developers working in that language.
123 |
124 | The "System Libraries" of an executable work include anything, other
125 | than the work as a whole, that (a) is included in the normal form of
126 | packaging a Major Component, but which is not part of that Major
127 | Component, and (b) serves only to enable use of the work with that
128 | Major Component, or to implement a Standard Interface for which an
129 | implementation is available to the public in source code form. A
130 | "Major Component", in this context, means a major essential component
131 | (kernel, window system, and so on) of the specific operating system
132 | (if any) on which the executable work runs, or a compiler used to
133 | produce the work, or an object code interpreter used to run it.
134 |
135 | The "Corresponding Source" for a work in object code form means all
136 | the source code needed to generate, install, and (for an executable
137 | work) run the object code and to modify the work, including scripts to
138 | control those activities. However, it does not include the work's
139 | System Libraries, or general-purpose tools or generally available free
140 | programs which are used unmodified in performing those activities but
141 | which are not part of the work. For example, Corresponding Source
142 | includes interface definition files associated with source files for
143 | the work, and the source code for shared libraries and dynamically
144 | linked subprograms that the work is specifically designed to require,
145 | such as by intimate data communication or control flow between those
146 | subprograms and other parts of the work.
147 |
148 | The Corresponding Source need not include anything that users
149 | can regenerate automatically from other parts of the Corresponding
150 | Source.
151 |
152 | The Corresponding Source for a work in source code form is that
153 | same work.
154 |
155 | 2. Basic Permissions.
156 |
157 | All rights granted under this License are granted for the term of
158 | copyright on the Program, and are irrevocable provided the stated
159 | conditions are met. This License explicitly affirms your unlimited
160 | permission to run the unmodified Program. The output from running a
161 | covered work is covered by this License only if the output, given its
162 | content, constitutes a covered work. This License acknowledges your
163 | rights of fair use or other equivalent, as provided by copyright law.
164 |
165 | You may make, run and propagate covered works that you do not
166 | convey, without conditions so long as your license otherwise remains
167 | in force. You may convey covered works to others for the sole purpose
168 | of having them make modifications exclusively for you, or provide you
169 | with facilities for running those works, provided that you comply with
170 | the terms of this License in conveying all material for which you do
171 | not control copyright. Those thus making or running the covered works
172 | for you must do so exclusively on your behalf, under your direction
173 | and control, on terms that prohibit them from making any copies of
174 | your copyrighted material outside their relationship with you.
175 |
176 | Conveying under any other circumstances is permitted solely under
177 | the conditions stated below. Sublicensing is not allowed; section 10
178 | makes it unnecessary.
179 |
180 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
181 |
182 | No covered work shall be deemed part of an effective technological
183 | measure under any applicable law fulfilling obligations under article
184 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
185 | similar laws prohibiting or restricting circumvention of such
186 | measures.
187 |
188 | When you convey a covered work, you waive any legal power to forbid
189 | circumvention of technological measures to the extent such circumvention
190 | is effected by exercising rights under this License with respect to
191 | the covered work, and you disclaim any intention to limit operation or
192 | modification of the work as a means of enforcing, against the work's
193 | users, your or third parties' legal rights to forbid circumvention of
194 | technological measures.
195 |
196 | 4. Conveying Verbatim Copies.
197 |
198 | You may convey verbatim copies of the Program's source code as you
199 | receive it, in any medium, provided that you conspicuously and
200 | appropriately publish on each copy an appropriate copyright notice;
201 | keep intact all notices stating that this License and any
202 | non-permissive terms added in accord with section 7 apply to the code;
203 | keep intact all notices of the absence of any warranty; and give all
204 | recipients a copy of this License along with the Program.
205 |
206 | You may charge any price or no price for each copy that you convey,
207 | and you may offer support or warranty protection for a fee.
208 |
209 | 5. Conveying Modified Source Versions.
210 |
211 | You may convey a work based on the Program, or the modifications to
212 | produce it from the Program, in the form of source code under the
213 | terms of section 4, provided that you also meet all of these conditions:
214 |
215 | a) The work must carry prominent notices stating that you modified
216 | it, and giving a relevant date.
217 |
218 | b) The work must carry prominent notices stating that it is
219 | released under this License and any conditions added under section
220 | 7. This requirement modifies the requirement in section 4 to
221 | "keep intact all notices".
222 |
223 | c) You must license the entire work, as a whole, under this
224 | License to anyone who comes into possession of a copy. This
225 | License will therefore apply, along with any applicable section 7
226 | additional terms, to the whole of the work, and all its parts,
227 | regardless of how they are packaged. This License gives no
228 | permission to license the work in any other way, but it does not
229 | invalidate such permission if you have separately received it.
230 |
231 | d) If the work has interactive user interfaces, each must display
232 | Appropriate Legal Notices; however, if the Program has interactive
233 | interfaces that do not display Appropriate Legal Notices, your
234 | work need not make them do so.
235 |
236 | A compilation of a covered work with other separate and independent
237 | works, which are not by their nature extensions of the covered work,
238 | and which are not combined with it such as to form a larger program,
239 | in or on a volume of a storage or distribution medium, is called an
240 | "aggregate" if the compilation and its resulting copyright are not
241 | used to limit the access or legal rights of the compilation's users
242 | beyond what the individual works permit. Inclusion of a covered work
243 | in an aggregate does not cause this License to apply to the other
244 | parts of the aggregate.
245 |
246 | 6. Conveying Non-Source Forms.
247 |
248 | You may convey a covered work in object code form under the terms
249 | of sections 4 and 5, provided that you also convey the
250 | machine-readable Corresponding Source under the terms of this License,
251 | in one of these ways:
252 |
253 | a) Convey the object code in, or embodied in, a physical product
254 | (including a physical distribution medium), accompanied by the
255 | Corresponding Source fixed on a durable physical medium
256 | customarily used for software interchange.
257 |
258 | b) Convey the object code in, or embodied in, a physical product
259 | (including a physical distribution medium), accompanied by a
260 | written offer, valid for at least three years and valid for as
261 | long as you offer spare parts or customer support for that product
262 | model, to give anyone who possesses the object code either (1) a
263 | copy of the Corresponding Source for all the software in the
264 | product that is covered by this License, on a durable physical
265 | medium customarily used for software interchange, for a price no
266 | more than your reasonable cost of physically performing this
267 | conveying of source, or (2) access to copy the
268 | Corresponding Source from a network server at no charge.
269 |
270 | c) Convey individual copies of the object code with a copy of the
271 | written offer to provide the Corresponding Source. This
272 | alternative is allowed only occasionally and noncommercially, and
273 | only if you received the object code with such an offer, in accord
274 | with subsection 6b.
275 |
276 | d) Convey the object code by offering access from a designated
277 | place (gratis or for a charge), and offer equivalent access to the
278 | Corresponding Source in the same way through the same place at no
279 | further charge. You need not require recipients to copy the
280 | Corresponding Source along with the object code. If the place to
281 | copy the object code is a network server, the Corresponding Source
282 | may be on a different server (operated by you or a third party)
283 | that supports equivalent copying facilities, provided you maintain
284 | clear directions next to the object code saying where to find the
285 | Corresponding Source. Regardless of what server hosts the
286 | Corresponding Source, you remain obligated to ensure that it is
287 | available for as long as needed to satisfy these requirements.
288 |
289 | e) Convey the object code using peer-to-peer transmission, provided
290 | you inform other peers where the object code and Corresponding
291 | Source of the work are being offered to the general public at no
292 | charge under subsection 6d.
293 |
294 | A separable portion of the object code, whose source code is excluded
295 | from the Corresponding Source as a System Library, need not be
296 | included in conveying the object code work.
297 |
298 | A "User Product" is either (1) a "consumer product", which means any
299 | tangible personal property which is normally used for personal, family,
300 | or household purposes, or (2) anything designed or sold for incorporation
301 | into a dwelling. In determining whether a product is a consumer product,
302 | doubtful cases shall be resolved in favor of coverage. For a particular
303 | product received by a particular user, "normally used" refers to a
304 | typical or common use of that class of product, regardless of the status
305 | of the particular user or of the way in which the particular user
306 | actually uses, or expects or is expected to use, the product. A product
307 | is a consumer product regardless of whether the product has substantial
308 | commercial, industrial or non-consumer uses, unless such uses represent
309 | the only significant mode of use of the product.
310 |
311 | "Installation Information" for a User Product means any methods,
312 | procedures, authorization keys, or other information required to install
313 | and execute modified versions of a covered work in that User Product from
314 | a modified version of its Corresponding Source. The information must
315 | suffice to ensure that the continued functioning of the modified object
316 | code is in no case prevented or interfered with solely because
317 | modification has been made.
318 |
319 | If you convey an object code work under this section in, or with, or
320 | specifically for use in, a User Product, and the conveying occurs as
321 | part of a transaction in which the right of possession and use of the
322 | User Product is transferred to the recipient in perpetuity or for a
323 | fixed term (regardless of how the transaction is characterized), the
324 | Corresponding Source conveyed under this section must be accompanied
325 | by the Installation Information. But this requirement does not apply
326 | if neither you nor any third party retains the ability to install
327 | modified object code on the User Product (for example, the work has
328 | been installed in ROM).
329 |
330 | The requirement to provide Installation Information does not include a
331 | requirement to continue to provide support service, warranty, or updates
332 | for a work that has been modified or installed by the recipient, or for
333 | the User Product in which it has been modified or installed. Access to a
334 | network may be denied when the modification itself materially and
335 | adversely affects the operation of the network or violates the rules and
336 | protocols for communication across the network.
337 |
338 | Corresponding Source conveyed, and Installation Information provided,
339 | in accord with this section must be in a format that is publicly
340 | documented (and with an implementation available to the public in
341 | source code form), and must require no special password or key for
342 | unpacking, reading or copying.
343 |
344 | 7. Additional Terms.
345 |
346 | "Additional permissions" are terms that supplement the terms of this
347 | License by making exceptions from one or more of its conditions.
348 | Additional permissions that are applicable to the entire Program shall
349 | be treated as though they were included in this License, to the extent
350 | that they are valid under applicable law. If additional permissions
351 | apply only to part of the Program, that part may be used separately
352 | under those permissions, but the entire Program remains governed by
353 | this License without regard to the additional permissions.
354 |
355 | When you convey a copy of a covered work, you may at your option
356 | remove any additional permissions from that copy, or from any part of
357 | it. (Additional permissions may be written to require their own
358 | removal in certain cases when you modify the work.) You may place
359 | additional permissions on material, added by you to a covered work,
360 | for which you have or can give appropriate copyright permission.
361 |
362 | Notwithstanding any other provision of this License, for material you
363 | add to a covered work, you may (if authorized by the copyright holders of
364 | that material) supplement the terms of this License with terms:
365 |
366 | a) Disclaiming warranty or limiting liability differently from the
367 | terms of sections 15 and 16 of this License; or
368 |
369 | b) Requiring preservation of specified reasonable legal notices or
370 | author attributions in that material or in the Appropriate Legal
371 | Notices displayed by works containing it; or
372 |
373 | c) Prohibiting misrepresentation of the origin of that material, or
374 | requiring that modified versions of such material be marked in
375 | reasonable ways as different from the original version; or
376 |
377 | d) Limiting the use for publicity purposes of names of licensors or
378 | authors of the material; or
379 |
380 | e) Declining to grant rights under trademark law for use of some
381 | trade names, trademarks, or service marks; or
382 |
383 | f) Requiring indemnification of licensors and authors of that
384 | material by anyone who conveys the material (or modified versions of
385 | it) with contractual assumptions of liability to the recipient, for
386 | any liability that these contractual assumptions directly impose on
387 | those licensors and authors.
388 |
389 | All other non-permissive additional terms are considered "further
390 | restrictions" within the meaning of section 10. If the Program as you
391 | received it, or any part of it, contains a notice stating that it is
392 | governed by this License along with a term that is a further
393 | restriction, you may remove that term. If a license document contains
394 | a further restriction but permits relicensing or conveying under this
395 | License, you may add to a covered work material governed by the terms
396 | of that license document, provided that the further restriction does
397 | not survive such relicensing or conveying.
398 |
399 | If you add terms to a covered work in accord with this section, you
400 | must place, in the relevant source files, a statement of the
401 | additional terms that apply to those files, or a notice indicating
402 | where to find the applicable terms.
403 |
404 | Additional terms, permissive or non-permissive, may be stated in the
405 | form of a separately written license, or stated as exceptions;
406 | the above requirements apply either way.
407 |
408 | 8. Termination.
409 |
410 | You may not propagate or modify a covered work except as expressly
411 | provided under this License. Any attempt otherwise to propagate or
412 | modify it is void, and will automatically terminate your rights under
413 | this License (including any patent licenses granted under the third
414 | paragraph of section 11).
415 |
416 | However, if you cease all violation of this License, then your
417 | license from a particular copyright holder is reinstated (a)
418 | provisionally, unless and until the copyright holder explicitly and
419 | finally terminates your license, and (b) permanently, if the copyright
420 | holder fails to notify you of the violation by some reasonable means
421 | prior to 60 days after the cessation.
422 |
423 | Moreover, your license from a particular copyright holder is
424 | reinstated permanently if the copyright holder notifies you of the
425 | violation by some reasonable means, this is the first time you have
426 | received notice of violation of this License (for any work) from that
427 | copyright holder, and you cure the violation prior to 30 days after
428 | your receipt of the notice.
429 |
430 | Termination of your rights under this section does not terminate the
431 | licenses of parties who have received copies or rights from you under
432 | this License. If your rights have been terminated and not permanently
433 | reinstated, you do not qualify to receive new licenses for the same
434 | material under section 10.
435 |
436 | 9. Acceptance Not Required for Having Copies.
437 |
438 | You are not required to accept this License in order to receive or
439 | run a copy of the Program. Ancillary propagation of a covered work
440 | occurring solely as a consequence of using peer-to-peer transmission
441 | to receive a copy likewise does not require acceptance. However,
442 | nothing other than this License grants you permission to propagate or
443 | modify any covered work. These actions infringe copyright if you do
444 | not accept this License. Therefore, by modifying or propagating a
445 | covered work, you indicate your acceptance of this License to do so.
446 |
447 | 10. Automatic Licensing of Downstream Recipients.
448 |
449 | Each time you convey a covered work, the recipient automatically
450 | receives a license from the original licensors, to run, modify and
451 | propagate that work, subject to this License. You are not responsible
452 | for enforcing compliance by third parties with this License.
453 |
454 | An "entity transaction" is a transaction transferring control of an
455 | organization, or substantially all assets of one, or subdividing an
456 | organization, or merging organizations. If propagation of a covered
457 | work results from an entity transaction, each party to that
458 | transaction who receives a copy of the work also receives whatever
459 | licenses to the work the party's predecessor in interest had or could
460 | give under the previous paragraph, plus a right to possession of the
461 | Corresponding Source of the work from the predecessor in interest, if
462 | the predecessor has it or can get it with reasonable efforts.
463 |
464 | You may not impose any further restrictions on the exercise of the
465 | rights granted or affirmed under this License. For example, you may
466 | not impose a license fee, royalty, or other charge for exercise of
467 | rights granted under this License, and you may not initiate litigation
468 | (including a cross-claim or counterclaim in a lawsuit) alleging that
469 | any patent claim is infringed by making, using, selling, offering for
470 | sale, or importing the Program or any portion of it.
471 |
472 | 11. Patents.
473 |
474 | A "contributor" is a copyright holder who authorizes use under this
475 | License of the Program or a work on which the Program is based. The
476 | work thus licensed is called the contributor's "contributor version".
477 |
478 | A contributor's "essential patent claims" are all patent claims
479 | owned or controlled by the contributor, whether already acquired or
480 | hereafter acquired, that would be infringed by some manner, permitted
481 | by this License, of making, using, or selling its contributor version,
482 | but do not include claims that would be infringed only as a
483 | consequence of further modification of the contributor version. For
484 | purposes of this definition, "control" includes the right to grant
485 | patent sublicenses in a manner consistent with the requirements of
486 | this License.
487 |
488 | Each contributor grants you a non-exclusive, worldwide, royalty-free
489 | patent license under the contributor's essential patent claims, to
490 | make, use, sell, offer for sale, import and otherwise run, modify and
491 | propagate the contents of its contributor version.
492 |
493 | In the following three paragraphs, a "patent license" is any express
494 | agreement or commitment, however denominated, not to enforce a patent
495 | (such as an express permission to practice a patent or covenant not to
496 | sue for patent infringement). To "grant" such a patent license to a
497 | party means to make such an agreement or commitment not to enforce a
498 | patent against the party.
499 |
500 | If you convey a covered work, knowingly relying on a patent license,
501 | and the Corresponding Source of the work is not available for anyone
502 | to copy, free of charge and under the terms of this License, through a
503 | publicly available network server or other readily accessible means,
504 | then you must either (1) cause the Corresponding Source to be so
505 | available, or (2) arrange to deprive yourself of the benefit of the
506 | patent license for this particular work, or (3) arrange, in a manner
507 | consistent with the requirements of this License, to extend the patent
508 | license to downstream recipients. "Knowingly relying" means you have
509 | actual knowledge that, but for the patent license, your conveying the
510 | covered work in a country, or your recipient's use of the covered work
511 | in a country, would infringe one or more identifiable patents in that
512 | country that you have reason to believe are valid.
513 |
514 | If, pursuant to or in connection with a single transaction or
515 | arrangement, you convey, or propagate by procuring conveyance of, a
516 | covered work, and grant a patent license to some of the parties
517 | receiving the covered work authorizing them to use, propagate, modify
518 | or convey a specific copy of the covered work, then the patent license
519 | you grant is automatically extended to all recipients of the covered
520 | work and works based on it.
521 |
522 | A patent license is "discriminatory" if it does not include within
523 | the scope of its coverage, prohibits the exercise of, or is
524 | conditioned on the non-exercise of one or more of the rights that are
525 | specifically granted under this License. You may not convey a covered
526 | work if you are a party to an arrangement with a third party that is
527 | in the business of distributing software, under which you make payment
528 | to the third party based on the extent of your activity of conveying
529 | the work, and under which the third party grants, to any of the
530 | parties who would receive the covered work from you, a discriminatory
531 | patent license (a) in connection with copies of the covered work
532 | conveyed by you (or copies made from those copies), or (b) primarily
533 | for and in connection with specific products or compilations that
534 | contain the covered work, unless you entered into that arrangement,
535 | or that patent license was granted, prior to 28 March 2007.
536 |
537 | Nothing in this License shall be construed as excluding or limiting
538 | any implied license or other defenses to infringement that may
539 | otherwise be available to you under applicable patent law.
540 |
541 | 12. No Surrender of Others' Freedom.
542 |
543 | If conditions are imposed on you (whether by court order, agreement or
544 | otherwise) that contradict the conditions of this License, they do not
545 | excuse you from the conditions of this License. If you cannot convey a
546 | covered work so as to satisfy simultaneously your obligations under this
547 | License and any other pertinent obligations, then as a consequence you may
548 | not convey it at all. For example, if you agree to terms that obligate you
549 | to collect a royalty for further conveying from those to whom you convey
550 | the Program, the only way you could satisfy both those terms and this
551 | License would be to refrain entirely from conveying the Program.
552 |
553 | 13. Use with the GNU Affero General Public License.
554 |
555 | Notwithstanding any other provision of this License, you have
556 | permission to link or combine any covered work with a work licensed
557 | under version 3 of the GNU Affero General Public License into a single
558 | combined work, and to convey the resulting work. The terms of this
559 | License will continue to apply to the part which is the covered work,
560 | but the special requirements of the GNU Affero General Public License,
561 | section 13, concerning interaction through a network will apply to the
562 | combination as such.
563 |
564 | 14. Revised Versions of this License.
565 |
566 | The Free Software Foundation may publish revised and/or new versions of
567 | the GNU General Public License from time to time. Such new versions will
568 | be similar in spirit to the present version, but may differ in detail to
569 | address new problems or concerns.
570 |
571 | Each version is given a distinguishing version number. If the
572 | Program specifies that a certain numbered version of the GNU General
573 | Public License "or any later version" applies to it, you have the
574 | option of following the terms and conditions either of that numbered
575 | version or of any later version published by the Free Software
576 | Foundation. If the Program does not specify a version number of the
577 | GNU General Public License, you may choose any version ever published
578 | by the Free Software Foundation.
579 |
580 | If the Program specifies that a proxy can decide which future
581 | versions of the GNU General Public License can be used, that proxy's
582 | public statement of acceptance of a version permanently authorizes you
583 | to choose that version for the Program.
584 |
585 | Later license versions may give you additional or different
586 | permissions. However, no additional obligations are imposed on any
587 | author or copyright holder as a result of your choosing to follow a
588 | later version.
589 |
590 | 15. Disclaimer of Warranty.
591 |
592 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
593 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
594 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
595 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
596 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
597 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
598 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
599 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
600 |
601 | 16. Limitation of Liability.
602 |
603 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
604 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
605 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
606 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
607 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
608 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
609 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
610 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
611 | SUCH DAMAGES.
612 |
613 | 17. Interpretation of Sections 15 and 16.
614 |
615 | If the disclaimer of warranty and limitation of liability provided
616 | above cannot be given local legal effect according to their terms,
617 | reviewing courts shall apply local law that most closely approximates
618 | an absolute waiver of all civil liability in connection with the
619 | Program, unless a warranty or assumption of liability accompanies a
620 | copy of the Program in return for a fee.
621 |
622 | END OF TERMS AND CONDITIONS
623 |
624 | How to Apply These Terms to Your New Programs
625 |
626 | If you develop a new program, and you want it to be of the greatest
627 | possible use to the public, the best way to achieve this is to make it
628 | free software which everyone can redistribute and change under these terms.
629 |
630 | To do so, attach the following notices to the program. It is safest
631 | to attach them to the start of each source file to most effectively
632 | state the exclusion of warranty; and each file should have at least
633 | the "copyright" line and a pointer to where the full notice is found.
634 |
635 |
636 | Copyright (C)
637 |
638 | This program is free software: you can redistribute it and/or modify
639 | it under the terms of the GNU General Public License as published by
640 | the Free Software Foundation, either version 3 of the License, or
641 | (at your option) any later version.
642 |
643 | This program is distributed in the hope that it will be useful,
644 | but WITHOUT ANY WARRANTY; without even the implied warranty of
645 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
646 | GNU General Public License for more details.
647 |
648 | You should have received a copy of the GNU General Public License
649 | along with this program. If not, see .
650 |
651 | Also add information on how to contact you by electronic and paper mail.
652 |
653 | If the program does terminal interaction, make it output a short
654 | notice like this when it starts in an interactive mode:
655 |
656 | {project} Copyright (C) {year} {fullname}
657 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
658 | This is free software, and you are welcome to redistribute it
659 | under certain conditions; type `show c' for details.
660 |
661 | The hypothetical commands `show w' and `show c' should show the appropriate
662 | parts of the General Public License. Of course, your program's commands
663 | might be different; for a GUI interface, you would use an "about box".
664 |
665 | You should also get your employer (if you work as a programmer) or school,
666 | if any, to sign a "copyright disclaimer" for the program, if necessary.
667 | For more information on this, and how to apply and follow the GNU GPL, see
668 | .
669 |
670 | The GNU General Public License does not permit incorporating your program
671 | into proprietary programs. If your program is a subroutine library, you
672 | may consider it more useful to permit linking proprietary applications with
673 | the library. If this is what you want to do, use the GNU Lesser General
674 | Public License instead of this License. But first, please read
675 | .
676 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ATX Switch
2 |
3 | ## Control ATX capability of multiple systems from PiKVM host
4 |
5 | An extension unit to a [PiKVM](https://github.com/pikvm/pikvm) based controller that enables the WebUI based ATX controls (PWR button; Reset button; HDD LED and PWR LED) to be switched between the physical ATX headers, and their associated case controls, on different PC / Server motherboards.
6 |
7 | Supports the control of multiple ATX-enabled endpoint devices, in conjunction with a KVM switch, from a single PiKVM unit.
8 |
9 | >[!NOTE]
10 | >An interface adaptor has now been produced that enables PiKVM v3 and v4 Plus devices to be connected to, and manage, an ATX Switch environment
11 |
12 |
13 |
14 |
15 | |  |  |
16 | | ------------------------------------------------------------ | ------------------------------------------------------------ |
17 |
18 |
19 |
20 | ## Features
21 |
22 | - $\color{green}{\textsf{Low cost}}$ / **self-assembly**
23 |
24 | - 4-port and 8-port units can be built
25 | - [Board / case designs available](https://github.com/techlobo/ATX_Switch/tree/main/ATX_Switches)
26 |
27 | - I2C addressable (user selectable between 0x20 – 0x27)
28 |
29 | - Daisy chainable (theoretically up to 8 units / 64 ports)
30 |
31 | - Fully isolated
32 |
33 | - Compatible with PiKVM assigned ATX GPIO pins
34 |
35 | - Port selection controls available in WebUI (configurable via override.yaml)
36 |
37 | - ATX operations use standard PiKVM WebUI interface
38 |
39 | - Potential for ATX operations to be performed via I2C rather than GPIO (**not implemented yet**)
40 |
41 | - Compatible with existing PiKVM based ATX adapter boards that are installed inside managed PC / workstation / server
42 | - Design available to build own [affordable ATX adapter board](https://github.com/techlobo/ATX_Switch/tree/main/ATX_Adapter_board)
43 |
44 | - ATX Switch input port not compatible with existing v3 / v4 PiKVM hardware designs of ATX port due to requirement for providing control and power lines. Therefore cannot directly connect commercial PiKVM unit to ATX Switch. Two build approaches available:
45 | - [Low-cost DIY design](https://github.com/techlobo/ATX_Switch/tree/main/DIY_PiKVM) available based on v3 Box build (**self-assembly**)
46 |
47 | - 👀 Limited to 1080P @50Hz 👀
48 |
49 |
50 |
51 |
52 |
53 | - $\color{green}{\textsf{New addition}}$ - [ATX Switch Interface adaptor](./ATX_Switch_Interface_adaptor/README.md) (**self assembly**) enables connection between v2 / v3 / v4+ devices and ATX Switch environment.
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 | ## Typical deployments
62 |
63 | ##### $\color{purple}{\textsf{DIY PiKVM - most cost effective for home lab environments}}$
64 |
65 | 
66 |
67 |
68 |
69 | ##### $\color{purple}{\textsf{Commercial PiKVM environments}}$
70 |
71 | 
72 |
73 | ## Background
74 |
75 | As PiKVM usage was developing, more users were wanting to extend its functionality to support multiple end-devices from a single PiKVM controller. This led to experimentation regarding the use of HDMI KVM switches to enable multiplexing of input / output streams between the devices.
76 |
77 | This work by the community has led to a greater understanding of which HDMI KVM switches work best with PiKVM, and how to configure them. Some of this information has been [documented](https://docs.pikvm.org/multiport/) on the PiKVM site, whilst other information is available in the PiKVM discord server and various articles online.
78 |
79 | However these approaches did not address one of the key capabilities of the PiKVM when used in a multi-device scenario - the ability to switch on / off the remote device, and to a lesser extent a visual confirmation of its power and HDD status.
80 |
81 | I had just restarted an interest in hobby electronics and wanted an affordable solution for managing my home server environment, so decided that this would be a good first project.
82 |
83 | I originally considered the construction of discrete '*intelligent*' controllers, using ESP32 (or similar) MCU's connected to the PiKVM via a bus based approach (e.g. Modbus, CANbus, MQTT). It was interesting testing these approaches out whilst determining how to: **design / build them** (e.g. component selection, PCB design, enclosure design); **deploy them** (e.g. where / how to install them, how to power them, how to communicate with them); and **manage them** (e.g. configuration / debug / maintenance).
84 |
85 | I learnt a lot during this exercise, but finally concluded that the approaches I was considering were more complicated than necessary, and that a simpler / more robust / cheaper solution could be produced just using devices based on discrete components connected directly to the PiKVM controller - hence the ATX Switches!
86 |
87 | ## Operation
88 |
89 | When correctly configured, operation of the ATX Switch(es) is undertaken within the PiKVM WebUI. The means of this operation depends on how the system has been set up (see installation instructions).
90 |
91 | ### Managed device selection
92 |
93 | This is performed within the **Source** menu option by either:
94 |
95 | - activating the associated ATX(x) button, OR
96 | - activating the associated Input(x) button if HDMI KVM switch integration has been performed.
97 |
98 | The selected port on the ATX Switch being indicated on the associated menu LED.
99 |
100 |
101 |
102 |
103 |
104 |
105 | The video below gives a brief demonstration of the above activations, initially by using the ATXn selector buttons to switch between the managed devices - the associated LED (within the Source menu) changing to confirm selection complete. You can also see that the ATX menu LED icons change to indicate the status of the selected device (with ATX1 being powered off). The second part of the video shows selection of the target device using the Source menu 'Select' buttons which are mapped to the attached HDMI KVM switch. Observe how the selection of the KVM target causes the ATX Switch to be moved to the associated ATX interface.
106 |
107 |
108 |
109 |
110 | https://github.com/techlobo/ATX_Switch/assets/95144096/9a94704d-ef98-44f7-9990-24d5c0a44960
111 |
112 |
113 |
114 | ### ATX Functionality (via GPIO)
115 |
116 | This is performed via the ATX menu in the WebUI, with the Power LED and HDD LED status for the selected device being indicated in the menu bar (*Note - this is all standard PiKVM functionality when GPIO controls are being used*).
117 |
118 | The video below again shows the target device being selected from the Source Select buttons, but in this case the target device (4) is powered down. The completion of the LED representations in the Source menu shows that the 4th HDMI KVM port was selected alongside the ATX Switch 4th port. It can also be seen from the ATX menu that the status indications for Power and HDD are blank. On using the standard PiKVM ATX functionality to power on the target device it can be seen that the activity indicators start to operate, and the boot process is observed.
119 |
120 |
121 |
122 |
123 | https://github.com/techlobo/ATX_Switch/assets/95144096/6d380cd4-e1c7-4d97-97c2-12fe709a398f
124 |
125 |
126 | The presentation of the Source menu is down to personal preference (as defined in the override.yaml file). It is not necessary to provide the ATX selection buttons, or indeed the selected ATX LEDs, if you are happy with just using one set of selection buttons, and having one set of 'selected' LEDs. Personally I prefer to show both sets of LEDs.
127 |
128 |
129 |
130 | ## Rough Costs
131 |
132 | My approximate material costs for the final pieces of this project (not including IC sockets) were as shown below, on a pro-rata basis:
133 |
134 | | Item | Rough cost - own case (£) | Rough cost - buy case (£) |
135 | | -------------------- | :-----------------------------: | :-----------------------: |
136 | | ATX Adapter board | $\color{green}{\textsf{3.00}}$ | N/A |
137 | | ATX Switch 4 | $\color{green}{\textsf{19.00}}$ | 39.00 |
138 | | ATX Switch 8 | $\color{green}{\textsf{27.00}}$ | 51.00 |
139 | | DIY PiKVM | $\color{green}{\textsf{97.70}}$ | 119.70 |
140 | | ATX Switch Interface | $\color{green}{\textsf{7.50}}$ | 26.00 |
141 |
142 | >[!NOTE]
143 | >The costs are based on the use of optocouplers for the ATX Switches. If SSRs were to be used then add at least an additional £10 to the cost of a 4-port, and £20 to an 8-port device.
144 |
145 | A bit more detail is provided [here](./Rough_costs/README.md).
146 |
147 | Some further savings can be made (e.g. cheaper fan, no fan at all, use of dupont cable rather than motherboard switch extender,....) but these are what I went with.
148 |
149 |
150 |
151 | ## Credits
152 |
153 | None of the above would work without the amazing efforts of the developers of [PiKVM](https://pikvm.org/), and their support of the [Open Source community](https://github.com/pikvm). Hats off to them!
154 |
155 |
156 |
157 | ## Summary & Disclaimer
158 |
159 | This is a synopsis of my adventures in this area while setting up management on my home lab environment. It works for me, but there are no guarantees it will for you. I've documented this primarily for my own benefit, including getting some idea of how Github and Markdown works. However, if you want to try something similar then please feel free to use any (*or none*) of the above material - $\color{red}{\textsf{at your own risk...!}}$
160 |
--------------------------------------------------------------------------------
/Rough_costs/README.md:
--------------------------------------------------------------------------------
1 | # Rough costs
2 |
3 | A breakdown of the costs is provided in the [Rough_Costs PDF](./rough_costs.pdf) file.
4 |
5 | >[!NOTE]
6 | >**No labour costs (e.g. purchasing / soldering / construction / testing) are taken into account** - this work was undertaken on a hobby basis.
7 |
8 | >[!TIP]
9 | >If you have access to your own 3D printing capability then the cost of the cases will be limited to the cost of material. I use the facilities within my local Makerspace / Man Shed, so **my costs were minimal** and I could ensure the quality produced.
10 |
11 | The cost of the cases provided is a rough figure from running the .STEP files through [Craftcloud 3D printing services](https://craftcloud3d.com/) and going with the cheapest option - I can't say what the quality of these will be!
12 |
13 | All components were purchased for the best price available, taking account of any approaches to reducing / removing shipping costs (minimum order level, longer delivery times, etc.). The majority of the passive components, and a few of the active ones, were purchased from Aliexpress.
14 |
15 | All prices are done on a pro-rata basis - e.g. 1-port RJ45 connectors are used in more than one item and therefore a bundle of 20x 1-port RJ45 connectors was purchased, however only a cost of 1/20th was allocated against the above costs (where an item required it). This could mean that there is spare stock for other items / projects.
16 |
17 | Most purchases were done throughout 2023, so will probably have increased by now.
18 |
19 | You will also need to provide power supplies / cables (Network / USB / HDMI) / etc. as required.
--------------------------------------------------------------------------------
/Rough_costs/rough_costs.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/techlobo/ATX_Switch/8089bb9979625b7536163167f4cac48dea067fbc/Rough_costs/rough_costs.pdf
--------------------------------------------------------------------------------