Home › Forums › Mayfly Data Logger › need to find WiFi Bee ESP8266 MAC address › Reply To: need to find WiFi Bee ESP8266 MAC address
Doh! I’m sorry about the missing void statements. That’s what happens when I write code on a discussion forum. Good job fixing it!
The invalid library statements are probably because you put something that wasn’t a library into the library folder, even if it was just an empty folder.  The Arduino IDE thinks everything in that C:\Users\wchudyk\Documents\Arduino\libraries folder must be a library and gets confused otherwise.
Ok, so on to the errors on the ESP8266. The board is responding to you, at least to tell you there’s been an error, so that’s a good thing. My first guess would be that your ESP8266 has an older version of the AT firmware, and is expecting a different command. Here’s a new version with some of the older commands, and a check for the modules firmware version. Depending on which version you have, these may still not get you the MAC address, but hopefully they’ll at least get us the version to track down the command that will.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
#include <Arduino.h> void setup(){ Serial.begin(115200); Serial1.begin(115200); delay(200); Serial.println("Changing ESP8266 baud, if necessary"); Serial.println("This response may not be read-able"); Serial1.println("AT+UART_CUR=9600,8,1,0,0"); // Wait for and print the response, if it's intelligible delay(100); while (Serial1.available()){Serial.write(Serial1.read());} Serial.println(); Serial1.end(); Serial1.begin(9600); Serial.println("Asking the ESP for it firmware version"); Serial1.println("AT+GMR"); Serial.println("Response:"); delay(100); while (Serial1.available()){Serial.write(Serial1.read());} Serial.println(); Serial.println("Making sure the ESP is in station mode"); Serial1.println("AT+CWMODE_CUR=1"); Serial.println("Response:"); delay(100); while (Serial1.available()){Serial.write(Serial1.read());} Serial.println(); Serial.println("A second attempt to set the ESP mode, using the older command"); Serial1.println("AT+CWMODE=1"); Serial.println("Response:"); delay(100); while (Serial1.available()){Serial.write(Serial1.read());} Serial.println(); Serial.println("Asking the ESP for its default station mac address"); Serial1.println("AT+CIPSTAMAC_DEF?"); Serial.println("Response:"); delay(100); while (Serial1.available()){Serial.write(Serial1.read());} Serial.println(); Serial.println("Asking the ESP for its current station mac address"); Serial1.println("AT+CIPSTAMAC_CUR?"); Serial.println("Response:"); delay(100); while (Serial1.available()){Serial.write(Serial1.read());} Serial.println(); Serial.println("A third attempt to get the mac address, with older command"); Serial1.println("AT+CIPSTAMAC?"); Serial.println("Response:"); delay(100); while (Serial1.available()){Serial.write(Serial1.read());} Serial.println(); } void loop(){} // do no more |