Hello,
I have a Nano talk to a PZEM017 and a PZEM014 device.
The PZEM017 is a DC energy meter working with 9600 8N2.
The PZEM014 is a AC energy meter working with 9600 8N1.
So as SoftwareSerial does not support 8N2 I used CustomSoftwareSerial.
The PZEM017 only works with the CustomSoftwareSerial with 9600 8N2.
Now to make matters more complicated, the PZEM014 does not work with the CustomSoftwareSerial in 9600 8N1, but it does work with the SoftwareSerial. I have no idea, why that is, I suspect some timing and delay differences.
So I got them PZEMs working in two seperate sketches, but when mergin' the sketches, I get the error of multible definitions of __vector_3, __vector_4 and __vector_5.
Arduino: 1.8.9 (Windows 10), Board: "Arduino Nano, ATmega328P (Old Bootloader)"
libraries\SoftwareSerial\SoftwareSerial.cpp.o (symbol from plugin): In function SoftwareSerial::read()':** **(.text+0x0): multiple definition of
__vector_3'
libraries\CustomSerial\CustomSWSerial.cpp.o (symbol from plugin):(.text+0x0): first defined here
libraries\SoftwareSerial\SoftwareSerial.cpp.o (symbol from plugin): In function SoftwareSerial::read()':** **(.text+0x0): multiple definition of
__vector_4'
libraries\CustomSerial\CustomSWSerial.cpp.o (symbol from plugin):(.text+0x0): first defined here
libraries\SoftwareSerial\SoftwareSerial.cpp.o (symbol from plugin): In function SoftwareSerial::read()':** **(.text+0x0): multiple definition of
__vector_5'
libraries\CustomSerial\CustomSWSerial.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino Nano.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
It might be, that both interfaces use the same interrupts. Yet, I'm not sure.
I have no idea, how I can resolve that problem.
I can add the entire code, but it is quite extensive and maybe it is possible to give me some hints without me using extensive time to create a small demo version of it.
Thanks in advance.