Questions in the process of using the RAK4270 module

Issue:
When changing between P2P mode and WAN mode
Setup:

Server:

Details:
when change mode, RAK4270 module stops. There is no response no matter what command is sent.
Is there any special procedure required when changing 2 modes?

When you switch between P2P and LoRaWAN, the module will reset and there is no OK response before the reset.
You can send a at+get_config=lora:status and parse the returned values to see whether the change was successful.

First of all thank you for your reply.

Yes, as mentioned, before changing the mode, I received a response, but after changing the mode, I did not receive a response.
maybe Do I have to wait for the module after reset?

No, there is basically no delay between sending the command and reboot.
See my attached log (It is RAK4200, but the firmware is the same as for RAK4270)

2023-02-27 16:04:22 --> LoRa (R) is a registered trademark or service mark of Semtech Corporation or its affiliates. LoRaWAN (R) is a licensed mark.
2023-02-27 16:04:22 --> 
2023-02-27 16:04:22 --> RAK4200 version:3.2.0.14
2023-02-27 16:04:22 --> UART1 work mode: RUI_UART_NORMAL, 115200, N81
2023-02-27 16:04:22 --> UART2 work mode: RUI_UART_NORMAL, 115200, N81
2023-02-27 16:04:22 --> Current work_mode:LoRaWAN, join_mode:OTAA, MulticastEnable: false, Class: A
2023-02-27 16:04:22 --> Initialization OK
2023-02-27 16:04:22 --> 
2023-02-27 16:04:39 --> at+set_config=lora:work_mode:1
2023-02-27 16:04:39 --> LoRa (R) is a registered trademark or service mark of Semtech Corporation or its affiliates. LoRaWAN (R) is a licensed mark.
2023-02-27 16:04:39 --> 
2023-02-27 16:04:39 --> RAK4200 version:3.2.0.14
2023-02-27 16:04:39 --> UART1 work mode: RUI_UART_NORMAL, 115200, N81
2023-02-27 16:04:39 --> UART2 work mode: RUI_UART_NORMAL, 115200, N81
2023-02-27 16:04:39 --> Current work_mode:P2P
2023-02-27 16:04:39 --> LoRa P2P Transfer_mode: Sender
2023-02-27 16:04:39 --> Initialization OK
2023-02-27 16:04:39 --> 
2023-02-27 16:04:49 --> at+get_config=lora:status
2023-02-27 16:04:50 --> OK work_mode: LoRa P2P
2023-02-27 16:04:50 --> Frequency:869525000
2023-02-27 16:04:50 --> Spreadfact:12
2023-02-27 16:04:50 --> Bandwidth:0
2023-02-27 16:04:50 --> Codingrate:1
2023-02-27 16:04:50 --> Preamlen:8
2023-02-27 16:04:50 --> Powerdbm:20
2023-02-27 16:04:50 --> Transfer_mode:2
2023-02-27 16:04:55 --> at+set_config=lora:work_mode:0
2023-02-27 16:04:55 --> LoRa (R) is a registered trademark or service mark of Semtech Corporation or its affiliates. LoRaWAN (R) is a licensed mark.
2023-02-27 16:04:55 --> 
2023-02-27 16:04:55 --> RAK4200 version:3.2.0.14
2023-02-27 16:04:55 --> UART1 work mode: RUI_UART_NORMAL, 115200, N81
2023-02-27 16:04:55 --> UART2 work mode: RUI_UART_NORMAL, 115200, N81
2023-02-27 16:04:55 --> Current work_mode:LoRaWAN, join_mode:OTAA, MulticastEnable: false, Class: A
2023-02-27 16:04:55 --> Initialization OK
2023-02-27 16:04:55 --> 

As you can see, after sending at+set_config=lora:work_mode:1 the boot message is coming immediately.

Are you controlling the RAK4270 from a host MCU or from a serial terminal on your computer?