ConfigurableFirmata icon indicating copy to clipboard operation
ConfigurableFirmata copied to clipboard

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

Open awong1900 opened this issue 2 years ago • 4 comments

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...

awong1900 avatar Apr 14 '23 09:04 awong1900

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.

pgrawehr avatar Apr 14 '23 19:04 pgrawehr

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();
}

awong1900 avatar Apr 19 '23 05:04 awong1900

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.

pgrawehr avatar Apr 19 '23 06:04 pgrawehr

OK, I will check inside more.

awong1900 avatar Apr 20 '23 10:04 awong1900