Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Development
  3. Software serial Library

Software serial Library

Scheduled Pinned Locked Moved Development
2 Posts 2 Posters 2.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    ej3359
    wrote on last edited by
    #1

    Hello,

    MySensors :API is compatible with the softwareserial Library?

    I have some errors when i compile my sketch:
    SoftwareSerial\SoftwareSerial.cpp.o: In function __vector_3': C:\temp\libraries\SoftwareSerial/SoftwareSerial.cpp:305: multiple definition of __vector_3'
    MySensors\MyGateway.cpp.o:/utility/PinChangeInt.h:563: first defined here
    SoftwareSerial\SoftwareSerial.cpp.o: In function __vector_4': C:\temp\libraries\SoftwareSerial/SoftwareSerial.cpp:312: multiple definition of __vector_4'
    MySensors\MyGateway.cpp.o:/utility/PinChangeInt.h:573: first defined here
    SoftwareSerial\SoftwareSerial.cpp.o: In function __vector_5': C:\temp\libraries\SoftwareSerial/SoftwareSerial.cpp:319: multiple definition of __vector_5'

    regards
    MySensors\MyGateway.cpp.o:/utility/PinChangeInt.h:583: first defined here

    1 Reply Last reply
    0
    • A Offline
      A Offline
      adrianmihai83
      wrote on last edited by
      #2

      I get the same error when using the SoftwareSerial library. More specific, it is a known limitation that you cannot use SoftwareSerial.h and PinChangeInt.h together without altering one or another.

      Let me give you an example, I was in the same case as you are now, I wanted to use an RF ID reader (125 kHz - RDM6300) on a software serial pin, in my case was A2 (don't ask why, this was the only input pin that I have on an UNO, it is stuffed with keyboard, display, motor actuator for door opening, button for manual door opening, ringer button and NRF24 - this is my all in one entrance sensor :) ). So, what you have to do:

      pin A2 is on Port C

      • you have to disable in the SoftwareSerial.h the other intrerupts, except the one associated to PortC, that would be - PCINT1 is for Port C :

      PCINT0 is for Port B
      PCINT2 is for Port D
      PCINT3 - it is not the case of 328P so you can leave it uncommented

      so in SoftwareSerial.h comment the following for PCINT0 and 2:

      #if defined(PCINT0_vect)
      ISR(PCINT0_vect)
      {
      ReceiveOnlySoftwareSerial::handle_interrupt();
      }
      #endif

      The other thing that you have to do now is to tell PinChangeInt.h that you use Port C for other purpose. To do this, in MyGateway.cpp, ahead of the #include "utility/PinChangeInt.h" you should include the following:

      #define NO_PORTC_PINCHANGES

      Save, upload, enjoy... And don't forget to modify back what you altered.

      This assumes that you don't use intrerupts on pins...

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      16

      Online

      11.7k

      Users

      11.2k

      Topics

      113.0k

      Posts


      Copyright 2019 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • MySensors
      • OpenHardware.io
      • Categories
      • Recent
      • Tags
      • Popular