HLK-RM04 Serial problem

I am using HLK-RM04 wifi modul and this library: GitHub - chunlinhan/WiFiRM04: Arduino WiFi library for Hi-Link HLK-RM04 module

I have Arduino Uno and from some reasons when I try to run some of examples from mentioned library I got these messages:

C:\Program Files (x86)\Arduino\libraries\WiFiRM04\utility\at_drv.cpp:2207: error: 'Serial1' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\WiFiRM04\utility\at_drv.cpp:2207: error: 'Serial2' was not declared in this scope

What can I do now?

What can I do now?

  1. Post your code.
  2. Make sure that you have selected the UNO on the Tools + Boards menu.
  3. Read the notes on the page you linked to:

By default, this library will use two UARTs to communicate with HLK-RM04 module. (firmware V1.78 can support two UARTs) If you don't want to use second UART of HLK-RM04, just modify utility/wl_definitions.h and change the definition of MAX_SOCK_NUM to 1. (but the second serial port will still be initialized in utilit/at_drv.cpp)

The serial ports I used are Serial1 and Serial2, you could change them by modifying utilit/at_drv.cpp and change the definition of AT_DRV_SERIAL and AT_DRV_SERIAL1.

What exact module do you have (link)? An RS-232 version doesn't connect directly to the Arduino and may even damage it. If it's not a shield, draw a diagram of how you connected it to the Arduino.