iRiser API
Riser
This is the highest level of API for interacting with the iRiser.
- class Riser(slot)
iRiser object. Contains relevant attributes for understanding the current state of the riser.
- Parameters:
slot (int) – iRiser slot number. Valid values are 0 - 18 on a ‘RM’ and 0-4 on ‘DT’
Example
>>> from iRiser import Riser >>> slot = 1 >>> r = Riser(1)
- collect_power_data(dir_name: str | None = None, power_devices=None, log=True)
Show the dma power information collected, available recordings or the devices available to record power consumption.
- Parameters:
dir_name – The directory name and power device are the same as those used to start the recording. If None: Determine available records to view
power_devices – If None, it will use all available power devices. 0 or 12Vp - EDSFF 12.0V 20bit AtoD (highest precision) (iRiser5+) 1 or 3.3Vp - EDSFF 3.3VAux 20bit AtoD (highest precision) (iRiser5+) 2 or 3.3Vpa - M.2 3.3V 20bit AtoD (highest precision) (iRiser5+) 3 or 1.8Vpa - M.2 1.8V 20bit AtoD (highest precision) (iRiser5+) 4 or 12V - EDSFF 12.0V 12bit (highest speed) iRiser5 (iRiser5) 5 or 3.3V - EDSFF 3.3VAux 12bit (highest speed) (iRiser5+) all - All devices which can be monitored based on configuration Note: E1.S and E1.L are form factors of EDSFF. (S = Short, L = Long, 1 is the 1u Server) Note: 0 and 1 are the precise measuring, while 4 and 5 are the speed measuring.
Example
This command shows the start and end time of the recording: Note: -J flag to set the output to JSON string iRiser -d <slot> show power <directoryName> <powerDevice> -J
- compare_power_available(power_devices: list, log=False)
Compare the power devices available/support 0 or 12Vp - EDSFF 12.0V 20bit AtoD (highest precision) (iRiser5+) 1 or 3.3Vp - EDSFF 3.3VAux 20bit AtoD (highest precision) (iRiser5+) 2 or 3.3Vpa - M.2 3.3V 20bit AtoD (highest precision) (iRiser5+) 3 or 1.8Vpa - M.2 1.8V 20bit AtoD (highest precision) (iRiser5+) 4 or 12V - EDSFF 12.0V 12bit (highest speed) iRiser5 (iRiser5) 5 or 3.3V - EDSFF 3.3VAux 12bit (highest speed) (iRiser5+)
- copy_action(num, dest)
Copy an action from an existing action number to a new action number
- edit_action(dest, dir, val, time, units, _next, log=True)
Edit an iRiser action
- get_action(raw=False, log=True)
The current action of the iRiser. If the device has just been initialized the action is None. Otherwise, valid actions are integers 0 to 127’
- Parameters:
raw (bool) – If set to True, returns an integer representing the current action. If set to false, returns the value in a status dictionary.
- Return type:
int or dict
Example
>>> from iRiser import Riser >>> r = Riser(1) >>> r.get_action() iRiser -d 1 status -J {'status': 0, 'action': ...} >>> r.get_action(raw=True) iRiser -d 1 status -J
- get_actions(raw=False, log=True) [<class 'sanblaze.system.iRiser.action.Action'>]
Get the actions currently programed on the gpio
- Returns:
status actions
- Return type:
dict
Example
>>> from iRiser import Riser >>> r = Riser(1) >>> r.get_actions() iRiser ...
- get_bits(raw=False, log=True) Bits
Get info about the signals on the current iRiser
- Returns:
signal names with their values
- Return type:
dict
Example
>>> from iRiser import Riser >>> r = Riser(1) >>> r.get_bits() iRiser ...
- get_gpio(log=True) dict
Return all information from a gpio query
- Return type:
dict
Example
>>> from iRiser import Riser >>> r = Riser(1) >>> r.get_gpio() iRiser -d 1 show gpio -J {'status': 0, 'bits': ... 'gpio': '0'}
- get_power(log=True, raw=False)
Get power measured by iRiser
- Return type:
dict
Example
>>> from iRiser import Riser >>> r = Riser(1) >>> r.get_power() iRiser -d 1 show power {'status': 0, 'power': ..., 'units': 'Watts'}
- get_power_available(log=True)
Get the available power devices. There’s 6 different ones, but each device usually has 2 available.
- get_sequence(raw=False)
The current sequence of the iRiser. If the device has just been initialized the sequence is None. Otherwise, valid sequences are integers 0 to 127’
- Parameters:
raw (bool) – If set to True, returns an integer representing the current sequence. If set to false, returns the value in a status dictionary.
- Return type:
int or dict
Example
>>> from iRiser import Riser >>> r = Riser(1) >>> r.get_sequence() iRiser -d ... status -J {'status': 0, 'sequence': ...} >>> r.get_sequence(raw=True) iRiser -d ... status -J >>>
- get_sequences(log=True, raw=False) [<class 'sanblaze.system.iRiser.sequence.Sequence'>]
Get the sequences currently programed on the gpio.
- Returns:
sequence objects
- Return type:
dict
Example
>>> from iRiser import Riser >>> r = Riser(1) >>> r.get_sequences() iRiser ...
- get_state(raw=False, log=True)
The current state of the iRiser. If the device has just been initialized the state is None. Otherwise, valid states are ‘stopped’, and ‘running’
- Parameters:
raw (bool) – If set to True, returns a string representing the state. If set to false, returns the value in a status dictionary.
log (bool) –
- Return type:
str or dict
Example
>>> from iRiser import Riser >>> r = Riser(1) >>> r.get_state() iRiser -d 1 status -J {'status': 0, 'state': 'stopped'} >>> r.get_state(raw=True) iRiser -d 1 status -J 'stopped' >>>
- get_status(log=True, raw=False)
The current status of the iRiser.
- Return type:
int or dict
Example
>>> from iRiser import Riser >>> r = Riser(1) >>> r.get_status() iRiser -d 1 status -J {'status': 0, 'sequencer': 'stopped', 'sequence': ...
- init(log=True) dict
Reset GPIO to default values, stop the sequencer and clear memory sequence.
Sets module back to initialized state, PCIe switches will be Closed, all signals will be in operational state
- Returns:
dict
Example
>>> from iRiser import Riser >>> r = Riser(1) >>> r.init() iRiser -d ... init {'status': 0, 'result': 'INFO: ...
- reset(log=True) dict
Stop the sequencer reset GPIO to defaults
- Returns:
dict
Example
>>> from iRiser import Riser >>> r = Riser(1) >>> r.reset() iRiser -d ... reset {'status': 0, 'result': 'INFO: ...
- show_power_data(dir_name, power_device, log=True, raw=False)
Need to query each power device individually. Result in MilliWatts
- start_collect_power(dir_name: str, samples: str, duration=None, count=None, power_devices=None, log=True)
Starts the DMA engine to collect power data Samples can be taken as fast as 1M samples/second
iRiser -d <slot> start power <recording> <0|12V> <samples> <duration>
- Parameters:
dir_name (str) – Name of the directory which will contain the recorded power measurements for the devices specified If it’s the same as a previous recording, it’ll overwrite the previous recording. Example: ‘testdirectory’
samples (str) – This is the sample rate, can be specified as an actual sample time (1mS, 100uS, 1s) Example: ‘10000us’ (100 samples per second)
duration (str) – time the monitoring will execute for. The value can be specified in seconds (i.e 5s), milliseconds (i.e 10ms) or microseconds (i.e. 600us) Example: ‘5s’
count (int) – The value corresponds to the number of records to collect
power_devices – If None, it will use all available power devices. 12Vp - EDSFF 12.0V 20bit AtoD (highest precision) (iRiser5+) 3.3Vp - EDSFF 3.3VAux 20bit AtoD (highest precision) (iRiser5+) 3.3Vpa - M.2 3.3V 20bit AtoD (highest precision) (iRiser5+) 1.8Vpa - M.2 1.8V 20bit AtoD (highest precision) (iRiser5+) 12V - EDSFF 12.0V 12bit (highest speed) iRiser5 (iRiser5) 3.3V - EDSFF 3.3VAux 12bit (highest speed) (iRiser5+) all - All devices which can be monitored based on configuration Note: E1.S and E1.L are form factors of EDSFF. (S = Short, L = Long, 1 is the 1u Server) Note: 12Vp and 3.3Vp are the precise measuring, while 12V and 3.3V are the speed measuring.
Example
iRiser -d <slot> start power <directoryName> <powerDevice> <sampleFrequency> <duration> iRiser -d 1 start power testcapture 12Vp,3.3Vp 10us 5000s
- start_sequence(num, log=True)
Start a sequence by sequence number
- Returns:
status
- Return type:
dict
- verify_service_status(log=True)
If ServiceRunning=1, it’s running. If ServiceRunning=0, Need to run the “systemctl start iriser” command in order to start the service