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.
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!
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.
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.
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.
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
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.
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.