Is it possible to choose which serial will transmit\recieve data

Hi! I am trying to connect UNO and esp8266, so i need to use serial port (0,1), but i power my UNO via usb, so it takes it and make serial on 0,1 ports unavalable, is it possible to force using 0,1 pins for serial instead of usb?

On a Uno pins 0 and 1 [u]are[/u] used for serial comms by default but you cannot use the serial monitor and a second serial device at the same time. If you need to connect a second serial device consider using the SoftSerial library that comes with the IDE.

You can have the serial device connected to 0,1 in the proper manner and still power it from USB no problem. Just don't use the serial monitor.

Hi! I am trying to connect UNO and esp8266, so i need to use serial port (0,1), but i power my UNO via usb, so it takes it and make serial on 0,1 ports unavalable, is it possible to force using 0,1 pins for serial instead of usb?

Why do you think pins 0 and 1 are unavailable? Just what do you want to do comport wise?

So the main point is NOT to use serial monitor to 0,1 make working, right?

I commuicate with serial using Serial.print() command. And when i use it i see it in my serial monitor window. IF i disconect my monitor will it automatically route to 0,1 port?

It's not a matter of routing. The serial monitor and pins 0 and 1 are connected together with a resistor-divider network. If you try to transmit something on the serial monitor while the connected device is also transmitting then it destroys the data from both.

However, you can open up the serial monitor to see the commands the Arduino is sending to the device. You just won't see the device's replies so you will never know if something you transmit has stomped on the device's transmissions.

I commuicate with serial using Serial.print() command. And when i use it i see it in my serial monitor window. IF i disconect my monitor will it automatically route to 0,1 port?

Well, yes, as the USB/serial chip on the uno is connected to the uno 0/1 pins, that is how you communicate with the uno using the serial monitor on your pc. You can connect other devices to the 0/1 uno serial pins as long as they don't interfere electrically with the way the TTL protocol works. The code you would use depends on what you are wanting to do. If you want to connect more than one external device tx line to the uno rx pin, then you will probably need some isolation to prevent electrical issues. I've used diodes to do this.