DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
tdemodules
scripts
tde_amc_reboot.py
Go to the documentation of this file.
1
#!/usr/bin/env python3
2
"""
3
Created on: 16/10/2025 18:27
4
5
Author: Shyam Bhuller
6
7
Description: Script to reboot AMCs from a TDE crate.
8
"""
9
import
os
10
import
time
11
import
click
12
13
def
card_slot
(slotnum : int):
14
return
"0x%x"
% (0x70+0x2*slotnum)
15
16
17
def
reboot
(mch_ip : str, slot_xp : str):
18
icmd = f
"ipmitool -v -I lan -H {mch_ip} -U root -P root -T 0x82 -B0 -b7"
19
icard = icmd + f
" -t {slot_xp} raw 0x2E 0x03 0x00 0x00 0x60"
20
21
#? Do we ever need to use select_dune_fw and disable_flash_access?
22
cmds = {
23
"select_dune_fw"
:
" 0x40 0x40"
,
24
"reconfigure"
:
" 0x8 0x8"
,
25
"disable_flash_access"
:
" 0x1 0x1"
,
26
"reboot"
:
" 0x8 0x0"
,
27
}
28
29
for
c
in
(cmds[
"reconfigure"
], cmds[
"reboot"
]):
30
cmd = icard + c
31
print(cmd)
32
os.system(cmd)
33
time.sleep(1)
# could make a configurable delay
34
return
35
36
37
@click.command()
38
@click.argument('crate_ip', type=str)
39
@click.option('-s', '--slots', type=int, multiple=True, default=[i for i in range(1,13)
])
40
def
main
(crate_ip : int, slots : list[int]):
41
print(f
"boot cards in slots {slots} in crate at {crate_ip}"
)
42
43
for
s
in
slots:
44
reboot
(crate_ip,
card_slot
(s))
45
return
46
47
48
if
__name__==
'__main__'
:
49
main
()
tde_amc_reboot.card_slot
card_slot(int slotnum)
Definition
tde_amc_reboot.py:13
tde_amc_reboot.reboot
reboot(str mch_ip, str slot_xp)
Definition
tde_amc_reboot.py:17
tde_amc_reboot.main
main(int crate_ip, list[int] slots)
Definition
tde_amc_reboot.py:40
Generated on
for DUNE-DAQ by
1.17.0