Skip to content

Conversation

@Kiliar
Copy link

@Kiliar Kiliar commented Aug 23, 2024

You can improve pulling logic on unix systems, by changing recursion to endless loop with some delay.

@skadisch
Copy link

This will unfortunately not solve my problem, which is USB serial port disconnect. In this case, read will return 0, not an error. So this loop will run endlessly.

@Kiliar
Copy link
Author

Kiliar commented Aug 23, 2024

Oh.... so you have an issue when serial connection is up, but no data can be send or received using this lib? I had a similar issue and found a workaround by calling simple python script that will initialize serial port & send some data. It helps me most of the time, maybe it will help you to find proper solution.

import sys
import serial
import crc8

serial = serial.Serial()
serial.port = sys.argv[1]
serial.baudrate = int(sys.argv[2])

serial.open()

msg = bytearray.fromhex("0101")

hash = crc8.crc8()
hash.update(msg)
c = hash.digest()
serial.write(msg)
serial.write(c)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants