ChameleonUltra icon indicating copy to clipboard operation
ChameleonUltra copied to clipboard

Start working on TCP comms

Open szymex73 opened this issue 1 year ago • 5 comments

This change will allow for connecting to a TCP server that exposes the chameleon serial interface, similar to how the PM3 CLI allows for connecting to a TCP server exposing a Proxmark. This should allow for the use of the CLI on devices like Android phones with Termux.

Currently, it's working for communicating with a device but needs a bug fixed with a thread locking up when trying to close the socket.

szymex73 avatar Aug 26 '23 10:08 szymex73

You are welcome to add an entry to the CHANGELOG.md as well

github-actions[bot] avatar Aug 26 '23 10:08 github-actions[bot]

Built artifacts for commit b8e11bd6791913c22972b553dfa7a34232ef88fa

Firmware

Client

github-actions[bot] avatar Aug 26 '23 10:08 github-actions[bot]

Just sharing some thoughts, feel free to ignore, I don't want to make your life harder neither unless you think it's worth investigating...

To also support BLE in CLI, the way seems to use Bleak, which is based on asyncio. If we move to a unified asyncio model for transports, there is also pyserial-asyncio. Now for TCP, if you use Streams it's also asyncio.

So, maybe should we investigate moving to a unified asyncio API for transport? (I must confess I've always more difficulties thinking with async than sync, but well...)

doegox avatar Aug 26 '23 11:08 doegox

Just sharing some thoughts, feel free to ignore, I don't want to make your life harder neither unless you think it's worth investigating...

To also support BLE in CLI, the way seems to use Bleak, which is based on asyncio. If we move to a unified asyncio model for transports, there is also pyserial-asyncio. Now for TCP, if you use Streams it's also asyncio.

So, maybe should we investigate moving to a unified asyncio API for transport? (I must confess I've always more difficulties thinking with async than sync, but well...)

migrating to async might be worth it to prevent future issues, etc.

GameTec-live avatar Aug 26 '23 12:08 GameTec-live

It would require some rearchitecturing but I do agree that going async might be a better choice with the transaction model we currently have. Could take a look at that pretty soon but can't say for sure

szymex73 avatar Aug 26 '23 16:08 szymex73