Newbie question about web server on serial

How can I make a webserver running on the Arduino mini to communicate on serial port ? More specifically I have a HLK-RM04 WiFi module, configured as a client, which is connected to the Arduino mini serial port. I wish I could access the server which runs on the the mini, through wifi RM04 module. I tried for this purpose to use Chunlinhan WiFiRM04 library on Github, but after compilation I get a file too large to load on arduino mini . Basically I'm not interested in wifi module configuration routines from this library, because I configure it manually, but how can I make it work web server on serial connection ? Thanks .

Where are the links to the hardware and libraries used?

https://github.com/chunlinhan/WiFiRM04

Comment out the line

#define _DEBUG_

in at_drv.cpp to get rid of the debugging code and it will fit into your Mini's flash memory. Keep in mind that this software is written for a Mega and therefor may crash on the Mini because of RAM limits.

Ok, leave aside this library. I put the question differently : is it possible to have a file server over serial port of an Arduino mini, server on which it can be accessed from any browser without installing additional software on the client ? How should look the code for this server ? Thanks .

is it possible to have a file server over serial port of an Arduino mini, server on which it can be accessed from any browser without installing additional software on the client ?

No, because a serial port is not able to handle network traffic and a web server answers tcp/ip network requests on port 80 by definition. But if you add special hardware to that serial port that does all the network processing and communicates only the relevant content over a serial interface to a microcontroller, you might get what you probably want to achieve.

Ok, leave aside this library.

I provided you a solution for your problem. Why are you now changing directions? What do you want to achieve? If you want to answer HTTP requests on your Arduino Mini this library together with the hardware you seem to already own make a not so bad combination.

That's what I want to do: I use special hardware that RM04, and Arduino to process only the relevant information about the webserver, without process information about TCP / IP or SPI Ethernet communication .If I want to do all of these things, I need a more powerful processor , ex ATMEGA 644 or ATMEGA 1284 and are not willing to use such a processor . Basically, all the communication is provided by RM04 module, that I can manually configure from the browser interface, I do not need the Arduino processor to do this . Instead I could use a cheaper processor, ie Attiny series or Atmega48,88, etc, to run a webserver that monitor some ports. Anyway ... thanks for your attention !

The RM04 can handle most of the network stuff for you but you need kind of a protocol on the serial interface to handle some basic network stuff. That's what the library takes off of you. With the slight modification of my first post you'll get a working solution with a basic web server answering requests the way you want to have it. You don't need a more powerful processor. An ATmega644/1284 has the same power as an Arduino UNO, BTW, it has just a bit more RAM, flash and more IO pins.