Problem with Thixtra library and SoftwareSerial


I trying to use softwareSerial with the thinxtra xkit board.

I get an error when I only have the following code

#include <Tsensors.h>
#include <SoftwareSerial.h>

void setup() {
  // put your setup code here, to run once:


void loop() {
  // put your main code here, to run repeatedly:


I had all my code written but was failing. I thought to complie the basic code above and this also fails with the same error
here is the error which I get
C:\Users\SIDDHA~1\AppData\Local\Temp\arduino_build_407723\libraries\SoftwareSerial\SoftwareSerial.cpp.o (symbol from plugin): In function SoftwareSerial::read()':** **(.text+0x0): multiple definition of __vector_4’
C:\Users\SIDDHA~1\AppData\Local\Temp\arduino_build_407723\libraries\Tsensors\Tsensors.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status

Kindly help me resolve the issue


(.text+0x0): multiple definition of `__vector_4'

you have two libraries needing the same resource (likely Pin Change Interrupt)


Thanks for the reply and that seems to be the reason.

I cannot do away with Tsensor.h

Can you please suggest me a solution for the same.

I have tried NeoSWSerial but that also posses the same problem.

Kindly help

The easy way is to use a more capable Arduino... one with multiple hardware Serials or if you don't need Serial port after uploading then use the pin 0 and 1 for Serial exchange (of course means you can't use that for debug)


But are there no solution to the above problem apart from going with a new hardware

Well there might be way - but if you have racing conditions triggering interrupts and need to maintain critical timing on Serial then you are looking for trouble with a Software Serial implementation

If the UNO is mandatory and you don’t use the only Serial port besides debug, then use that one…

Actually, The HardwareSerial on the UNO is talking to the Thinxtra board

So i have to use the hardware serial and cannot use it for anything else

and only the ANALOG PINS are VACANT for me to put any other devices. so thought of using software serial

But its conflicting with the THNXTRA library

siddharthtaunk: Actually, The HardwareSerial on the UNO is talking to the Thinxtra board

ah OK - I'm not familiar with that board

In the library they do this

unsigned long lasttimeButton = 0;
ISR(PCINT1_vect) {    // Interrupt service routine. Every single PCINT8..14 (=ADC0..5) change
            // will generate an interrupt: but this will always be the same interrupt routine
    unsigned long currenttime = millis();
    unsigned long interval = (unsigned long)(currenttime - lasttimeButton);
    if ( (digitalRead(buttonPin)==0) & (interval > 200) ) {
    lasttimeButton = currenttime;

if you don't use the button or whatever is on Analog Pins with their board, then you could try to comment out this ISR from their library...


Thanks This worked.

I commented out the ISR andeverything works as expected.

Thanks aagain

great :)