Code Monkey home page Code Monkey logo

Comments (12)

xzzh999 avatar xzzh999 commented on July 20, 2024

and sometimes can not recv any data...

from aioserial.py.

mrjohannchang avatar mrjohannchang commented on July 20, 2024

Do you have baud and other settings configured correctly?

from aioserial.py.

xzzh999 avatar xzzh999 commented on July 20, 2024

@changyuheng
yes, i make sure the configure is correct.

self.ins = aioserial.AioSerial(port=self.port, 
                      baudrate=self.baudrate, stopbits=self.stopbit, bytesize=self.databit)

from aioserial.py.

mrjohannchang avatar mrjohannchang commented on July 20, 2024

Are you able to get correct information through other terminal applications such as minicom?

from aioserial.py.

xzzh999 avatar xzzh999 commented on July 20, 2024

yes, i use pyserial-asyncio, it's correct...

from aioserial.py.

mrjohannchang avatar mrjohannchang commented on July 20, 2024

Can you please try with pySerial as the APIs of it are more similar with aioserial?
And please also post both code snippets based on pySerial and aioserial and their results here.

from aioserial.py.

xzzh999 avatar xzzh999 commented on July 20, 2024

I make two serial port COM5 and COM7, and connect them together, i send very simple data to COM5, so COM7 can print the data, the code is very simple, just like as the read me:

self.ins = aioserial.AioSerial(port=self.port, baudrate=self.baudrate, 
     stopbits=self.stopbit, bytesize=self.databit)
 while True:
    print((await self.ins.read_async()).decode(errors='ignore'), end='', flush=True)

just open a port, and keep reading, and use many other serial port tools to send data.

from aioserial.py.

mrjohannchang avatar mrjohannchang commented on July 20, 2024

Hi, I see you may be a Chinese. Do you want to talk in Chinese instead? 中文可能比較方便溝通

from aioserial.py.

xzzh999 avatar xzzh999 commented on July 20, 2024

可以的。
就是我有2根USB串口线互联,分别对应COM5和COM7, 用串口工具测试收发数据,aioserial的发送总是正常的,但是接收是错误的数据。

from aioserial.py.

mrjohannchang avatar mrjohannchang commented on July 20, 2024

Can you please do the same test with both pySerial and aioserial, respectively? Please also post the results of both of the tests here. Because the major difference between pySerial and aioserial are the async feature of the functions provided in aioserial, I hope to see 2 similar test codes and their results side by side. Another reason reason I chose pySerial here for benchmarking is, aioserial pretty much just call the APIs provided by pySerial with an async wrapper, the root cause might be in pySerial.

可以麻煩分別用 pySerialaioserial 做一樣的測試,並把程式碼和結果都在這邊分別列出來嗎?因為 pySerialaioserial 的 API 非常像,差別只在於 aioserial 的 API 是 async,希望您能用相似的測試程式碼分別以二個不同的 library 為基礎做測試,並分別列出結果。選用 pySerial 來做比較除了因為 API 相似外,還因為 aioserial 的所有 API 都是直接以 pySerial 的 API 為基礎,問題很有可能是出在 pySerial 身上。

Test cases:

  1. pySerial send() -> pySerial receive()
  2. pySerial send() -> aioserial receive()
  3. aioserial send() -> pySerial receive()
  4. aioserial send() -> aioserial receive()

from aioserial.py.

xzzh999 avatar xzzh999 commented on July 20, 2024

ok, i will do that later, for now i must complete my project stuff first..

from aioserial.py.

mrjohannchang avatar mrjohannchang commented on July 20, 2024

Any updates @xzzh999?

from aioserial.py.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.