Skip to content
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

Add UART support for IIOD #560

Closed
tfcollins opened this issue Jun 24, 2020 · 6 comments · Fixed by #665
Closed

Add UART support for IIOD #560

tfcollins opened this issue Jun 24, 2020 · 6 comments · Fixed by #665
Assignees
Milestone

Comments

@tfcollins
Copy link
Contributor

Request: https://ez.analog.com/linux-software-drivers/f/q-a/167536/iio-oscilloscope-through-serial-uart-backend-on-custom-board

@rgetz rgetz self-assigned this Jun 25, 2020
@rgetz rgetz modified the milestones: 0.21 Release, v0.22 Release Jun 25, 2020
@rgetz
Copy link
Contributor

rgetz commented Jul 4, 2020

When doing this - it would be nice to return a list of available serial ports in the main library. This would ensure that end applications didn't need to link to libserial directly, and would just use libiio...

something like: ret = iio_serialports_get_list(&info)

and implementing that with something like:

struct sp_port **ports;
/*get serial ports*/
enum sp_return error = sp_list_ports(&ports);
for (i = 0; ports[i]; i++) {
      sp_get_port_name(ports[i]);
}

@rgetz
Copy link
Contributor

rgetz commented Jul 4, 2020

and it looks like - trying to open a context on a non-connected serial port hangs forever - there should be a timeout/failure mechanism of some sort...

@amiraeva
Copy link

This may be out of scope for this, but I'm interested in interfacing with a client running tinyiiod using UART over BLE. At first glance, my use case might be feasible if there was a way for me to give libiio a byte sink and byte source (similar to tinyiiod_ops read/write fields). A generic byte sink/source plugin interface for iiod would also be nice if I decided to run my project on a linux device instead of a MCU.

@rgetz
Copy link
Contributor

rgetz commented Aug 27, 2020

tinyiiod using UART over BLE should work out of the box, and any serial client should work with that - it's already byte oriented...

(unless I'm missing something?)

@amiraeva
Copy link

tinyiiod using UART over BLE should work out of the box

Yes that was my understanding as well. What's not quite clear to me (sorry if its in the docs somewhere!) is how to interface with a client running tinyiiod over a non-standard interface such as BLE.

The only solution I can think of is to take the BLE UART code on my host, and somehow hook it up to an emulated serial port (maybe/hopefully from userspace?). Then I can get libiio to talk to the client (running tinyiiod) over BLE by using the fake serial port as a bridge.

(or am I completely missing something?)

@pcercuei
Copy link
Contributor

pcercuei commented Apr 1, 2021

I'm pretty sure IIOD can already be used over UART without any additional code. It should just be a matter of running iiod -i on the serial port's TTY (in /etc/inittab or systemd).

pcercuei added a commit that referenced this issue Apr 7, 2021
Disable feedback on the standard input when in interactive mode.
This means that the commands entered on IIOD's interactive shell won't
be displayed, as if the shell was "eating the input", unless the debug
mode (-d) is enabled.

This makes it possible to run IIOD on UART. For instance, with Busybox,
running IIOD on /dev/ttyS2 is as simple as adding this line to
/etc/inittab:

ttyS2::respawn:/usr/sbin/iiod -i

Fixes #560.

Signed-off-by: Paul Cercueil <[email protected]>
pcercuei added a commit that referenced this issue Apr 15, 2021
Add a -s option to serve IIO over UART. This option requires the UART
dev node and optionally the baud/parity/bits settings to be specified
as the parameter.

For instance, this will run IIOD on the /dev/ttyS2 UART, at 57600 bps,
no parity, 8 bits per datum:

iiod -s /dev/ttyS2,57600n8

Fixes #560.

Signed-off-by: Paul Cercueil <[email protected]>
pcercuei added a commit that referenced this issue Apr 15, 2021
Add a -s option to serve IIO over UART. This option requires the UART
dev node and optionally the baud/parity/bits settings to be specified
as the parameter.

For instance, this will run IIOD on the /dev/ttyS2 UART, at 57600 bps,
no parity, 8 bits per datum:

iiod -s /dev/ttyS2,57600n8

Fixes #560.

Signed-off-by: Paul Cercueil <[email protected]>
pcercuei added a commit that referenced this issue Apr 15, 2021
Add a -s option to serve IIO over UART. This option requires the UART
dev node and optionally the baud/parity/bits settings to be specified
as the parameter.

For instance, this will run IIOD on the /dev/ttyS2 UART, at 57600 bps,
no parity, 8 bits per datum:

iiod -s /dev/ttyS2,57600n8

Fixes #560.

Signed-off-by: Paul Cercueil <[email protected]>
pcercuei added a commit that referenced this issue Apr 27, 2021
Add a -s option to serve IIO over UART. This option requires the UART
dev node and optionally the baud/parity/bits/stop bits/flow settings
to be specified as the parameter.

For instance, this will run IIOD on the /dev/ttyS2 UART, at 57600 bps,
no parity, 8 bits per datum, 1 stop bit and RTS/CTS flow control:

iiod -s /dev/ttyS2,57600,8n1r

Fixes #560.

Signed-off-by: Paul Cercueil <[email protected]>
pcercuei added a commit that referenced this issue Apr 27, 2021
Add a -s option to serve IIO over UART. This option requires the UART
dev node and optionally the baud/parity/bits/stop bits/flow settings
to be specified as the parameter.

For instance, this will run IIOD on the /dev/ttyS2 UART, at 57600 bps,
no parity, 8 bits per datum, 1 stop bit and RTS/CTS flow control:

iiod -s /dev/ttyS2,57600,8n1r

Fixes #560.

Signed-off-by: Paul Cercueil <[email protected]>
pcercuei added a commit that referenced this issue Apr 28, 2021
Add a -s option to serve IIO over UART. This option requires the UART
dev node and optionally the baud/parity/bits/stop bits/flow settings
to be specified as the parameter.

For instance, this will run IIOD on the /dev/ttyS2 UART, at 57600 bps,
no parity, 8 bits per datum, 1 stop bit and RTS/CTS flow control:

iiod -s /dev/ttyS2,57600,8n1r

Fixes #560.

Signed-off-by: Paul Cercueil <[email protected]>
pcercuei added a commit that referenced this issue Sep 24, 2021
Add a -s option to serve IIO over UART. This option requires the UART
dev node and optionally the baud/parity/bits/stop bits/flow settings
to be specified as the parameter.

For instance, this will run IIOD on the /dev/ttyS2 UART, at 57600 bps,
no parity, 8 bits per datum, 1 stop bit and RTS/CTS flow control:

iiod -s /dev/ttyS2,57600,8n1r

Fixes #560.

Signed-off-by: Paul Cercueil <[email protected]>
pcercuei added a commit that referenced this issue Oct 1, 2021
Add a -s option to serve IIO over UART. This option requires the UART
dev node and optionally the baud/parity/bits/stop bits/flow settings
to be specified as the parameter.

For instance, this will run IIOD on the /dev/ttyS2 UART, at 57600 bps,
no parity, 8 bits per datum, 1 stop bit and RTS/CTS flow control:

iiod -s /dev/ttyS2,57600,8n1r

Fixes #560.

Signed-off-by: Paul Cercueil <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants