ESP8266 SPI WiFi Shield ("nice to have")

Thanks.

I try to follow Arduino IDE built in functions, because upgrades in time should be compatible, as opposed to doing "by hand" and then find that after an upgrade our sw does not compile - which is bad, but not tragic - or stops working... and that is serious trouble.

The Arduino IDE's Library Manager does provide a convenient way to update libraries (as well as to install them). If the feature is enabled in preferences, the Arduino IDE even shows a notification when a new version of any installed library is available.

You can find more information on the Arduino Library Manager index here:

The library is already 100% compliant with the requirements so the only thing that would need to be done is open an issue report at:

Requesting the library to be added.

Library Manager does only allow you to update to the release versions of a library, so it is not so useful for beta testing the library in non-release states.

Oh, ok. So that explains why I don't see this lib as updateable. (I use and always have used the library manager)

Thanks.

Issued a request for adding the library to library manager, thanks for hint.

I'm glad if I was able to be assistance. Judging from what I've seen of the library and the quality of your support on this thread, I think it will be a very welcome addition!

pert:
I'm glad if I was able to be assistance. Judging from what I've seen of the library and the quality of your support on this thread, I think it will be a very welcome addition!

Kudos on that!!!!!

the Library Manager will not help to get the latest fixes. to update from GitHub, use git

Juraj:
the Library Manager will not help to get the latest fixes.

What do you mean?
Every so often the Arduino IDE warns me of library updates, so why not?

Juraj:
to update from GitHub, use git

Is there info on using git?
Or you mean downloading by hand?

On github you can download the whole repository (actually only a selected branch) using the green button "Clone or download". You will get a .zip file with the files.

gcampos:
What do you mean?
Every so often the Arduino IDE warns me of library updates, so why not?

Is there info on using git?
Or you mean downloading by hand?

Library Manager offers new releases, not partial fixes

google about git

Thanks.

bilekj:
Fixed in commit GitHub - JiriBilek/WiFiSpi at 4d12b26c8c5e80786d972e845f90f7bb858427b0
Please get new version of master library and try again.

I re-downloaded the entire lib from the root - not from this commit - and although it had a few misfires the first couple of tries, now it seems to work fine.

I added a "ticker" to WiFiSpiESP so that it blinks while connecting to the wifi network and it blinks slowly if wifimanager is enabled and gets called. After connecting, the led goes steady.
If you think this is interesting, I can send you the .ino file to publish.

@gcampos: it would be great to add an example to the library. Especially an example for wifimanager that, I admit, haven't time to try yet.
The best way would be to visit the github page of the WifiSPIESP project and add the example as a pull request.

bilekj:
Fixed in commit GitHub - JiriBilek/WiFiSpi at 4d12b26c8c5e80786d972e845f90f7bb858427b0
Please get new version of master library and try again.

I am trying it out.
On my DUE I set up a client which connects to a server (my PC).
The Due is just waiting for PC to send data.

After some time I got the following error, just once, but the system is still running:

[espspi_proxy.h:329] W: Slave tx is not ready, status 0

I was not trying for time endurance, so I don't know exactly how long after last data exchange this happened, maybe 2 to 3 hours.

Any thoughts?

Status 0 means SPISLAVE_TX_NODATA, i.e. master requested data but ESP8266 didn't have any prepared for it. A quick look in the code gives the thought:
It could mean:
a) loss of a message in SPI communication. Then after a timeout master repeats the message.
b) slow response from the internet that leads to a timeout. Hopefully master got the data later.

I wasn't able to understand if the communication was broken from the point the "Slave not ready" message was written or if it continued to run. Changes in version 0.2.0 were made especially to increase robustness of message exchange.

bilekj:
@gcampos: it would be great to add an example to the library. Especially an example for wifimanager that, I admit, haven't time to try yet.
The best way would be to visit the github page of the WifiSPIESP project and add the example as a pull request.

Jiri, treti odstavec v GitHub - JiriBilek/WiFiSpiESP at OTA_AVR_ISP_(optional)
:slight_smile:

Juraj:
Jiri, treti odstavec v GitHub - JiriBilek/WiFiSpiESP at OTA_AVR_ISP_(optional)
:slight_smile:

Sorry, my linguistic skills are not enough1 :slight_smile: :slight_smile: :slight_smile:

bilekj:
Status 0 means SPISLAVE_TX_NODATA, i.e. master requested data but ESP8266 didn't have any prepared for it. A quick look in the code gives the thought:
It could mean:
a) loss of a message in SPI communication. Then after a timeout master repeats the message.
b) slow response from the internet that leads to a timeout. Hopefully master got the data later.

I wasn't able to understand if the communication was broken from the point the "Slave not ready" message was written or if it continued to run. Changes in version 0.2.0 were made especially to increase robustness of message exchange.

When I saw the error message, I tried to send data from the server to Arduino and it received and displayed correctly.
That's why I think that the code on the DUE continued to run waiting for data, and communication was not broken, otherwise I would have other messages about reconnecting.

Here's the code:

void loop()
{
  
  if(!client.connected())
  {
       // if you get a connection, report back via serial:
      Serial.print(++count) ;
      Serial.print(" - Connecting to server: "); Serial.print(TARGET_ADDR);
      if(client.connect(TARGET_ADDR, TARGET_PORT))
      {
        Serial.println("... Connected!");
      }
      else
      {
        Serial.println("... Not connected!!!!");
        client.flush();
        client.stop();
        delay(2000);
        if(count>1000)
        {
          count=0;
          do
          {
            WiFiSpi.disconnect();
            Serial.print("\r\nAttempting to REconnect to network: "); Serial.println(ssid);
            // Connect to WPA/WPA2 network:
            status = WiFiSpi.begin(ssid, pass); // connect to specific network
            //status = WiFiSpi.begin("", ""); // connect to last succeffull connected network
            // wait 5 seconds for connection:
            delay(6000);
          }
          while(status != WL_CONNECTED);
        }
        // you're connected now, so print out the data:
        Serial.println("Connected to the network!");
      }
  }
  
  if(client.connected())
  {
    if(client.available())
    {
      Serial.println("\rFromServer---");
      while(client.available())
      {
        char c = client.read();
        Serial.write(c);
        delay(5);
      }
      Serial.println("\r\n--------------");
    }
    else
    {
       delay(20);
    }
  }
}

So then everything is as expected. An error in communication, either between master and ESP or between ESP and the internet. And the new protocol managed to sort it out :slight_smile:
FYI, I added checksum to data messages and a trivial handshaking mechanism that can resubmit the message in case it had not been delivered properly.

Edit: I meant current v0.2.0

bilekj:
@gcampos: it would be great to add an example to the library. Especially an example for wifimanager that, I admit, haven't time to try yet.
The best way would be to visit the github page of the WifiSPIESP project and add the example as a pull request.

Done!