-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues around 4k limit handling. #61
Comments
On issue #5: |
Yes, completely agree. Thanks for the detailed write up. Some issues, like the 16 KB one are not that hard to fix, buy you've already worked around that. Raw performance is something that I've wanted to spend time on, but I haven't had a need since the devices I use are very slow. Unfortunately, unless something changes, I doubt that I'll be able to get to this issue this month. My guess is that I'll get to it too late to help you, so I really, really appreciate that you submitted a test program to help me reproduce the issue. |
Regarding |
Your intuition was right. I added tcdrain(port->fd); at the end of uart_write() in uart_comm_unix.c and after call: |
Hi team.
I'm evaluating Circuits.UART for my next project.
We need to push a lot of usually small or sometimes bigger messages (50-2000 bytes) through serial line.
Performance is critical aspect here - we want to send as many messages as possible. They could be glued together on serial line (separated by <<0x7E>> byte)
After couple of days spent on testing Circuits.UART on different platforms I could summarize my observations in a list below.
Issues 1-4 could be somehow mitigated by calling UART.drain but delay introduced with such approach (27ms on RasPI3) is not acceptable.
Could you evaluate how problematic will be to solve those issues? (if you agree on such classification)
This is related to issue #26
Setup
Version: 1.3.1
OS: Linux
Platform:
PC:
Ubuntu on Intel Xeon E3-1535M, Dell 7510
Erlang 21.3.2, Elixir 1.8.1 (from erlang-solutions.com repos)
Real UART 16550A on docking station - ttyS0.
Raspberry PI, Raspberry PI3:
Latest Raspian
Erlang 20.1.5, Elixir 1.7.4 (from erlang-solutions.com repos)
ttyS0 on RasPI3, ttyAMA0 on RasPI
Expected Behavior
Sending binaries longer than 4k should return error information.
Actual Behavior
iex(1)> p = Bridge.test_start
#PID<0.159.0>
iex(2)> Bridge.test_send p, 17000
circuits_uart: Message too long: 17026 bytes. Max is 16384 bytes
** (EXIT from #PID<0.157.0>) shell process exited with reason: an exception was raised:
** (ArgumentError) argument error
:erlang.port_close(#Port<0.5140>)
(stdlib) gen_server.erl:648: :gen_server.try_terminate/3
(stdlib) gen_server.erl:833: :gen_server.terminate/10
(stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Interactive Elixir (1.7.4) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)>
13:00:56.033 [error] GenServer #PID<0.159.0> terminating
** (ArgumentError) argument error
...
...
Function UART.write returns :ok in such case.
Steps to Reproduce the Problem
Issue 1:
iex(1)> p = Bridge.test_start
#PID<0.159.0>
iex(2)> Bridge.test_send p, 17000
Issue 2:
iex(1)> p = Bridge.test_start
#PID<0.159.0>
iex(2)> Bridge.test_send p, 4200
Issue 4:
iex(1)> p = Bridge.test_start
#PID<0.159.0>
iex(2)> Bridge.test_send p, 1500, 3
Issue 5:
iex(1)> p = Bridge.test_start
#PID<0.159.0>
iex(2)> Bridge.test_send p, 1500, 3, true
The text was updated successfully, but these errors were encountered: