SoftwareSerial.h suddenly missing

Hi
I have suddenly a peculiar problem: The library SoftwareSerial.h seems to be missing suddenly. I get an "exit status 1" compilation error saying the library cannot be found and the Library Manager cannot show it (though it comes up with a host of other SWSerial libraries).

The same sketch compiled last week - what has changed?

I tried to replace the library with one of the newer ones, but it turns out that another library I include (AdaFingerprint.h) also seems to rely on this one, so I would rather avoid the trouble of having to fix that as well.

I have tried to shut down Arduino IDE and restart computer, didn't help. Will I have to reinstall the IDE?

Best regards

what's the exact error you see when you compile? can you share a copy/paste of the text from the verbose compilation output?

Not all boards (board packages) support SoftwareSerial. So which board are you compiling for? Is that the same board as a week ago?

The error code presently is this.

In file included from C:\Users\laere\Documents\Arduino\fingerprinostNeo\fingerprinostNeo.ino:18:0:
C:\Users\laere\Documents\Arduino\libraries\AdaFingerprint/Adafruit_Fingerprint.h:19:11: fatal error: SoftwareSerial.h: No such file or directory
  #include <SoftwareSerial.h>
           ^~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1

Compilation error: exit status 1

This is after I tried to replace SoftwareSerial.h with PostNeoSWSerial.h - but as mentioned, it would seem that the other library actually also references SoftwareSerial.h

The board is a Nano 33 IoT - it is identical to the one I used last week although not the same

The Nano 33 IoT board package does not have a SoftwareSerial library. I do not know what the difference is between last week's compile and now; last week you might have (accidentally) compiled for a Classic Nano.

You can check the SAMD board package that is installed,

Please explain.

@sterretje Thanks - meeh, I didn't know that. I tried to look it up in the SoftwareSerial reference but only found issues mentioned of specific pins of som other boards, so I assumed it would work.

How/where do I find this SAMD board package? And how do I see what libraries are and are not available on other boards, eg. Nano 33 Sense Rev2 (which I also have here)?

And first and foremost - how can I get around this issue right now? Could I try to compile for a classic Nano and hope for the best?

BTW: "although not the same" refers to me buying a new Arduino 33 IoT board and trying to install the sketch on that one, too. This because last week, when the sketch compiled and ran, I did not mention that it actually didn't run properly. It compiled, and it started, but then it stopped working. I assumed it would be the fingerprint scanner being damaged, so I have bought a new one, and another Arduino 33 IoT just for good measure. But maybe damaged hardware was not the problem after all...

I currently don't have access to a Windows system and I don't have access to an IDE 2.x install. So this is from memory. The board package is installed in a subdirectory of Arduino15; it's somewhere in your AppData. Note that AppData might be hidden by Windows and you need to enable "show hidden folders" in Windows explorer.

You can probably find the exact directory if you enable verbose output during compilation in file / preferences. It will state something like "using core from .....".

This is part of the path for SAMD boards on my Linux system: packages/arduino/hardware/samd/1.8.14. In there you will find a libraries directory that contains the libraries that are supported by Arduino for that board package.

drwxr-xr-x 2 wim wim 4096 Jan 23 10:31 HID
drwxr-xr-x 4 wim wim 4096 Jan 23 10:31 I2S
drwxr-xr-x 4 wim wim 4096 Jan 23 10:31 SAMD_AnalogCorrection
drwxr-xr-x 5 wim wim 4096 Jan 23 10:31 SAMD_BootloaderUpdater
drwxr-xr-x 5 wim wim 4096 Jan 23 10:31 SBU
drwxr-xr-x 5 wim wim 4096 Jan 23 10:31 SDU
drwxr-xr-x 5 wim wim 4096 Jan 23 10:31 SFU
drwxr-xr-x 5 wim wim 4096 Jan 23 10:31 SNU
drwxr-xr-x 3 wim wim 4096 Jan 23 10:31 SPI
drwxr-xr-x 5 wim wim 4096 Jan 23 10:31 SSU
drwxr-xr-x 4 wim wim 4096 Jan 23 10:31 USBHost
drwxr-xr-x 3 wim wim 4096 Jan 23 10:31 Wire

If you search the same path for AVR boards like Classic Nano (partial path: packages/arduino/hardware/avr/1.8.6/libraries)

drwxr-xr-x 4 wim wim 4096 Nov 23  2021 EEPROM
drwxr-xr-x 3 wim wim 4096 Nov  2  2022 HID
drwxr-xr-x 4 wim wim 4096 Dec 11  2017 SoftwareSerial
drwxr-xr-x 4 wim wim 4096 Nov  2  2022 SPI
drwxr-xr-x 4 wim wim 4096 Nov  2  2022 Wire

Have you used pins 0 and 1 on your board? If not, they are Serial1 and you should be able to use them as Serial1.

You can always hope but it will not work :wink: And when using the IDE you will not be able to compile for a Classic Nano and next upload the generated code to the Nano 33 IoT.

@sterretje Thank you - I found the Arduino15 folder and the SAMD-folder, looks like yours (though of course Windows-styled). Hmm - I simply cannot fathom what precisely I did last week to think it worked, as that is patently impossible. But your help is very much appreciated.

Using pins 0 and 1 as Serial1, you say. I will have to try that. But wouldn't that create conflicts with onboard serial protocols? I will be using the BluetoothLE and possibly also the USB in the end product?

Your board supports native USB; that is used for communication over USB. No UART (HardwareSerial) is involved. This is where your board differs from Mega/Uno/Nano which use one UART for the communication over USB with the PC.

I'm not sure about the BLE, I will have to look at the schematic.

Yeah - I will try to test it. And I still have the problem of not having a library for the fingerprint scanner which works with the Nano 33 (and without itself relying on SoftwareSerial). If I find a solution, I will link it here. But thank you so much for your time and inputs

I had a look at the schematic and Tx and Rx are not used by the Ublox Nina W102.

Which fingerprint scanner are you using? Does it support serial communication and/or SPI and/or I2C?

What did you want to use the SoftwareSerial for? The Adafruit FingerPrint library?

@sterretje So - had to run, but I'm back again, and once more thanks for your feedback

The new fingerprint scanner I acquired is this: DFRobot Fingerprint Scanner. It is labeled ZFM60, so I assume it is an updated version of the older Adafruit sensor labeled ZFM20, which I had - it looks the same too, but stores a lot more fingerprints. It is still, as far as I can see, only communicating by TTL. So it is nice to know I can use pins 0 and 1 and not messing something else up. But the DFRobot page is not that informative, no Data Sheet or other documentation, and just the same very old code examples made for UNO on IDE1.8.6

So yes, I am looking to use the Adafruit Fingerprint Library, mostly because I got it working previously with the older scanner, which now seems to be malfunctioning (I tried it on an UNO, still no real luck).

And the good thing is that it seems the Adafruit Library I tried to use was much too old. The updated and renamed Library compiles and uploads to the 33 IoT. So I am suddenly a lot more optimistic.

2 Likes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.