Fazecast / jSerialComm

Platform-independent serial port access for Java
GNU Lesser General Public License v3.0
1.34k stars 287 forks source link

Raspberry Pi -> USB Serial -> D1 mini (ESP8266) setting baud rate to 74880 does not work. #561

Open thorsten-l opened 6 months ago

thorsten-l commented 6 months ago

Hi i have connected an D1 mini (ESP8266) to a Raspberry Pi 4 running the latest Raspberry Pi OS - 64bit, 12 (bookworm). If i want to see the boot loader messages from the ESP8266 i have to use 74880 as baud rate.

Device:

crw-rw---- 1 root dialout 188, 0 19. Mai 11:11 /dev/ttyUSB0

My user is member of the dialout group.

lsusb:

Bus 001 Device 006: ID 1a86:7523 QinHeng Electronics CH340 serial converter

As general communication check i used picocom --imap lfcrlf -b 74880 /dev/ttyUSB0 and it works fine.

the java (jSerialComm,2.11.0) initialization code for the serial port:

    SerialPort serial = SerialPort.getCommPort("/dev/ttyUSB0");

    if (serial.openPort())
    {
      serial.setComPortTimeouts(SerialPort.TIMEOUT_READ_BLOCKING, 0, 0);
      serial.setFlowControl(SerialPort.FLOW_CONTROL_DISABLED);
      serial.setComPortParameters(
        74880, 8, SerialPort.ONE_STOP_BIT, SerialPort.NO_PARITY);

      OutputStream os = serial.getOutputStream();
      InputStream is = serial.getInputStream();
   ...

The communication between RPi and D1 works, but it is still 9600 baud. So i could not see the boot loader messages.