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

Format ESP.getChipId as an 8 character hex instead of 7 digit decimal #18

Closed
wants to merge 1 commit into from

Conversation

don-willingham
Copy link
Contributor

Copy of arendst/Sonoff-MQTT-OTA-Arduino#289

I have two sonoff duals with chip id's of 15163478 and 15165864. Adding an eighth would work for now, but 10 should be required. Although unlikely, it's possible for UUID collisions. I have two, but as some people have greater numbers of devices, and likely purchased in batches, it's plausible the issue will come up.

ESP.getChipId() returns a 32 bit integer, which can range up to 2,147,483,647. That would require 10 decimal digits. When I was experimenting with simply adding 1 to the UUID for the second channel on a dual, the UUID for both channels would match. They didn't differ as the least significant digit(s) were truncated. My https://github.com/don-willingham/Sonoff-MQTT-OTA-Arduino/tree/dual-wemo branch appends another digit for channel number to the UUID's.

@arendst
Copy link
Owner

arendst commented Feb 3, 2017

Don did you check the result (8 hex digits). I ask as I failed to get all 8 digits once tried the same.

If so I will implement.

@don-willingham
Copy link
Contributor Author

Here's a test...

  1. Flashed 3.9.10 to ESP-01
  2. Enabled WeMo emulation
  3. Browsed to /setup.xml URL, and it contains 201612K1292396
  4. Browsed to /in URL, and it contains ESP Chip id 1292396, oops, 7 digits, unlike the 8 of my sonoff.
  5. Replaced ESP.getChipId() in xdrv_wemohue.ino with 15163478 from one of my sonoffs.
  6. Browsed to /setup.xml again, and it contains 201612K1516347, which is missing the 8.
  7. Updated to this patch, replaced ESP.getChipId() with 15163478, and now its 201612K00E76056
  8. Google search "15163478 to hex" and it returns 0xE76056; but that's not padding with zeros, and we don't need the 0x,

So it will depend on what ESP.getChipId() returns for each sonoff/esp-whatever. Since it's a 32 bit integer.

arendst added a commit that referenced this pull request Feb 4, 2017
3.9.11 20170204
* Fix command I2Cscan
* Fix not allowed spaces in Topic, ButtonTopic and SwitchTopic
* Make all TELEMETRY, STATUS and COMMAND message topics unique (#4)
* Advertise command topic to be used by iobroker (#299)
* Fix butten (non)detection if no GPIO_KEY1 is defined (#13)
* Change WeMo serialnumber from 7 decimal chars to 8 hexadecimal chars
(#18)
* Update web page with Build Date/Time, Emulation and mDNS Discovery and
Advertise information (#21)
arendst added a commit that referenced this pull request Feb 4, 2017
3.9.11 20170204
* Fix command I2Cscan
* Fix not allowed spaces in Topic, ButtonTopic and SwitchTopic
* Make all TELEMETRY, STATUS and COMMAND message topics unique (#4)
* Advertise command topic to be used by iobroker (#299)
* Fix butten (non)detection if no GPIO_KEY1 is defined (#13)
* Change WeMo serialnumber from 7 decimal chars to 8 hexadecimal chars
(#18)
* Update web page with Build Date/Time, Emulation and mDNS Discovery and
Advertise information (#21)
@arendst arendst added the enhancement Type - Enhancement that will be worked on label Feb 4, 2017
@arendst arendst closed this Feb 4, 2017
ascillato added a commit that referenced this pull request Jun 5, 2018
curzon01 pushed a commit to curzon01/Tasmota that referenced this pull request Sep 6, 2018
3.9.11 20170204
* Fix command I2Cscan
* Fix not allowed spaces in Topic, ButtonTopic and SwitchTopic
* Make all TELEMETRY, STATUS and COMMAND message topics unique (arendst#4)
* Advertise command topic to be used by iobroker (arendst#299)
* Fix butten (non)detection if no GPIO_KEY1 is defined (arendst#13)
* Change WeMo serialnumber from 7 decimal chars to 8 hexadecimal chars
(arendst#18)
* Update web page with Build Date/Time, Emulation and mDNS Discovery and
Advertise information (arendst#21)
curzon01 pushed a commit to curzon01/Tasmota that referenced this pull request Sep 6, 2018
3.9.11 20170204
* Fix command I2Cscan
* Fix not allowed spaces in Topic, ButtonTopic and SwitchTopic
* Make all TELEMETRY, STATUS and COMMAND message topics unique (arendst#4)
* Advertise command topic to be used by iobroker (arendst#299)
* Fix butten (non)detection if no GPIO_KEY1 is defined (arendst#13)
* Change WeMo serialnumber from 7 decimal chars to 8 hexadecimal chars
(arendst#18)
* Update web page with Build Date/Time, Emulation and mDNS Discovery and
Advertise information (arendst#21)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Type - Enhancement that will be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants