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

On the esp32 board, the device does not respond to the queryAnalogMapping command #145

Open
awong1900 opened this issue Apr 14, 2023 · 4 comments

Comments

@awong1900
Copy link

awong1900 commented Apr 14, 2023

Test with Firmata.js. I add some debug info.

reportVersion
queryfirmware
settings.skipCapabilities undefined
queryCapabilities
CAPABILITY_RESPONSE: [
    0,  1, 2,  3,  4,   5,
    6,  7, 8, 10, 11, 127,
  117, 16
]
queryAnalogMapping
// hang...
@pgrawehr
Copy link
Contributor

Hmmm... I can't really confirm this, but I can confirm that the reply is partially wrong (it reports an analog mapping for pins which do not even have analog support). Can you try what happens if your comment out everything but firmataExt.reset() from systemResetCallback()? I have found that the general pin resetting causes issues on ESP32, because some pins are internally reserved and shouldn't be touched.

@awong1900
Copy link
Author

awong1900 commented Apr 19, 2023

Hmmm... I can't really confirm this, but I can confirm that the reply is partially wrong (it reports an analog mapping for pins which do not even have analog support). Can you try what happens if your comment out everything but firmataExt.reset() from systemResetCallback()? I have found that the general pin resetting causes issues on ESP32, because some pins are internally reserved and shouldn't be touched.

Comment like this. It's still hang up.

void systemResetCallback()
{
  // for (byte i = 0; i < TOTAL_PINS; i++) {
  //   if (IS_PIN_ANALOG(i)) {
  //     Firmata.setPinMode(i, PIN_MODE_ANALOG);
  //   } else if (IS_PIN_DIGITAL(i)) {
  //     Firmata.setPinMode(i, PIN_MODE_OUTPUT);
  //   }
  // }
  firmataExt.reset();
}

@pgrawehr
Copy link
Contributor

I guess you need to debug that and check the raw bytes transferred. Looking at your log above, something is wrong anyway, since the CAPABILITY_RESPONSE is much longer than what's printed above. I have no javascript-experience, so I'm unable to trace down the behavior there. Since it works with other client software, I believe it's not a firmware issue, though.

@awong1900
Copy link
Author

OK, I will check inside more.

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

2 participants