Getting Cactus Micro R2 to work with Hardware Serial Monitor

I’m really confused.

I tried using the Software Serial Monitor sketch and the Hardware Serial Monitor. Neither seems to work for me.

Once I determined that R2 can’t use software-based serial, I stuck with the Hardware Monitor. All I’m trying to so is type some AT commands in the Arduino IDE’s serial monitor screen and then see the results back from the ESP8266. I believe that’s what the serial monitor sketch is intended to do. Can’t make it work.

Looking at the schematic for the R2, it looks like the internal serial connection between the ATmega chip and the ESP8266 is on D0/D1. The same pins used for uploading code and any Serial.print (etc) I/O. So how can the posted sketches that use both Serial. And Serial1. Work if they’re addressing the same pins? Or, if Serial1 doesn’t use D0/D1, what pins does it use and why isn’t the ESP8266 connected to them?

Help!

Hi,

The wiki for R2 is here. Did you upload the hardwareSerialMonitor sketch here?

The softwareSerialMonitor is work only R1. R2 used Serial1 to communication with 32u4. Please refer the Hookup Guide for more information.

I’m still trying to work with the Cactus Micro R2. I read the R2 wiki and tried the Hardware serial monitor but still no good. So I tried a very simple sketch which blinks a LED:


void setup() {
Serial.begin(9600);
pinMode(5,OUTPUT);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
Serial.println(“Hello Cactus Micro! Just Blink!”);

pinMode(13, OUTPUT);
digitalWrite(13, LOW);
};

void loop() {
// Serial.println(“In Main Code”);
while (2 > 1) {
digitalWrite(5,HIGH);
delay(1000);
digitalWrite(5,LOW);
delay(1000);
Serial.println(“Loop”);
}
}


When I do not enable the ESP8266 with digitalWrite(13,LOW) it works. I get to the Void Loop code and the LED blinks. When I enable the ESP8266 with digitalWrite(13,HIGH) I never get to the Void Loop code. Can you tell me what is going on?

I have tried other pins. Power is supplied from my computer via the USB port. Seems like when the ESP8266 is enabled, the ATmega chip stops running.

What am I missing? Thanks.

Hello,
with processors with native USB support, Serial is referred to this USB conenction.
If You want to communicate with ESP, You must use Serial1

void setup() {
Serial.begin(9600);  // USB
Serial1.begin(9600); // connection between ESP and Atmel
pinMode(5,OUTPUT); // Your LED 
while (!Serial) { // this might not be neccessarry, since You dont print any data during setup so You will not miss any message
; // wait for serial port to connect. Needed for Leonardo only
}
pinMode(13, OUTPUT);
digitalWrite(13, HIGH);

}

void loop() {

// here You can copy the ESP programmer sketch which should pass any data from USB to Serial1 and vice versa.

}

Thank you for your code. I just edited the code format for better look.

OK, thank You:)

Just to close the loop on my original post, it turns out the original Cactus Micro was defective. I received a replacement and it is working as intended using the hardwareserialmonitor. No problems. Thank you.