I am having strange situation with my new Arduino Giga.
I took program from tutorial , copy, paste and more or less it is working as expected.
The WebServer as AP is not working but connecting to other network is working fine.
So i was thinking it will be simple and proceeded with integrating into my project (made on Due with ethernet shield)
So here is strange situation.
If i will declare WifiServer and WifiClient in the main file, it is working fine.
However if i will use additional file and define that file .h into main project file the compiler is happy and loads the program into device.
But looks like it is having some dummy references now because it is garbage.
- WifiServer defined in 2nd file will never work (my browser is not able to connect)
If i will declare WifiServer in the main file and pass pointer to it to class or function in the other file it is working (almost). - So once i have this situation that WifiServer defined in main file. I have class that is using pointer to it to detect connection and so on.
And it is working to detect connections but not able to get incoming message:
WiFiClient httpclient = (*serverHTTP).available();
// this is working ,
// also serverHTTP->available(); will work
if (httpclient) {
//it is not 0 pointer and get in
if(debug)Serial.println("new client");
//i can see print in serial
int incommingMsgLen = 0;
if (httpclient.connected()) {
//it is getting into this condition, so it is working for connected
incommingMsgLen = httpclient.available();
// this returns 0
httpRequest.reserve(incommingMsgLen);
if (debug) {
Serial.print(F("Incomming Msg Length: "));
Serial.println(incommingMsgLen);
// this will print out 0
Again if i will put the same code in main file, it will work
I am adding #include <Wifi.h> in both files and i and suspecting that this is an issue