docs: readme update

This commit is contained in:
2025-12-08 16:10:54 +06:00
parent f4187f369d
commit 451d06619c
6 changed files with 1065 additions and 783 deletions

125
README.md
View File

@@ -2,6 +2,8 @@
A utility for encrypting, decrypting, and parsing Rigol DG[89]00 Pro Arbitrary Waveform Generator `setup.stp`.
HF flatness calibration example in [hfflat_cal.py](./hfflat_cal.py), thanks to zrq from EEVBlog.
## Command-Line Options
```sh
@@ -27,109 +29,144 @@ options:
### Prerequisites
1. Install ADB (Android Debug Bridge) on your system:
1. Install [Python 3](https://www.python.org/downloads/)
2. Install ADB (Android Debug Bridge) on your system:
- **Linux**: `sudo apt install adb` (or equivalent for your distribution)
- **Windows**: Download and install [Android Platform Tools](https://developer.android.com/studio/releases/platform-tools)
- **Linux**: `sudo apt install adb` (or equivalent for your distribution)
- **Windows**: Download and install [Android Platform Tools](https://developer.android.com/studio/releases/platform-tools)
2. Connect your Rigol AFG to your local network and note its IP address
3. Connect your Rigol AFG to your local network and note its IP address
### Extracting the Setup File
1. Connect to your device via ADB:
```
adb connect IP:55555
```
```sh
$ adb connect IP:55555
```
Replace `IP` with your device's IP address
Replace `IP` with your device's IP address
2. Pull the setup file from the device:
```
adb pull /rigol/data/setup.stp
```
```sh
$ adb pull /rigol/data/setup.stp
```
3. Read your CPU serial:
```
adb shell -- /rigol/shell/get_cpu_serial_num.sh
```
```sh
$ adb shell -- /rigol/shell/get_cpu_serial_num.sh
```
4. **IMPORTANT**: Create a backup of the original file:
```
cp setup.stp setup.stp.backup
```
```sh
$ cp setup.stp setup.stp.backup
```
### Modifying the Setup File
For reference, here's what DG922 setup file could look like after correct modification:
```sh
$ ./rigol_setup_crypter.py -p -f ../databackup/data/setup.stp.decrypted
CSV header:
Manufacturer,InstrModel,InstrSN,CalibrationDate,SineMaxFreq,SquareMaxFreq,RampMaxFreq,PulseMaxFreq,ArbMaxFreq,HarmonicMaxFreq,MinFreq,HarmonicMinFreq,ARMSerial,MaxChannels,ArbWaveLenLicense,ArbWaveLenValidTime,DuoChanChannelValidTime
RIGOL TECHNOLOGIES,DG922 Pro,DG8P123456789,2023-11-11,200000000000000,60000000000000,5000000000000,50000000000000,50000000000000,100000000000000,1,1000,4b97ef24e77c4aeb933b,2,MEM,Forever,Forever
Instrument Information:
Manufacturer: RIGOL TECHNOLOGIES
Model: DG922 Pro
Serial Number: DG8P123456789
Calibration Date: 2023-11-11
ARM CPU Serial: 4b97ef24e77c4aeb933b
Max Channels: 2
Frequency Specifications:
Sine Max Frequency: 200000000000000 (200.000000 MHz)
Square Max Frequency: 60000000000000 (60.000000 MHz)
Ramp Max Frequency: 5000000000000 (5.000000 MHz)
Pulse Max Frequency: 50000000000000 (50.000000 MHz)
Arb Max Frequency: 50000000000000 (50.000000 MHz)
Harmonic Max Frequency: 100000000000000 (100.000000 MHz)
Min Frequency: 1 (1.000000e-12 MHz)
Harmonic Min Frequency: 1000 (1.000000e-09 MHz)
Licensing Information:
Arb Wavelength License: MEM (Memory Depth License)
Arb Wavelength Valid Time: Forever (Active (No Expiration))
Duo Channel Valid Time: Forever (Active (No Expiration))
```
1. Decrypt the setup file:
```
python rigol_setup_crypter.py -d -f setup.stp -k YOUR_CPU_SERIAL -o setup.csv
```
```sh
$ python rigol_setup_crypter.py -d -f setup.stp -k YOUR_CPU_SERIAL -o setup.csv
```
Replace `YOUR_CPU_SERIAL` with your device's CPU serial number
Replace `YOUR_CPU_SERIAL` with your device's CPU serial number
2. Parse the file to better understand its structure:
```
python rigol_setup_crypter.py -p -f setup.csv
```
```sh
$ python rigol_setup_crypter.py -p -f setup.csv
```
3. Edit the CSV file using a text editor of your choice
4. Verify your changes by parsing again:
```
python rigol_setup_crypter.py -p -f setup.csv
```
```sh
$ python rigol_setup_crypter.py -p -f setup.csv
```
5. Encrypt the modified file:
```
python rigol_setup_crypter.py -e -f setup.csv -k YOUR_CPU_SERIAL -o setup.stp.new
```
```sh
$ python rigol_setup_crypter.py -e -f setup.csv -k YOUR_CPU_SERIAL -o setup.stp.new
```
### Uploading the Modified File
1. Push the modified file back to the device:
```
adb push setup.stp.new /rigol/data/setup.stp
```
```sh
$ adb push setup.stp.new /rigol/data/setup.stp
```
2. Restart your device to apply the changes
```
adb shell -- reboot
```
```sh
$ adb shell -- reboot
```
## Examples
### Decrypt a setup file
```
python rigol_setup_crypter.py -d -f setup.stp -k d95ebe35672e20c2fc08 -o decrypted.csv
```sh
$ python rigol_setup_crypter.py -d -f setup.stp -k d95ebe35672e20c2fc08 -o decrypted.csv
```
### Decrypt a text string and output to console
```
python rigol_setup_crypter.py -d -t "FBC6BDDB0E..." -k d95ebe35672e20c2fc08
```sh
$ python rigol_setup_crypter.py -d -t "FBC6BDDB0E..." -k d95ebe35672e20c2fc08
```
### Parse a decrypted CSV
```
python rigol_setup_crypter.py -p -f decrypted.csv
```sh
$ python rigol_setup_crypter.py -p -f decrypted.csv
```
### Encrypt a modified CSV
```
python rigol_setup_crypter.py -e -f modified.csv -k d95ebe35672e20c2fc08 -o new_setup.stp
````sh
$ python rigol_setup_crypter.py -e -f modified.csv -k d95ebe35672e20c2fc08 -o new_setup.stp
```
## Warning
Keep a backup of the original `setup.csv`.
````