You misread what Paul said, and the objective of discussion.
Paul said you cannot change settings *before* opening the Serial port. And, when you open Serial port, the "default" settings will be applied.
In you example, all you can achieve is a small pulse on DTR/RTS. But that pulse will still exist, and is enough to reset ESP8266.
Also please note that DTR/DSR are lines not related to flow control at all.
Alvie
On 04/05/15 20:36, Wayne Holder wrote:
> Yes, if you set flow control to NONE (which I believe is the default.) Here's some Java code that shows one way to test this:
>
> SerialPort serialPort = new SerialPort(portName);
> try {
> serialPort.openPort();
> // Set to 115200 baud, 8 bits, 1 stop bit, no parity
> serialPort.setParams(115200, 8, 1, 0);
> serialPort.setEventsMask(SerialPort.MASK_RXCHAR);
> serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE);
> } catch (SerialPortException ex) {
> System.out.println(ex);
> }
> boolean loop = true;
> boolean ledState = false;
> while (loop) {
> // Toggle DTR at 1 Hz rate
> try {
> serialPort.setDTR(ledState ^= true);
> serialPort.setRTS(!ledState);
> Thread.sleep(500);
> } catch (Exception ex) {
> System.out.println(ex);
> loop = false;
> }
> }
>
> /Note: this is just a code snippet which was //extracted //from a larger program that handles and displays events created when the flow control inputs are toggled./
>
> The code will open the serial port, then alternately change the state of DTR and RTS, which I can observe via LEDs connected to each. If I comment out the two
> lines that call setDTR() and setRTS() hey each remain off (HIGH, since this is inverted logic.) Of course, both will return to the off (HIGH) state when the
> port is closed, but is expected.
>
> Wayne
>
>
> On Mon, May 4, 2015 at 10:51 AM, Paul Stoffregen <
pa...@pjrc.com <mailto:
pa...@pjrc.com>> wrote:
>
> On 05/04/2015 10:16 AM, Wayne Holder wrote:
>> As I understand it, Arduino 1.6.3 now uses JSSC to handle serial communication which, in my experience, seems to handle setting and clearing the state of
>> the RTS and DTR lines quite reliably.
>
> Sure, it gives you great control over RTS and DTR _after_ you've opened the port. RXTX did too.
>
> But can you control what happens _during_ port opening? In other words, can you open the port in such a way that DTR and RTS do not change from their
> pre-open state?
>
>
> --
> You received this message because you are subscribed to the Google Groups "Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
developers+...@arduino.cc <mailto:
developers+...@arduino.cc>.
>
>
> --
> You received this message because you are subscribed to the Google Groups "Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
developers+...@arduino.cc <mailto:
developers+...@arduino.cc>.