B4R Question Softwareserial not working on Wemos D1 Mini ESP2866

Discussion in 'B4R Questions' started by atiaust, Sep 25, 2019.

  1. atiaust

    atiaust Active Member Licensed User

    Hi All,

    I posted earlier about problems with SoftwareSerial on a Wemos D1 mini board not communicating intermittently or not at all.

    From research it appears that it is a known problem and is something to do with interrupt conflict with the wifi channel.

    There is an alternative library (attached). Can this be used in place of the rSoftwareSerial library?

    Has anyone else experienced the same problem?

    Thanks
     

    Attached Files:

  2. thetahsk

    thetahsk Active Member Licensed User

  3. emexes

    emexes Well-Known Member Licensed User

    Can you
    Can you slow down the baud rate from the barcode reader? Or is it that the wifi library is disabling the serial input pin's interrupt-on-change altogether?
     
  4. atiaust

    atiaust Active Member Licensed User

    Thanks

    I have many of these working successfully for simple operations like this.

    Will look at your suggestions.
     
  5. atiaust

    atiaust Active Member Licensed User

    Hi emexes,

    The baud is fixed at 9600.

    I have put an oscilloscope in the input pins and the data is present but the Wemos will not acknowledge it.
    I have been trying different pins to see if that makes any difference but nothing concrete yet.
     
  6. emexes

    emexes Well-Known Member Licensed User

    Well, was worth a try!

    The fact that you are receiving nothing, vs receiving corrupted bytes, makes me think that the software serial uses a pin-change interrupt or possibly a periodic timer, and that this is being disabled or blocked for longish periods by wifi interrupts.

    I am thinking hard of a workaround, but so far nothing. My next step would be to dump the interrupt config registers before and after starting the wifi and serial interfaces, see if that is indeed the problem. And see if the serial interface works ok for > first packet if wifi is commented out.
     
  7. atiaust

    atiaust Active Member Licensed User

    I was going to try disabling / removing the wifi component and just monitor the SoftwareSerial and see if works.

    I am also feeding the same data into a RS232 /USB adapter and monitoring it with Termite on my PC and it is all OK.
     
    emexes likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice