You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ubuntu (remote monitor), Windows 10 (remote agent)
PlatformIO Version (platformio --version):
PlatformIO Core, version 5.2.0
Description of problem
The remote device monitor crashes as soon as I press any key to try and send a character to the attached remote device.
Steps to Reproduce
Fire up pio remote agent start on your remote machine
Locally start up pio remote device monitor
Press any key in the serial monitor window
Actual Results
Unhandled Error
Traceback (most recent call last):
File "/home/vscode/.platformio/packages/contrib-pysite/twisted/python/log.py", line 103, in callWithLogger
return callWithContext({"system": lp}, func, *args, **kw)
File "/home/vscode/.platformio/packages/contrib-pysite/twisted/python/log.py", line 86, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "/home/vscode/.platformio/packages/contrib-pysite/twisted/python/context.py", line 122, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/home/vscode/.platformio/packages/contrib-pysite/twisted/python/context.py", line 85, in callWithContext
return func(*args,**kw)
--- <exception caught here> ---
File "/home/vscode/.platformio/packages/contrib-pysite/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
why = selectable.doRead()
File "/home/vscode/.platformio/packages/contrib-pysite/twisted/internet/tcp.py", line 243, in doRead
return self._dataReceived(data)
File "/home/vscode/.platformio/packages/contrib-pysite/twisted/internet/tcp.py", line 249, in _dataReceived
rval = self.protocol.dataReceived(data)
File "/home/vscode/.platformio/penv/lib/python3.9/site-packages/platformio/commands/remote/client/device_monitor.py", line 33, in dataReceived
self.factory.send_to_server(data)
File "/home/vscode/.platformio/penv/lib/python3.9/site-packages/platformio/commands/remote/client/device_monitor.py", line 68, in send_to_server
self.cdm.acwrite_data(data)
File "/home/vscode/.platformio/penv/lib/python3.9/site-packages/platformio/commands/remote/client/device_monitor.py", line 222, in acwrite_data
self._acwrite_buffer += data
builtins.TypeError: can only concatenate str (not "bytes") to str
Exception in thread rx:
Traceback (most recent call last):
File "/home/vscode/.platformio/penv/lib/python3.9/site-packages/serial/urlhandler/protocol_socket.py", line 171, in read
raise SerialException('socket disconnected')
serial.serialutil.SerialException: socket disconnected
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
--- exit ---
self.run()
File "/usr/lib/python3.9/threading.py", line 892, in run
self._target(*self._args, **self._kwargs)
File "/home/vscode/.platformio/penv/lib/python3.9/site-packages/serial/tools/miniterm.py", line 499, in reader
data = self.serial.read(self.serial.in_waiting or 1)
File "/home/vscode/.platformio/penv/lib/python3.9/site-packages/serial/urlhandler/protocol_socket.py", line 178, in read
raise SerialException('read failed: {}'.format(e))
serial.serialutil.SerialException: read failed: socket disconnected
Expected Results
No crash, keypress sent to remote device.
Additional info
I've confirmed that remote upload does work, I am able to flash my remotely connected STM32 device using the same setup. This appears to be specific to the remote device monitor feature.
The text was updated successfully, but these errors were encountered:
I can confirm this issue - running "pio monitor" over an SSH on the agent machine (Ubuntu in my case) does take keystrokes.
Keystrokes cause the mentioned crash when using "pio remote monitor".
@ivankravets this I think happened because of 2.7 python to 3.x and how str and bytes are used + some confusion around the processing of the "data" argument.
I am no python expert but I got it working I think. I will submit a PR for your testing - the fix was quite straight forward but it needs to be tested by more people.
Configuration
Operating system:
Ubuntu (remote monitor), Windows 10 (remote agent)
PlatformIO Version (
platformio --version
):PlatformIO Core, version 5.2.0
Description of problem
The remote device monitor crashes as soon as I press any key to try and send a character to the attached remote device.
Steps to Reproduce
pio remote agent start
on your remote machinepio remote device monitor
Actual Results
Expected Results
No crash, keypress sent to remote device.
Additional info
I've confirmed that remote upload does work, I am able to flash my remotely connected STM32 device using the same setup. This appears to be specific to the remote device monitor feature.
The text was updated successfully, but these errors were encountered: