esp32_bluetooth_classic_sniffer icon indicating copy to clipboard operation
esp32_bluetooth_classic_sniffer copied to clipboard

Cross-platform compatibility

Open Kevin4562 opened this issue 1 year ago • 0 comments

It appears that Bluekitchen supports Windows and the serial connection should be agnostic of the system. Is there any reason that the sniffer could not run on a Windows system after minor modifications?

Attempting even the ES32_CMD_VERSION over a Window's COM port responds with malformed data, curious on what the difference between the two serial connections are?

import serial
import time

ESP32_CMD_VERSION = b'\xEE'

serial_port = 'COM8'


def reset_firmware(wait_reset=True, soft_reset=False):
    if soft_reset is False:
        ser = serial.Serial(serial_port, 921600, rtscts=False, dsrdtr=False)
        ser.rts = True
        ser.dtr = True
        ser.dtr = False
        ser.dtr = True
        ser.close()
        ser = None
        print('[!] Reset Done! EN pin toggled HIGH->LOW->HIGH')


def get_version():
    serial_con = serial.Serial(serial_port, 921600, rtscts=0, xonxoff=0, timeout=1)
    serial_con.write(ESP32_CMD_VERSION)
    version_string = serial_con.readline()
    print(version_string.decode('utf-8', errors='ignore'))


reset_firmware()
time.sleep(0.8)
get_version()

Same code works fine on Ubuntu, does not work on Windows

Kevin4562 avatar Aug 17 '23 03:08 Kevin4562