![]()
this is what the code posted in the link you gave does. When set to 1 it indicates that the MAC address was set manually by an administrator, rather than burned into the network card and. The actual values is only 6 bytes long if I remember well, so it’s a matter of reading each byte individually and converting into its ASCII hexadecimal representation. #HOW TO CONVERT A STRING INTO NETWORK MAC ADDRESS HOW TO#The compiler does not know how to convert those into Strings or cStrings, so you need to do this yourself. #HOW TO CONVERT A STRING INTO NETWORK MAC ADDRESS 64 BITS#You use a 64 bits (8 bytes) long integer. For example, if I had my string stored at Locals.String, and I wanted the value at Locals. If you convert the first 4 bytes of your string, and multiply by 232, then add the last 8 bytes, you will have a number that will not lose any precision. When you do something like uint64_t espChipID = ESP.getEfuseMac() You will just have to do some math to convert it on your own. I won’t comment on the use of the String class, you know the pitfalls. ![]() What is clientHTTPMagicMirror? which library is being used? is there a way to post params independently? what is postAttributeFirmware, firmwareCode etc ? They are likely Strings indeed ut don’t post snippets ( Snippets R Us!) ![]() I found one possible lead with this code ( ) but I don't 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. The inetntoa() function converts the Internet host address in, given in network byte order, to a string in IPv4 dotted-decimal notation. Unless someone can suggest another workaround, I think I need efuseMac and wifiMac to be strings as well. I'm no expert, but I believe this is concatenating a bunch of string to form the post. String payloadMagicMirror = clientHTTPMagicMirror.getString() The code for sending the data is: int returnCodeMagicMirror = clientHTTPMagicMirror.POST( postAttributeFirmware + firmwareCode + postAttributeEfuseMac + efuseMac + postAttributeWiFiMac + wifiMac + postAttributeSensorID + sensorID + postEnd ) My Arduino (technically an ESP32) sends some json data to my MagicMirror using HTTP POST. I'm pretty sure that someone is going to say, "Why are you doing this? You shouldn't use a string." So here's my situation: My basic question is how can I convert the units MAC address (from ESP.getEfuseMac() and/or WiFi.macAddress() ) into a string I'm pretty sure that someone is going to say, 'Why are you doing this You shouldn't use a string.' So here's my situation: My Arduino (technically an ESP32) sends some json data to my MagicMirror using HTTP POST. >from getmac import getmacaddress as gma >print (gma ()) 3c:7e:94:8f:d0:34. To get the physical address of the device we use getmac module of Python. This article aims at extracting MAC address of computer using Python. My basic question is how can I convert the units MAC address (from ESP.getEfuseMac() and/or WiFi.macAddress() ) into a string? Helps in uniquely identifying computers from other computers around the world. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |