Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passthrough not working with 1.3.1 release #321

Closed
mikeysklar opened this issue Jan 7, 2025 · 9 comments
Closed

Passthrough not working with 1.3.1 release #321

mikeysklar opened this issue Jan 7, 2025 · 9 comments

Comments

@mikeysklar
Copy link
Contributor

mikeysklar commented Jan 7, 2025

Airlift boards like the Matrix Portal M4 and PyPortal are no longer working with Adafruit WebSerial ESPTool since the 1.3.1 release. Working directly with ESP32 boards is fine. (ESP32-S2 Rev TFT tested good).

This is likely due to the noReset logic not working properly. I say that because having passthrough on or off the ESP32-S2 Rev TFT connects.

The code has changed quite a bit since I looked at it seven weeks ago. The JavaScript console errors I see when trying to connect with a Airlift board are:

I'm sure I can fix it, but wanted to log it here. Reported by blakebr in the forums

Screenshot 2025-01-07 at 11 00 33 AM
Screenshot 2025-01-07 at 11 01 13 AM

@StevenSlaa
Copy link

StevenSlaa commented Jan 8, 2025

I also have the same problem, I think it has something to do with esptool-js, which is what Adafruit is using. I've tested the npm package itself and got the same problem on esptool-js version: 0.5.3. Also I suspect its specifc to Mac with chrome or chromium based browsers.

To add some information to the discussion, I've tested it with a WEMOS LOLIN32, so probably not chip specific. When trying with the local esptool.py it works just fine:

% esptool.py -p /dev/tty.usbserial-0001 chip_id
esptool.py v4.5
Serial port /dev/tty.usbserial-0001
Connecting..........
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting....
Detecting chip type... ESP32
Chip is ESP32-D0WD-V3 (revision v3.1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: ...
Uploading stub...
Running stub...
Stub running...
Warning: ESP32 has no Chip ID. Reading MAC instead.
MAC: ...
Hard resetting via RTS pin...

@mikeysklar
Copy link
Contributor Author

mikeysklar commented Jan 8, 2025

@StevenSlaa you are seeing something a little different. It might be another issue with esptool-js, but this issue is specific to the co-processor boards being reset() when trying to connect rather than avoiding reset as a passthrough mode.

export default { ClassicReset, CustomReset, HardReset, UsbJtagSerialReset, validateCustomResetStringSequence };

I see there are a few different type of resets available so I can try to customReset with NOP parameters to see if I can get the AirLift chatting with the new 0.5.3 release.

@mikeysklar
Copy link
Contributor Author

Feature request for no_reset option filed with esptool-js.

@makermelissa
Copy link
Contributor

I noticed this over the weekend. I was able to work around it by using the command line esptool, but I'd love to get this working asap. Currently I am hacking on the esptool-js code to see if I can get something working.

@makermelissa
Copy link
Contributor

makermelissa commented Jan 8, 2025

Ok, sort of got it working by just checking if mode is no_reset and skipping the reset step. However, I get Error: Invalid head of packeton first connection attempt. However, on subsequent attempts it seems to work fine. I'm going to continue working on tracing why this may be.

@makermelissa
Copy link
Contributor

I noticed in the passthrough code, it has a bit of code in the setup() function with a few delays. I suspect a race condition and wonder if adding a small delay if no_reset is requested would fix the issue.

@makermelissa
Copy link
Contributor

Ok, after playing around with it a bit, I found adding a delay in esptool-js got rid of the error consistently. However, there's no reason to code an error in esptool-js itself and I didn't want to rely on somebody not removing it in the future.

I played around with it further and by connecting to the passthrough board, disconnecting, and waiting before the real connection, it appear to have consistently fixed the issue. I'll submit a fix to esptool-js and then we can also add my delay fix into here.

@mikeysklar
Copy link
Contributor Author

thank you!

@makermelissa
Copy link
Contributor

Fixed by #322.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants