Arduino-esp32: Server.h not matching Arduino API

Created on 24 Apr 2019  路  9Comments  路  Source: espressif/arduino-esp32

The Arduino Server class has pure virtual begin() without parameters. The esp32 core Server.h has pure virtual begin() with parameter. Arduino networking libraries like Ethernet and UIPEthernet don't compile on esp32 core because they implement begin without parameter as required by Arduino API.

stale

Most helpful comment

there will be

All 9 comments

And your proposal is? We need to define the port for the server. How do those libraries you point to handle that?

You were presented with an issue template when you clicked New issue. Why is it so hard to fill it in?

And your proposal is? We need to define the port for the server. How do those libraries you point to handle that?

port is set with constructor for server in all Arduino networking libraries implementing Client and Server class. here is an answer on how to change the port later.

You were presented with an issue template when you clicked New issue. Why is it so hard to fill it in?

I don't have this problem, I don't use esp32 in a project. I only try to make my libraries compatible with it. I created this issue because I know about this problem a long time and the new release still has it and added one more similar in Client.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This stale issue has been automatically closed. Thank you for your contributions.

@me-no-dev Is there a fix for this?

there will be

Would be soooooo coool. Curently building with the unapproved PR with unknow side affect, hands shaking @ every line :)

Move port definition to constructor and to it like EthernetServer from arduino-libs

Workaround till then, for using WifiServer and EthernetServer (from Ethernet.h) you can define in both begin Functions in Server.h with a default implementation, non virtual:

class Server: public Print
{
public:
    void begin(uint16_t port = 0) {};
       void begin() {};
};

It's not nice but it works when you want to use WifiServer and EthernetServer in your projects

Was this page helpful?
0 / 5 - 0 ratings