-
Notifications
You must be signed in to change notification settings - Fork 16
Conversation
Isn't this just a matter of a value being interpreted as 32 bit signed value? |
I think javascript uses by default 64 bit singed, I'm not sure. In any case, it's the unpack/pack functions in the utils.ts that do the conversions... but I don't really fully understand how they work, so perhaps you are right and the original magic value that esptool uses to identify ESP8266, 0xfff0c101, might not be read and interpreted correctly... The actual integer being read is -999167 which happens to be the decimal from signed 2's complement value for 0xfff0c101. When I used to have the CHIP_DETECT_MAGIC_VALUES with integer keys, it would not find that key, probably because it is a negative integer.... I'm going to think a bit more about it to try and get that toHex function to return the signed 2 compliment value.... |
If it uses 64 bit values and you try to convert a negative value into HEX, you should get a lot of leading |
src/const.ts
Outdated
[-999617]: { name: "ESP8266", family: CHIP_FAMILY_ESP8266 }, | ||
0x00f01d83: { name: "ESP32", family: CHIP_FAMILY_ESP32 }, | ||
0x000007c6: { name: "ESP32-S2", family: CHIP_FAMILY_ESP32S2 }, | ||
0x00000009: { name: "ESP32-S3", family: CHIP_FAMILY_ESP32S3 }, | ||
0x9: { name: "ESP32-S3", family: CHIP_FAMILY_ESP32S3 }, | ||
0xeb004136: { name: "ESP32-S3(beta2)", family: CHIP_FAMILY_ESP32S3 }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doubt this one will also be matched as expected. ( 0xeb004136
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TD-er I am going to merge this fix and release so that we fix ESP8266 devices. If S3 doesn't work, let's address that in another PR. @conradopoole has ordered a couple of ESPs so we can better test moving forward. |
Changed keys of CHIP_DETECT_MAGIC_VALUES to Strings as the new magic value being added is a negative one and cannot be used as a key.