RfidResearchGroup / proxmark3

Iceman Fork - Proxmark3
http://www.icedev.se
GNU General Public License v3.0
3.65k stars 981 forks source link

Some fixes for the reconnect feature #2225

Closed wh201906 closed 6 months ago

wh201906 commented 6 months ago
  1. Add msleep() to reduce the CPU usage
  2. Disable printing error information when calling uart_open() in OpenProxmarkSilent()

I'm still finding the reason of crash when running hw connect to a different port in the offline mode, so I created this as a draft.

github-actions[bot] commented 6 months ago

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

iceman1001 commented 6 months ago

different port means we can't auto reconnect. it uses the "serial port" that was used when first starting the client. saved in the global connection variable g_conn

It would mean we would need a way to break the reconnect thread if pm3 client is connected manually... and a way to detect the new serial port...
which is hard if there are more than one proxmark3 device connected to the computer

wh201906 commented 6 months ago

I know, but I thinks it should be possible to connect to a different port by running hw connect manually when the original connection is down

iceman1001 commented 6 months ago

yes,
then we would need a way to break the reconnect thread. ie detect if "pm3 is present and online"

wh201906 commented 6 months ago

yes, then we would need a way to break the reconnect thread. ie detect if "pm3 is present and online"

Yes. I'm working on this.

wh201906 commented 6 months ago

Maybe we should merge this PR first, because the high CPU usage in reconnecting and the infinite error: Could not connect really bring a bad user experience, while the hw connect to different port is just a feature.

iceman1001 commented 6 months ago

yes, the sleep is needed.

merged :)

iceman1001 commented 6 months ago

Something tells me the GENERIC build running on devices with no flash, has the different serial port issue.

wh201906 commented 6 months ago

Something tells me the GENERIC build running on devices with no flash, has the different serial port issue.

Do you have the steps to reproduce it?

iceman1001 commented 6 months ago

I suspect a non-flash enabled proxmark3 device, will have different serial port enumeration when going from normal operation - bootloader - flash - normal operation...

wh201906 commented 6 months ago

Yeah I got the same bug on my PM3 Easy before. But I guess it won't happen from the normal operation -> unplug -> plug and reconnect