I've setup a nano 33 to control some LED strips with BLE and created an app to create some patterns. This all works and I can send the patterns to the device over BLE. I now want to store those commands in a file so on bootup I can play the last saved pattern.
I think I've found that you cannot use BLE and WiFiNINNA at the same time? I know theres only one antenna, but I'm not trying to use BLE and Wifi, just the storage aspect of the WIFI. I guess they use the same communication pin so only one can be communicating at once?
// check for the presence of the shield:
if (WiFi.status() == WL_NO_SHIELD) {
Serial.println("WiFi shield not present");
// don't continue:
while (true);
}
// custom services and characteristics can be added as well
// begin initialization
if (!BLE.begin())
{
Serial.println("starting BLE failed!");
while (1)
;
}
Serial.println("1");
WiFiStorageFile temp = WiFiStorage.open("/fs/testfile");
Serial.println("2");
This causes it to freeze at the WifiStorage.open line as I only get "1" printed out. If I flip it so I call BLE.begin() first, then my device never starts advertising.
How do I go about reading data from BLE and then storing it in a file? I've read through the thread below and that ends up having to re-advertise after switching. I'm assuming this would cause my app to disconnect from the nano which is not ideal. My app streams the pattern over in many small packets and I wanted to save them to a file as I received them.