Home Forums EasyTransfer Library Support Forum Multiple Instances of SoftEasyTransfer

  • This topic has 2 replies, 2 voices, and was last updated 11 years ago by Anonymous.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #2949
    Anonymous
    Inactive

    So I have a need for two instances of softeasytransfer. I know that I can create two software serial instances but I’m having issues initiating two instances of the SoftEasyTransfer. The code only seems to receive the data from the last software serial port that was initialized.

    For instance if I have this in the setup

    
     PortTwo.begin(9600);
     PortOne.begin(9600);
     
     ETdata1.begin(details(one), &PortOne);
     ETdata2.begin(details(two), &PortTwo);
    

    It will read PortOne ok but won’t read PortTwo info. Swap the PortTwo.begin(9600); and PortOne.begin(9600); and it will start reading PortTwo ok.

    Any ideas? Thanks again for this library! It rocks.

    #2951
    Bill
    Member

    From http://arduino.cc/en/Reference/SoftwareSerial

    The library has the following known limitations:
    If using multiple software serial ports, only one can receive data at a time.

    So it’s not my library, it’s a limitation of SoftwareSerial on Arduino.

    #2952
    Anonymous
    Inactive

    Bill, Thanks mate! I had no idea on that limitation of Software Serial though I guess it makes sense.

    So the best bet here would probably be to write something that sends a command to one of the two devices I want to receive from and have it send its data (through your library) and receive that data then send the “get” command to the other device and wait for that to respond?

    Then its just a matter of continuing that indefinitely I guess?

    Thanks for your help mate!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.