phystack-hub-client 0.2.6__tar.gz → 0.2.7__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.
- {phystack_hub_client-0.2.6 → phystack_hub_client-0.2.7}/PKG-INFO +1 -1
- {phystack_hub_client-0.2.6 → phystack_hub_client-0.2.7}/pyproject.toml +1 -1
- {phystack_hub_client-0.2.6 → phystack_hub_client-0.2.7}/src/phystack/hub_client/services/phyhub_connection.py +61 -8
- {phystack_hub_client-0.2.6 → phystack_hub_client-0.2.7}/.gitignore +0 -0
- {phystack_hub_client-0.2.6 → phystack_hub_client-0.2.7}/README.md +0 -0
- {phystack_hub_client-0.2.6 → phystack_hub_client-0.2.7}/examples/browser_test_backend.py +0 -0
- {phystack_hub_client-0.2.6 → phystack_hub_client-0.2.7}/scripts/python-node-test.sh +0 -0
- {phystack_hub_client-0.2.6 → phystack_hub_client-0.2.7}/scripts/webrtc-test.sh +0 -0
- {phystack_hub_client-0.2.6 → phystack_hub_client-0.2.7}/src/phystack/hub_client/__init__.py +0 -0
- {phystack_hub_client-0.2.6 → phystack_hub_client-0.2.7}/src/phystack/hub_client/client.py +0 -0
- {phystack_hub_client-0.2.6 → phystack_hub_client-0.2.7}/src/phystack/hub_client/instances/__init__.py +0 -0
- {phystack_hub_client-0.2.6 → phystack_hub_client-0.2.7}/src/phystack/hub_client/instances/base_instance.py +0 -0
- {phystack_hub_client-0.2.6 → phystack_hub_client-0.2.7}/src/phystack/hub_client/instances/edge_instance.py +0 -0
- {phystack_hub_client-0.2.6 → phystack_hub_client-0.2.7}/src/phystack/hub_client/instances/peripheral_instance.py +0 -0
- {phystack_hub_client-0.2.6 → phystack_hub_client-0.2.7}/src/phystack/hub_client/services/__init__.py +0 -0
- {phystack_hub_client-0.2.6 → phystack_hub_client-0.2.7}/src/phystack/hub_client/services/signals.py +0 -0
- {phystack_hub_client-0.2.6 → phystack_hub_client-0.2.7}/src/phystack/hub_client/services/webrtc/__init__.py +0 -0
- {phystack_hub_client-0.2.6 → phystack_hub_client-0.2.7}/src/phystack/hub_client/services/webrtc/data_channel.py +0 -0
- {phystack_hub_client-0.2.6 → phystack_hub_client-0.2.7}/src/phystack/hub_client/services/webrtc/media_stream.py +0 -0
- {phystack_hub_client-0.2.6 → phystack_hub_client-0.2.7}/src/phystack/hub_client/twin_messaging.py +0 -0
- {phystack_hub_client-0.2.6 → phystack_hub_client-0.2.7}/src/phystack/hub_client/twin_registry.py +0 -0
- {phystack_hub_client-0.2.6 → phystack_hub_client-0.2.7}/src/phystack/hub_client/types/__init__.py +0 -0
- {phystack_hub_client-0.2.6 → phystack_hub_client-0.2.7}/src/phystack/hub_client/types/twin_types.py +0 -0
- {phystack_hub_client-0.2.6 → phystack_hub_client-0.2.7}/tests/test_communication.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: phystack-hub-client
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.7
|
|
4
4
|
Summary: Python client for PhyHub - events, actions, DataChannel, and MediaStream
|
|
5
5
|
Project-URL: Homepage, https://github.com/phystack/phystack-pypi
|
|
6
6
|
Project-URL: Documentation, https://docs.phystack.com
|
|
@@ -182,14 +182,33 @@ class PhyHubConnection:
|
|
|
182
182
|
return self._sio
|
|
183
183
|
|
|
184
184
|
mode = self.config.mode
|
|
185
|
+
|
|
186
|
+
# Debug: log versions of key libraries for connection troubleshooting
|
|
187
|
+
try:
|
|
188
|
+
import socketio as _sio_mod
|
|
189
|
+
import engineio as _eio_mod
|
|
190
|
+
import aiohttp as _aiohttp_mod
|
|
191
|
+
print(
|
|
192
|
+
f"[PhyHubConnection] Library versions: "
|
|
193
|
+
f"python-socketio={_sio_mod.__version__}, "
|
|
194
|
+
f"python-engineio={_eio_mod.__version__}, "
|
|
195
|
+
f"aiohttp={_aiohttp_mod.__version__}"
|
|
196
|
+
)
|
|
197
|
+
except Exception as _e:
|
|
198
|
+
print(f"[PhyHubConnection] Could not read lib versions: {_e}")
|
|
199
|
+
|
|
185
200
|
print(f"[PhyHubConnection] Connecting to {self.config.url} ({mode.value} mode)")
|
|
201
|
+
print(f"[PhyHubConnection] Instance ID: {self.config.instance_id!r}")
|
|
202
|
+
print(f"[PhyHubConnection] Device ID: {self.config.device_id!r}")
|
|
186
203
|
|
|
204
|
+
# Enable verbose logging from socketio and engineio to trace the
|
|
205
|
+
# handshake and packet flow during connection troubleshooting.
|
|
187
206
|
self._sio = socketio.AsyncClient(
|
|
188
207
|
reconnection=True,
|
|
189
208
|
reconnection_attempts=5,
|
|
190
209
|
reconnection_delay=1,
|
|
191
|
-
logger=
|
|
192
|
-
engineio_logger=
|
|
210
|
+
logger=True,
|
|
211
|
+
engineio_logger=True,
|
|
193
212
|
)
|
|
194
213
|
|
|
195
214
|
self._connect_event = asyncio.Event()
|
|
@@ -198,6 +217,14 @@ class PhyHubConnection:
|
|
|
198
217
|
async def connect() -> None:
|
|
199
218
|
self._connected = True
|
|
200
219
|
print("[PhyHubConnection] Connected successfully")
|
|
220
|
+
try:
|
|
221
|
+
print(
|
|
222
|
+
f"[PhyHubConnection] Namespaces on client: {list(self._sio.namespaces)}; "
|
|
223
|
+
f"Session ID: {self._sio.get_sid()!r}; "
|
|
224
|
+
f"Transport: {self._sio.transport()!r}"
|
|
225
|
+
)
|
|
226
|
+
except Exception as _e:
|
|
227
|
+
print(f"[PhyHubConnection] Could not read post-connect state: {_e}")
|
|
201
228
|
if self._connect_event:
|
|
202
229
|
self._connect_event.set()
|
|
203
230
|
|
|
@@ -208,7 +235,7 @@ class PhyHubConnection:
|
|
|
208
235
|
|
|
209
236
|
@self._sio.event
|
|
210
237
|
async def connect_error(data: Any) -> None:
|
|
211
|
-
print(f"[PhyHubConnection] Connection error: {data}")
|
|
238
|
+
print(f"[PhyHubConnection] Connection error: {data!r}")
|
|
212
239
|
if self._connect_event:
|
|
213
240
|
self._connect_event.set()
|
|
214
241
|
|
|
@@ -224,20 +251,36 @@ class PhyHubConnection:
|
|
|
224
251
|
auth = {"instanceId": self.config.instance_id}
|
|
225
252
|
timeout = 3 if mode == ConnectionMode.SIMULATOR else 5
|
|
226
253
|
|
|
254
|
+
print(
|
|
255
|
+
f"[PhyHubConnection] Auth payload: {auth!r}; "
|
|
256
|
+
f"Connect wait_timeout={timeout}s"
|
|
257
|
+
)
|
|
258
|
+
|
|
227
259
|
try:
|
|
228
|
-
|
|
229
|
-
# behavior. The default polling -> WebSocket upgrade path triggers
|
|
230
|
-
# a python-engineio bug where a WebSocketError object is passed
|
|
231
|
-
# into the packet decoder on upgrade failure.
|
|
260
|
+
print("[PhyHubConnection] Calling self._sio.connect()...")
|
|
232
261
|
await self._sio.connect(
|
|
233
262
|
self.config.url,
|
|
234
263
|
auth=auth,
|
|
235
264
|
wait_timeout=timeout,
|
|
236
|
-
transports=["websocket"],
|
|
237
265
|
)
|
|
266
|
+
print("[PhyHubConnection] self._sio.connect() returned successfully")
|
|
267
|
+
try:
|
|
268
|
+
print(
|
|
269
|
+
f"[PhyHubConnection] Post-connect state: "
|
|
270
|
+
f"connected={self._sio.connected}, "
|
|
271
|
+
f"namespaces={list(self._sio.namespaces)}, "
|
|
272
|
+
f"transport={self._sio.transport()!r}"
|
|
273
|
+
)
|
|
274
|
+
except Exception as _e:
|
|
275
|
+
print(f"[PhyHubConnection] Could not read post-connect state: {_e}")
|
|
238
276
|
|
|
239
277
|
# Wait for connection confirmation
|
|
278
|
+
print(f"[PhyHubConnection] Waiting for connect event (timeout={timeout}s)...")
|
|
240
279
|
await asyncio.wait_for(self._connect_event.wait(), timeout=float(timeout))
|
|
280
|
+
print(
|
|
281
|
+
f"[PhyHubConnection] Connect event received. "
|
|
282
|
+
f"self._connected={self._connected}"
|
|
283
|
+
)
|
|
241
284
|
|
|
242
285
|
if not self._connected:
|
|
243
286
|
raise ConnectionError("Failed to connect to PhyHub")
|
|
@@ -245,9 +288,19 @@ class PhyHubConnection:
|
|
|
245
288
|
return self._sio
|
|
246
289
|
|
|
247
290
|
except asyncio.TimeoutError:
|
|
291
|
+
print(
|
|
292
|
+
"[PhyHubConnection] asyncio.TimeoutError waiting for connect event "
|
|
293
|
+
f"(timeout={timeout}s, mode={mode.value}, url={self.config.url})"
|
|
294
|
+
)
|
|
248
295
|
raise ConnectionError(
|
|
249
296
|
f"Connection timeout ({mode.value} mode, url={self.config.url})"
|
|
250
297
|
)
|
|
298
|
+
except Exception as _e:
|
|
299
|
+
print(
|
|
300
|
+
f"[PhyHubConnection] Exception during connect: "
|
|
301
|
+
f"{type(_e).__name__}: {_e!r}"
|
|
302
|
+
)
|
|
303
|
+
raise
|
|
251
304
|
|
|
252
305
|
async def disconnect(self) -> None:
|
|
253
306
|
"""Disconnect from PhyHub."""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{phystack_hub_client-0.2.6 → phystack_hub_client-0.2.7}/src/phystack/hub_client/services/__init__.py
RENAMED
|
File without changes
|
{phystack_hub_client-0.2.6 → phystack_hub_client-0.2.7}/src/phystack/hub_client/services/signals.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{phystack_hub_client-0.2.6 → phystack_hub_client-0.2.7}/src/phystack/hub_client/twin_messaging.py
RENAMED
|
File without changes
|
{phystack_hub_client-0.2.6 → phystack_hub_client-0.2.7}/src/phystack/hub_client/twin_registry.py
RENAMED
|
File without changes
|
{phystack_hub_client-0.2.6 → phystack_hub_client-0.2.7}/src/phystack/hub_client/types/__init__.py
RENAMED
|
File without changes
|
{phystack_hub_client-0.2.6 → phystack_hub_client-0.2.7}/src/phystack/hub_client/types/twin_types.py
RENAMED
|
File without changes
|
|
File without changes
|