

Its just code to use a byte array to convert a 64-bit integer (which could be any 64-bit integer) to a string. I think the thing that threw me off was was that the function was named mac2String.īut if I understand your example right, that initial code I doesnt have anything specifically to do with the MAC address. My complete code for this project would be a lot to wade through, but the code I stole from provides a pretty clear example: Thanks also for your example code. The actual values is only 6 bytes long if I remember well, so its a matter of reading each byte individually and converting into its ASCII hexadecimal representation. The compiler does not know how to convert those into Strings or cStrings, so you need to do this yourself. I found one possible lead with this code ( ) but I dont understand it well enough to know how to adjust it to input ESP.getEfuseMac() and get out a string called efuseMac.Īny help or pointers in the right direction would be appreciated. I have tested your code and it looks very good, but I have the following problem: The computer did not start, and what I have done is to remove the array that generates your code through the serial monitor, and one made by me by hand with the result that I hope to obtain the following: KASSIMSAMJIs code: Code: Select 224 213 94 64 82 135 254 Expected result: Code: Select 224 213 94 225 195 133 The first three sections do well, but the rest do not. It is also possible that I lack knowledge about the process and therefore do not understand how to convert it. Pieter Hi Pieter, I am using this library: As you mention, this library apparently only does the 16 times loop with the MAC, but we are in the same, the problem is that I do not know how to convert a String with the MAC to an array of bytes. Convert Address To Bytes How To Convert A Please post a link to the library youre using, and tell us what board and hardware youre using. Satsfaction from workĪlso, you dont really need a library for WoL, its just a UDP broadcast packet with six 0xFF bytes followed by the MAC address of the device you want to wake up, repeated 16 times IIRC.

Im 99 sure that the library saves the MAC address as an array of bytes under the hood, so converting it to a string and back is not necessary.
