Skip to content

ESP Web Tools WiFI Scan fails when there is an emoji in an SSID #1

Description

@CDFER

A user has reported that the WiFi Scan functionality cannot properely render SSIDs that have emoji (Chracters that are >1Byte)

Image

Correct SSID should be: "Buzzybee 🐝 - IoT 🌏"

I had a look into it. Weirdly enough, I think the bug is in the high-level TypeScript web interface rather than the low-level C++ firmware I wrote. I use an open-source tool called ESP Web Tools, which seems to assume that each byte received over serial is a character (emoji tend to be around 4 bytes).

WiFi-Improv Library seems to not be the issue

The WiFi-Improv Library seems to be handling it all correctly here is what I get back over USB Serial:

SSID: 😎

49 4D 50 52 4F 56 01 04 0F 04 0D 04 F0 9F 98 8E 03 2D 33 38 03 59 45 53 4A

Break down:

  • 49 4D 50 52 4F 56 = "IMPROV" header
  • 01 = IMPROV_SERIAL_VERSION
  • 04 = TYPE_RPC_RESPONSE
  • 0F = response size (15 bytes)
  • 04 = command
  • 0D = total data length (13 bytes)
  • 04 = SSID length (4 bytes)
  • F0 9F 98 8E = 😎 emoji in UTF-8 (4 bytes)
  • 03 = WiFi RSSI length (3 bytes)
  • 2D 33 38 = "-38"
  • 03 = YES length (3 bytes)
  • 59 45 53 = "YES"
  • 4A = checksum

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions