-
Notifications
You must be signed in to change notification settings - Fork 11
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
Documentation for COM Port RS232/RS422/RS485 Configuration #15
Comments
It is probably as Roger from AAEON mentioned. There is no option for setting the operating mode in the BIOS and the operating mode needs to be configured from the driver because it is a USB to serial ports IC. COM3 for the UP Xtreme i11 corresponds to ttyUSB0, while COM4 corresponds to ttyUSB1. Finktek appears to have attempted to commit support for the F81532/534 into the mainline Linux kernel around 2016. There were at least 11 revisions before we ended up with the final version we see today. It started off as a driver with the required support for the TIOCGRS485/TIOCSRS485 ioctl() calls, until somewhere around patch v7. That was when the Linux kernel folks suggested that a subset of the original driver be contributed, without the functionality for configuring the serial port operating mode. They hoped to have some universal design for all hardware with similar capabilities, but it has been 6 years since. It was suggested at the time that Fintek contribute a user-mode program for switching the operating mode, but this does not seem to have become part of any Linux distribution.
What Fintek appears to have done:
UP/AAEON did not make any recommendation on their websites and the user manual. I tried (1), by compiling Fintek's code with libusb-1.0-0-dev. With some trial-and-error, I got it to change the GPIO and serial port operating mode for RS-485. I was skeptical of whether that is the right thing to do because it is 5-year old code that makes changes to the flash storage of the device, so I feared it could cause a brick. We need to use the -s option, to change both the UART and GPIO modes. Using -m to set the UART mode alone, did not allow the hardware to operate in RS-485 mode. I entered something like this to configure COM4:
It is possible to get it to list the current operating modes:
After setting the GPIO and UART mode, I chose to reboot to let the F81534 module in the kernel read the new parameters from the device's flash storage. But there may be smarter ways to re-load the module. I hope that we could have improved documentation in this area, or perhaps if UP/AAEON/Fintek can follow up with the Linux kernel folks to complete this incomplete feature. |
Hi,
I have an UP Xtreme i11 box. The product specifications say that it has 2x COM ports that can operate in RS232/RS422/RS485 mode, but I cannot find any documentation for changing the operating mode.
There seems to be no setting in the BIOS for changing the port's operating mode. This thread in the forum suggests that the operating mode must be controlled by the OS because it is a USB to serial device, but what are the steps for configuring the operating mode? I am using Ubuntu Linux, and could not find any documentation on a standard procedure for doing this.
I have attempted to use the TIOCGRS485/TIOCSRS485 ioctl() calls to change the operating mode, but invoking ioctl() with TIOCSRS485 results in errno 25 (inappropriate ioctl for device) for /dev/ttyUSB0 or /dev/ttyUSB1.
My project involves an environmental sensor that is connected via half-duplex RS-485. With the same sensor and software, I am able to read values with another computer that runs Linux. So I am guessing that the COM ports on my UP Xtreme i11 are stuck in RS232 mode, which is why communication with the sensor is not possible.
Thanks for your help, in advance.
The text was updated successfully, but these errors were encountered: