Trying to send AT Commands - but SoftwareSerial Library clashes with GSM Library

Dear Experts,

I have two sketches that I would like to combine into one.

One sketch is executing AT commands using SoftwareSerial Lib. The other sketch is establishing and maintaining a GSM connection using GSM Lib.

When I try to get both sketches together I get the below outlined compile error (looks like there are duplicate references ...)

Any Advice on the following topics would be highly appreciated 1) how to execute AT commands without SoftwareSerial.lib (maybe using GSM Lib directly or another Alterative ...) 2) make GSM Lib and SoftwareSerial Lib work together

PS1: both sketches work perfectly in isolation PS2: I need to use GSM Lib as it is my baseline for further downstream MQTT processing.

Thanks, in advance and br, Rainer


libraries/GSM/GSM3SoftSerial.cpp.o: In function __vector_3': /Applications/Arduino.app/Contents/Java/libraries/GSM/src/GSM3SoftSerial.cpp:499: multiple definition ofvector_3' libraries/SoftwareSerial/SoftwareSerial.cpp.o:/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SoftwareSerial/src/SoftwareSerial.cpp:229: first defined here libraries/GSM/GSM3SoftSerial.cpp.o: In function GSM3SoftSerial::spaceAvailable()': /Applications/Arduino.app/Contents/Java/libraries/GSM/src/GSM3SoftSerial.cpp:487: multiple definition ofvector_4' libraries/SoftwareSerial/SoftwareSerial.cpp.o:/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SoftwareSerial/src/SoftwareSerial.cpp:394: first defined here libraries/GSM/GSM3SoftSerial.cpp.o: In function GSM3SoftSerial::spaceAvailable()': /Applications/Arduino.app/Contents/Java/libraries/GSM/src/GSM3SoftSerial.cpp:487: multiple definition of__vector_5' libraries/SoftwareSerial/SoftwareSerial.cpp.o:/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SoftwareSerial/src/SoftwareSerial.cpp:394: first defined here collect2: error: ld returned 1 exit status exit status 1

One sketch is executing AT commands using SoftwareSerial Lib.

That statement by itself makes no sense. The SoftwareSerial instance is talking to some pins that you have not defined, to which some undefined device is connected. That device may, or may not, understand AT commands.

1) how to execute AT commands without SoftwareSerial.lib (maybe using GSM Lib directly or another Alterative ...)

Simple. Get a Mega, and connect the device, whatever it is, to RX1 and TX1.

2) make GSM Lib and SoftwareSerial Lib work together

Head to Italy, and kick some ass. There was NO reason for the Arduino team to clone SoftwareSerial.

Without seeing your complete program how can we be expected to offer useful advice?

If the GSM library needs to use SoftwareSerial then I think your best option is to use an Arduino with more than one HardwareSerial port.

...R