remoterf-host-testing 0.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- remoterf_host_testing-0.0.0/MANIFEST.in +1 -0
- remoterf_host_testing-0.0.0/PKG-INFO +227 -0
- remoterf_host_testing-0.0.0/README.md +208 -0
- remoterf_host_testing-0.0.0/pyproject.toml +39 -0
- remoterf_host_testing-0.0.0/setup.cfg +4 -0
- remoterf_host_testing-0.0.0/src/remoteRF_host/__init__.py +0 -0
- remoterf_host_testing-0.0.0/src/remoteRF_host/common/__init__.py +0 -0
- remoterf_host_testing-0.0.0/src/remoteRF_host/common/grpc/__init__.py +6 -0
- remoterf_host_testing-0.0.0/src/remoteRF_host/common/grpc/grpc_host_pb2.py +63 -0
- remoterf_host_testing-0.0.0/src/remoteRF_host/common/grpc/grpc_host_pb2_grpc.py +97 -0
- remoterf_host_testing-0.0.0/src/remoteRF_host/common/grpc/grpc_pb2.py +59 -0
- remoterf_host_testing-0.0.0/src/remoteRF_host/common/grpc/grpc_pb2_grpc.py +97 -0
- remoterf_host_testing-0.0.0/src/remoteRF_host/common/idl/__init__.py +8 -0
- remoterf_host_testing-0.0.0/src/remoteRF_host/common/idl/pluto_schema.py +198 -0
- remoterf_host_testing-0.0.0/src/remoteRF_host/common/idl/schema.py +288 -0
- remoterf_host_testing-0.0.0/src/remoteRF_host/common/utils/__init__.py +6 -0
- remoterf_host_testing-0.0.0/src/remoteRF_host/common/utils/ansi_codes.py +120 -0
- remoterf_host_testing-0.0.0/src/remoteRF_host/common/utils/api_token.py +31 -0
- remoterf_host_testing-0.0.0/src/remoteRF_host/common/utils/db_connection.py +51 -0
- remoterf_host_testing-0.0.0/src/remoteRF_host/common/utils/db_location.py +26 -0
- remoterf_host_testing-0.0.0/src/remoteRF_host/common/utils/list_string.py +5 -0
- remoterf_host_testing-0.0.0/src/remoteRF_host/common/utils/process_arg.py +80 -0
- remoterf_host_testing-0.0.0/src/remoteRF_host/config/__init__.py +0 -0
- remoterf_host_testing-0.0.0/src/remoteRF_host/config/cert_fetcher.py +161 -0
- remoterf_host_testing-0.0.0/src/remoteRF_host/drivers/__init__.py +0 -0
- remoterf_host_testing-0.0.0/src/remoteRF_host/drivers/adalm_pluto/__init__.py +0 -0
- remoterf_host_testing-0.0.0/src/remoteRF_host/drivers/adalm_pluto/pluto_idl.py +206 -0
- remoterf_host_testing-0.0.0/src/remoteRF_host/drivers/adalm_pluto/pluto_remote_server.py +164 -0
- remoterf_host_testing-0.0.0/src/remoteRF_host/hostrf_cli.py +771 -0
- remoterf_host_testing-0.0.0/src/remoteRF_host/server/__init__.py +0 -0
- remoterf_host_testing-0.0.0/src/remoteRF_host/server/device_manager.py +266 -0
- remoterf_host_testing-0.0.0/src/remoteRF_host/server/rpc_manager.py +148 -0
- remoterf_host_testing-0.0.0/src/remoteRF_host/server/tunnel_agent.py +966 -0
- remoterf_host_testing-0.0.0/src/remoterf_host_testing.egg-info/PKG-INFO +227 -0
- remoterf_host_testing-0.0.0/src/remoterf_host_testing.egg-info/SOURCES.txt +37 -0
- remoterf_host_testing-0.0.0/src/remoterf_host_testing.egg-info/dependency_links.txt +1 -0
- remoterf_host_testing-0.0.0/src/remoterf_host_testing.egg-info/entry_points.txt +2 -0
- remoterf_host_testing-0.0.0/src/remoterf_host_testing.egg-info/requires.txt +7 -0
- remoterf_host_testing-0.0.0/src/remoterf_host_testing.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
include hostrf.yml
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: remoterf-host-testing
|
|
3
|
+
Version: 0.0.0
|
|
4
|
+
Summary: RemoteRF host-side control package
|
|
5
|
+
Author: Ethan Ge
|
|
6
|
+
License: MIT
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Requires-Python: >=3.9
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
Requires-Dist: grpcio
|
|
13
|
+
Requires-Dist: protobuf
|
|
14
|
+
Requires-Dist: numpy
|
|
15
|
+
Requires-Dist: prompt_toolkit
|
|
16
|
+
Requires-Dist: python-dotenv
|
|
17
|
+
Requires-Dist: grpcio-tools
|
|
18
|
+
Requires-Dist: pyyaml
|
|
19
|
+
|
|
20
|
+
# RemoteRF Host (hostrf) — Linux Setup
|
|
21
|
+
|
|
22
|
+
## HostRF Installation
|
|
23
|
+
|
|
24
|
+
The guide is done/verified for Ubuntu Server/Desktop 24.04 LTS.
|
|
25
|
+
|
|
26
|
+
### 0) If Raspberry Pi
|
|
27
|
+
|
|
28
|
+
Raspberry Pi Imager → Install Ubuntu Server 24.04 LTS → Boot Raspberry Pi from SD card.
|
|
29
|
+
|
|
30
|
+
### 1) System Prerequisites (APT)
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
sudo apt update
|
|
34
|
+
sudo apt install -y curl ca-certificates bzip2 git build-essential
|
|
35
|
+
sudo apt install -y libusb-1.0-0 udev
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Optional: confirm architecture:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
uname -m
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
* `x86_64` → Intel/AMD
|
|
45
|
+
* `aarch64` → ARM64 (Raspberry Pi 64-bit, some servers)
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
### 2) Install Miniconda
|
|
50
|
+
|
|
51
|
+
### 2.1 Download the installer
|
|
52
|
+
|
|
53
|
+
#### x86_64
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
cd /tmp
|
|
57
|
+
curl -fsSLO https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
#### ARM64 (aarch64)
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
cd /tmp
|
|
64
|
+
curl -fsSLO https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-aarch64.sh
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### 2.2 Install (non-interactive, recommended)
|
|
68
|
+
|
|
69
|
+
#### x86_64
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
bash Miniconda3-latest-Linux-x86_64.sh -b -p "$HOME/miniconda3"
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
#### ARM64 (aarch64)
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
bash Miniconda3-latest-Linux-aarch64.sh -b -p "$HOME/miniconda3"
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### 2.3 Enable conda in your current shell
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
source "$HOME/miniconda3/etc/profile.d/conda.sh"
|
|
85
|
+
conda --version
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
> If you want conda available automatically in new terminals:
|
|
89
|
+
>
|
|
90
|
+
> ```bash
|
|
91
|
+
> "$HOME/miniconda3/bin/conda" init bash
|
|
92
|
+
> source ~/.bashrc
|
|
93
|
+
> ```
|
|
94
|
+
|
|
95
|
+
### 2.4 Install **mamba** (default solver)
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
conda install -n base -c conda-forge -y mamba
|
|
99
|
+
mamba --version
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Might have to accept anaconda TOS.
|
|
103
|
+
```bash
|
|
104
|
+
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main
|
|
105
|
+
|
|
106
|
+
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### 3) Create the Environment (with mamba (faster))
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
mamba create -n hostrf -y -c conda-forge -c defaults python=3.10 pip setuptools wheel grpcio protobuf python-dotenv numpy scipy libiio pylibiio libusb
|
|
113
|
+
|
|
114
|
+
conda activate hostrf
|
|
115
|
+
python -m pip install -U pip
|
|
116
|
+
python -m pip install pyadi-iio remoterf-host
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
sudo reboot now
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## HostRF Config
|
|
124
|
+
|
|
125
|
+
Run the below for a comprehensive overview:
|
|
126
|
+
```bash
|
|
127
|
+
hostrf --help
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
To get hostrf up and running:
|
|
131
|
+
|
|
132
|
+
### 1) Point to a RemoteRF server
|
|
133
|
+
|
|
134
|
+
HostRF requires a RemoteRF Server already setup. See RemoteRF-Server for additional details.
|
|
135
|
+
|
|
136
|
+
`hostrf` stores its config under: `~/.config/remoterf-host/`
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
hostrf --config --addr <host:port>
|
|
140
|
+
# example:
|
|
141
|
+
hostrf -c -a 164.97.201.67:5000
|
|
142
|
+
hostrf -c -a --show
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### 2) Set host parameters
|
|
146
|
+
|
|
147
|
+
On the remoterf server, run the below:
|
|
148
|
+
|
|
149
|
+
Example uses 'lab-host-01' as the host name.
|
|
150
|
+
It will return a valid command you can just copy and paste into the host CLI.
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
serverrf --host --token-create lab-host-01 --length 8
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Given the parameters/tokens returned, run the below:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
hostrf --config --host <hostname> \"TOKEN\"
|
|
160
|
+
#example:
|
|
161
|
+
hostrf -c -h lab-host-01 "UTzhag"
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
<!-- 164.67.195.207:61005 -->
|
|
165
|
+
|
|
166
|
+
### 3) Connect devices (Adalm Pluto)
|
|
167
|
+
|
|
168
|
+
To connect plutos to the server:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
iio_info -s
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
If the pluto doesn't show up, yet the below works:
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
sudo iio_info -s
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Run the below and reboot after:
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
sudo groupadd -f plugdev
|
|
184
|
+
sudo usermod -aG plugdev "$USER"
|
|
185
|
+
|
|
186
|
+
sudo tee /etc/udev/rules.d/53-adi-usb.rules >/dev/null <<'EOF'
|
|
187
|
+
# Type the below in
|
|
188
|
+
SUBSYSTEM=="usb", ATTR{idVendor}=="0456", MODE="0660", GROUP="plugdev"
|
|
189
|
+
EOF
|
|
190
|
+
|
|
191
|
+
sudo udevadm control --reload-rules
|
|
192
|
+
sudo udevadm trigger
|
|
193
|
+
sudo reboot now
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
Look for a 'hw_serial: 104473'. Keep note of said serial per device.
|
|
198
|
+
|
|
199
|
+
Add pluto to device list. Understand that the device_id (int) needs to be GLOBALLY unique!
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
hostrf --device --add --pluto <id>:<device_name>:<hw_serial>
|
|
203
|
+
|
|
204
|
+
#Example
|
|
205
|
+
hostrf -d -a --pluto 10:"hostrf pluto 0":104473
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Remove device:
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
hostrf -d -remove <id>
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Show devices:
|
|
215
|
+
```bash
|
|
216
|
+
hostrf -d --show
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
Clear all device config:
|
|
220
|
+
```bash
|
|
221
|
+
hostrf -d --wipe
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Run to start the host. You should be able to see host on the server if setup properly.
|
|
225
|
+
```bash
|
|
226
|
+
hostrf -s
|
|
227
|
+
```
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
# RemoteRF Host (hostrf) — Linux Setup
|
|
2
|
+
|
|
3
|
+
## HostRF Installation
|
|
4
|
+
|
|
5
|
+
The guide is done/verified for Ubuntu Server/Desktop 24.04 LTS.
|
|
6
|
+
|
|
7
|
+
### 0) If Raspberry Pi
|
|
8
|
+
|
|
9
|
+
Raspberry Pi Imager → Install Ubuntu Server 24.04 LTS → Boot Raspberry Pi from SD card.
|
|
10
|
+
|
|
11
|
+
### 1) System Prerequisites (APT)
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
sudo apt update
|
|
15
|
+
sudo apt install -y curl ca-certificates bzip2 git build-essential
|
|
16
|
+
sudo apt install -y libusb-1.0-0 udev
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Optional: confirm architecture:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
uname -m
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
* `x86_64` → Intel/AMD
|
|
26
|
+
* `aarch64` → ARM64 (Raspberry Pi 64-bit, some servers)
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
### 2) Install Miniconda
|
|
31
|
+
|
|
32
|
+
### 2.1 Download the installer
|
|
33
|
+
|
|
34
|
+
#### x86_64
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
cd /tmp
|
|
38
|
+
curl -fsSLO https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
#### ARM64 (aarch64)
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
cd /tmp
|
|
45
|
+
curl -fsSLO https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-aarch64.sh
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### 2.2 Install (non-interactive, recommended)
|
|
49
|
+
|
|
50
|
+
#### x86_64
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
bash Miniconda3-latest-Linux-x86_64.sh -b -p "$HOME/miniconda3"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
#### ARM64 (aarch64)
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
bash Miniconda3-latest-Linux-aarch64.sh -b -p "$HOME/miniconda3"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 2.3 Enable conda in your current shell
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
source "$HOME/miniconda3/etc/profile.d/conda.sh"
|
|
66
|
+
conda --version
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
> If you want conda available automatically in new terminals:
|
|
70
|
+
>
|
|
71
|
+
> ```bash
|
|
72
|
+
> "$HOME/miniconda3/bin/conda" init bash
|
|
73
|
+
> source ~/.bashrc
|
|
74
|
+
> ```
|
|
75
|
+
|
|
76
|
+
### 2.4 Install **mamba** (default solver)
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
conda install -n base -c conda-forge -y mamba
|
|
80
|
+
mamba --version
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Might have to accept anaconda TOS.
|
|
84
|
+
```bash
|
|
85
|
+
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main
|
|
86
|
+
|
|
87
|
+
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### 3) Create the Environment (with mamba (faster))
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
mamba create -n hostrf -y -c conda-forge -c defaults python=3.10 pip setuptools wheel grpcio protobuf python-dotenv numpy scipy libiio pylibiio libusb
|
|
94
|
+
|
|
95
|
+
conda activate hostrf
|
|
96
|
+
python -m pip install -U pip
|
|
97
|
+
python -m pip install pyadi-iio remoterf-host
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
sudo reboot now
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## HostRF Config
|
|
105
|
+
|
|
106
|
+
Run the below for a comprehensive overview:
|
|
107
|
+
```bash
|
|
108
|
+
hostrf --help
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
To get hostrf up and running:
|
|
112
|
+
|
|
113
|
+
### 1) Point to a RemoteRF server
|
|
114
|
+
|
|
115
|
+
HostRF requires a RemoteRF Server already setup. See RemoteRF-Server for additional details.
|
|
116
|
+
|
|
117
|
+
`hostrf` stores its config under: `~/.config/remoterf-host/`
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
hostrf --config --addr <host:port>
|
|
121
|
+
# example:
|
|
122
|
+
hostrf -c -a 164.97.201.67:5000
|
|
123
|
+
hostrf -c -a --show
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### 2) Set host parameters
|
|
127
|
+
|
|
128
|
+
On the remoterf server, run the below:
|
|
129
|
+
|
|
130
|
+
Example uses 'lab-host-01' as the host name.
|
|
131
|
+
It will return a valid command you can just copy and paste into the host CLI.
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
serverrf --host --token-create lab-host-01 --length 8
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Given the parameters/tokens returned, run the below:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
hostrf --config --host <hostname> \"TOKEN\"
|
|
141
|
+
#example:
|
|
142
|
+
hostrf -c -h lab-host-01 "UTzhag"
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
<!-- 164.67.195.207:61005 -->
|
|
146
|
+
|
|
147
|
+
### 3) Connect devices (Adalm Pluto)
|
|
148
|
+
|
|
149
|
+
To connect plutos to the server:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
iio_info -s
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
If the pluto doesn't show up, yet the below works:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
sudo iio_info -s
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Run the below and reboot after:
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
sudo groupadd -f plugdev
|
|
165
|
+
sudo usermod -aG plugdev "$USER"
|
|
166
|
+
|
|
167
|
+
sudo tee /etc/udev/rules.d/53-adi-usb.rules >/dev/null <<'EOF'
|
|
168
|
+
# Type the below in
|
|
169
|
+
SUBSYSTEM=="usb", ATTR{idVendor}=="0456", MODE="0660", GROUP="plugdev"
|
|
170
|
+
EOF
|
|
171
|
+
|
|
172
|
+
sudo udevadm control --reload-rules
|
|
173
|
+
sudo udevadm trigger
|
|
174
|
+
sudo reboot now
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
Look for a 'hw_serial: 104473'. Keep note of said serial per device.
|
|
179
|
+
|
|
180
|
+
Add pluto to device list. Understand that the device_id (int) needs to be GLOBALLY unique!
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
hostrf --device --add --pluto <id>:<device_name>:<hw_serial>
|
|
184
|
+
|
|
185
|
+
#Example
|
|
186
|
+
hostrf -d -a --pluto 10:"hostrf pluto 0":104473
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Remove device:
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
hostrf -d -remove <id>
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Show devices:
|
|
196
|
+
```bash
|
|
197
|
+
hostrf -d --show
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Clear all device config:
|
|
201
|
+
```bash
|
|
202
|
+
hostrf -d --wipe
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Run to start the host. You should be able to see host on the server if setup properly.
|
|
206
|
+
```bash
|
|
207
|
+
hostrf -s
|
|
208
|
+
```
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "remoterf-host-testing"
|
|
7
|
+
version = "0.0.0"
|
|
8
|
+
description = "RemoteRF host-side control package"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
authors = [{ name = "Ethan Ge" }]
|
|
13
|
+
dependencies = [
|
|
14
|
+
"grpcio",
|
|
15
|
+
"protobuf",
|
|
16
|
+
"numpy",
|
|
17
|
+
"prompt_toolkit",
|
|
18
|
+
"python-dotenv",
|
|
19
|
+
"grpcio-tools",
|
|
20
|
+
"pyyaml",
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
classifiers = [
|
|
24
|
+
"Programming Language :: Python :: 3",
|
|
25
|
+
"License :: OSI Approved :: MIT License",
|
|
26
|
+
"Operating System :: OS Independent",
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
[tool.setuptools]
|
|
30
|
+
package-dir = { "" = "src" }
|
|
31
|
+
|
|
32
|
+
[tool.setuptools.packages.find]
|
|
33
|
+
where = ["src"]
|
|
34
|
+
|
|
35
|
+
[project.scripts]
|
|
36
|
+
hostrf = "remoteRF_host.hostrf_cli:main"
|
|
37
|
+
|
|
38
|
+
[tool.setuptools.package-data]
|
|
39
|
+
remoteRF_host = ["*.yml"]
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: grpc_host.proto
|
|
5
|
+
# Protobuf Python Version: 6.31.1
|
|
6
|
+
"""Generated protocol buffer code."""
|
|
7
|
+
from google.protobuf import descriptor as _descriptor
|
|
8
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
10
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
11
|
+
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
6,
|
|
15
|
+
31,
|
|
16
|
+
1,
|
|
17
|
+
'',
|
|
18
|
+
'grpc_host.proto'
|
|
19
|
+
)
|
|
20
|
+
# @@protoc_insertion_point(imports)
|
|
21
|
+
|
|
22
|
+
_sym_db = _symbol_database.Default()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
from . import grpc_pb2 as grpc__pb2
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0fgrpc_host.proto\x12\x08remoterf\x1a\ngrpc.proto\"A\n\tHostHello\x12\x0f\n\x07host_id\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x12\n\nhost_token\x18\x03 \x01(\t\"^\n\nDeviceInfo\x12\x10\n\x08local_id\x18\x01 \x01(\r\x12\r\n\x05label\x18\x02 \x01(\t\x12\x11\n\tdevice_id\x18\x03 \x01(\t\x12\x0e\n\x06serial\x18\x04 \x01(\t\x12\x0c\n\x04kind\x18\x05 \x01(\t\"_\n\x0e\x44\x65viceAnnounce\x12%\n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x14.remoterf.DeviceInfo\x12\x0f\n\x07unix_ms\x18\x02 \x01(\x04\x12\x15\n\rfull_snapshot\x18\x03 \x01(\x08\"\xab\x01\n\nRpcRequest\x12\x0e\n\x06req_id\x18\x01 \x01(\t\x12\x18\n\x10global_device_id\x18\x02 \x01(\r\x12\x17\n\x0flocal_device_id\x18\x03 \x01(\r\x12\x11\n\tdevice_id\x18\x04 \x01(\t\x12-\n\x07request\x18\x05 \x01(\x0b\x32\x1c.remote_rf.GenericRPCRequest\x12\x18\n\x10\x64\x65\x61\x64line_unix_ms\x18\x06 \x01(\x04\"i\n\x0bRpcResponse\x12\x0e\n\x06req_id\x18\x01 \x01(\t\x12\n\n\x02ok\x18\x02 \x01(\x08\x12/\n\x08response\x18\x03 \x01(\x0b\x32\x1d.remote_rf.GenericRPCResponse\x12\r\n\x05\x65rror\x18\x04 \x01(\t\"\x1c\n\tHeartbeat\x12\x0f\n\x07unix_ms\x18\x01 \x01(\x04\"\x18\n\x06\x43\x61ncel\x12\x0e\n\x06req_id\x18\x01 \x01(\t\"e\n\x0bMetaRequest\x12\x0e\n\x06req_id\x18\x01 \x01(\t\x12\x18\n\x10include_platform\x18\x02 \x01(\x08\x12\x13\n\x0binclude_env\x18\x03 \x01(\x08\x12\x17\n\x0finclude_devices\x18\x04 \x01(\x08\"\xb7\x01\n\x08HostMeta\x12\x0f\n\x07host_id\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x0f\n\x07unix_ms\x18\x03 \x01(\x04\x12&\n\x02kv\x18\x04 \x03(\x0b\x32\x1a.remoterf.HostMeta.KvEntry\x12%\n\x07\x64\x65vices\x18\x05 \x03(\x0b\x32\x14.remoterf.DeviceInfo\x1a)\n\x07KvEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"[\n\x0cMetaResponse\x12\x0e\n\x06req_id\x18\x01 \x01(\t\x12\n\n\x02ok\x18\x02 \x01(\x08\x12\r\n\x05\x65rror\x18\x03 \x01(\t\x12 \n\x04meta\x18\x04 \x01(\x0b\x32\x12.remoterf.HostMeta\"\xf7\x02\n\tHostFrame\x12$\n\x05hello\x18\x01 \x01(\x0b\x32\x13.remoterf.HostHelloH\x00\x12\x33\n\x0f\x64\x65vice_announce\x18\x02 \x01(\x0b\x32\x18.remoterf.DeviceAnnounceH\x00\x12+\n\x0brpc_request\x18\x03 \x01(\x0b\x32\x14.remoterf.RpcRequestH\x00\x12-\n\x0crpc_response\x18\x04 \x01(\x0b\x32\x15.remoterf.RpcResponseH\x00\x12(\n\theartbeat\x18\x05 \x01(\x0b\x32\x13.remoterf.HeartbeatH\x00\x12\"\n\x06\x63\x61ncel\x18\x06 \x01(\x0b\x32\x10.remoterf.CancelH\x00\x12-\n\x0cmeta_request\x18\x07 \x01(\x0b\x32\x15.remoterf.MetaRequestH\x00\x12/\n\rmeta_response\x18\x08 \x01(\x0b\x32\x16.remoterf.MetaResponseH\x00\x42\x05\n\x03msg2E\n\nHostTunnel\x12\x37\n\x07\x43onnect\x12\x13.remoterf.HostFrame\x1a\x13.remoterf.HostFrame(\x01\x30\x01\x62\x06proto3')
|
|
29
|
+
|
|
30
|
+
_globals = globals()
|
|
31
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
32
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'grpc_host_pb2', _globals)
|
|
33
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
34
|
+
DESCRIPTOR._loaded_options = None
|
|
35
|
+
_globals['_HOSTMETA_KVENTRY']._loaded_options = None
|
|
36
|
+
_globals['_HOSTMETA_KVENTRY']._serialized_options = b'8\001'
|
|
37
|
+
_globals['_HOSTHELLO']._serialized_start=41
|
|
38
|
+
_globals['_HOSTHELLO']._serialized_end=106
|
|
39
|
+
_globals['_DEVICEINFO']._serialized_start=108
|
|
40
|
+
_globals['_DEVICEINFO']._serialized_end=202
|
|
41
|
+
_globals['_DEVICEANNOUNCE']._serialized_start=204
|
|
42
|
+
_globals['_DEVICEANNOUNCE']._serialized_end=299
|
|
43
|
+
_globals['_RPCREQUEST']._serialized_start=302
|
|
44
|
+
_globals['_RPCREQUEST']._serialized_end=473
|
|
45
|
+
_globals['_RPCRESPONSE']._serialized_start=475
|
|
46
|
+
_globals['_RPCRESPONSE']._serialized_end=580
|
|
47
|
+
_globals['_HEARTBEAT']._serialized_start=582
|
|
48
|
+
_globals['_HEARTBEAT']._serialized_end=610
|
|
49
|
+
_globals['_CANCEL']._serialized_start=612
|
|
50
|
+
_globals['_CANCEL']._serialized_end=636
|
|
51
|
+
_globals['_METAREQUEST']._serialized_start=638
|
|
52
|
+
_globals['_METAREQUEST']._serialized_end=739
|
|
53
|
+
_globals['_HOSTMETA']._serialized_start=742
|
|
54
|
+
_globals['_HOSTMETA']._serialized_end=925
|
|
55
|
+
_globals['_HOSTMETA_KVENTRY']._serialized_start=884
|
|
56
|
+
_globals['_HOSTMETA_KVENTRY']._serialized_end=925
|
|
57
|
+
_globals['_METARESPONSE']._serialized_start=927
|
|
58
|
+
_globals['_METARESPONSE']._serialized_end=1018
|
|
59
|
+
_globals['_HOSTFRAME']._serialized_start=1021
|
|
60
|
+
_globals['_HOSTFRAME']._serialized_end=1396
|
|
61
|
+
_globals['_HOSTTUNNEL']._serialized_start=1398
|
|
62
|
+
_globals['_HOSTTUNNEL']._serialized_end=1467
|
|
63
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
2
|
+
"""Client and server classes corresponding to protobuf-defined services."""
|
|
3
|
+
import grpc
|
|
4
|
+
import warnings
|
|
5
|
+
|
|
6
|
+
from . import grpc_host_pb2 as grpc__host__pb2
|
|
7
|
+
|
|
8
|
+
GRPC_GENERATED_VERSION = '1.78.1'
|
|
9
|
+
GRPC_VERSION = grpc.__version__
|
|
10
|
+
_version_not_supported = False
|
|
11
|
+
|
|
12
|
+
try:
|
|
13
|
+
from grpc._utilities import first_version_is_lower
|
|
14
|
+
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
|
|
15
|
+
except ImportError:
|
|
16
|
+
_version_not_supported = True
|
|
17
|
+
|
|
18
|
+
if _version_not_supported:
|
|
19
|
+
raise RuntimeError(
|
|
20
|
+
f'The grpc package installed is at version {GRPC_VERSION},'
|
|
21
|
+
+ ' but the generated code in grpc_host_pb2_grpc.py depends on'
|
|
22
|
+
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
|
|
23
|
+
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
|
|
24
|
+
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class HostTunnelStub(object):
|
|
29
|
+
"""Missing associated documentation comment in .proto file."""
|
|
30
|
+
|
|
31
|
+
def __init__(self, channel):
|
|
32
|
+
"""Constructor.
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
channel: A grpc.Channel.
|
|
36
|
+
"""
|
|
37
|
+
self.Connect = channel.stream_stream(
|
|
38
|
+
'/remoterf.HostTunnel/Connect',
|
|
39
|
+
request_serializer=grpc__host__pb2.HostFrame.SerializeToString,
|
|
40
|
+
response_deserializer=grpc__host__pb2.HostFrame.FromString,
|
|
41
|
+
_registered_method=True)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class HostTunnelServicer(object):
|
|
45
|
+
"""Missing associated documentation comment in .proto file."""
|
|
46
|
+
|
|
47
|
+
def Connect(self, request_iterator, context):
|
|
48
|
+
"""Missing associated documentation comment in .proto file."""
|
|
49
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
50
|
+
context.set_details('Method not implemented!')
|
|
51
|
+
raise NotImplementedError('Method not implemented!')
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def add_HostTunnelServicer_to_server(servicer, server):
|
|
55
|
+
rpc_method_handlers = {
|
|
56
|
+
'Connect': grpc.stream_stream_rpc_method_handler(
|
|
57
|
+
servicer.Connect,
|
|
58
|
+
request_deserializer=grpc__host__pb2.HostFrame.FromString,
|
|
59
|
+
response_serializer=grpc__host__pb2.HostFrame.SerializeToString,
|
|
60
|
+
),
|
|
61
|
+
}
|
|
62
|
+
generic_handler = grpc.method_handlers_generic_handler(
|
|
63
|
+
'remoterf.HostTunnel', rpc_method_handlers)
|
|
64
|
+
server.add_generic_rpc_handlers((generic_handler,))
|
|
65
|
+
server.add_registered_method_handlers('remoterf.HostTunnel', rpc_method_handlers)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
# This class is part of an EXPERIMENTAL API.
|
|
69
|
+
class HostTunnel(object):
|
|
70
|
+
"""Missing associated documentation comment in .proto file."""
|
|
71
|
+
|
|
72
|
+
@staticmethod
|
|
73
|
+
def Connect(request_iterator,
|
|
74
|
+
target,
|
|
75
|
+
options=(),
|
|
76
|
+
channel_credentials=None,
|
|
77
|
+
call_credentials=None,
|
|
78
|
+
insecure=False,
|
|
79
|
+
compression=None,
|
|
80
|
+
wait_for_ready=None,
|
|
81
|
+
timeout=None,
|
|
82
|
+
metadata=None):
|
|
83
|
+
return grpc.experimental.stream_stream(
|
|
84
|
+
request_iterator,
|
|
85
|
+
target,
|
|
86
|
+
'/remoterf.HostTunnel/Connect',
|
|
87
|
+
grpc__host__pb2.HostFrame.SerializeToString,
|
|
88
|
+
grpc__host__pb2.HostFrame.FromString,
|
|
89
|
+
options,
|
|
90
|
+
channel_credentials,
|
|
91
|
+
insecure,
|
|
92
|
+
call_credentials,
|
|
93
|
+
compression,
|
|
94
|
+
wait_for_ready,
|
|
95
|
+
timeout,
|
|
96
|
+
metadata,
|
|
97
|
+
_registered_method=True)
|