Go Down

Topic: Trying to send AT Commands - but SoftwareSerial Library clashes with GSM Library (Read 221 times) previous topic - next topic

rgeissen

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 of `__vector_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 of `__vector_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

PaulS

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

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

Quote
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.
The art of getting good answers lies in asking good questions.

Robin2

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
Two or three hours spent thinking and reading documentation solves most programming problems.

Go Up