7 Replies Latest reply on Apr 30, 2016 4:34 AM by Ahmed-ElTahan

    Multiple Serial Port


      Hi there I'm newbie with Arduino Intel Galileo,


      I need at least 4 serial port for my project,  Is it possible to use digital I/O as a multiple serial port?



        • 1. Re: Multiple Serial Port

          Greetings mmsafr,

          The Galileo have pin 0 and 1 for the Serial communication, in case you want to use other pins you would have to use the software serial library and it does allow to use multiple software serial ports, but only one can receive data at a time. Unfortunately this function is not yet been implemented into the Galileo this is a post about that library (https://communities.intel.com/thread/47898) in case you want to take a look it.

          1 of 1 people found this helpful
          • 2. Re: Multiple Serial Port

            Hi Montero,


            Thanks for your info, I'll look for it.

            I was wondering, since it run Linux, is it possible to connect it with usb multiple serial port that I can find in the market?




            • 3. Re: Multiple Serial Port

              Hi mmsafr. For your serial ports, what are the electrical properties for your interface ? RS232 ? RS422 ? RS485 ? If RS232, how many lines from this interface are required ? A typical (older style) PC (DTE style) serial port is 8 signals + ground = 9 wire interface. Regardless, you have some options including:


              a) use USB to multiport serial - our suggestion is FTDI since the support has been native for many years in the Linux kernels. FTDI does offer 1, 2, 4 port variations so if you select the 1 or 2 port versions, you would likely need an external hub to connect the multiple ports. A single 4 port solution is the other option.


              What are the baud rates you expect to apply through these ports ? This must be considered and reviewed against your UARTs as not all are created equal. You will find some to be FULL speed USB interface vs. HIGH speed USB interface. This will impact your throughput for the serial ports. Also, in general, there is a latency overhead with USB that cannot be avoided. Keep this in mind for your project.


              b) To avoid the latency, consider a mini-PCIe UART solution (if this is free on your Galileo). Again, the UART choice must be considered. From our experience, we can confirm, you should be fine to use an adapter that is based on the OXPCIe954 UART which has been natively supported for a while on Linux and likely on the kernel used by the Galileo distributions.


              Regardless, work with a vendor that will take back the product if you run into any issues. They key concerns are that the adapter you use is properly supported on the Linux kernel which in turn would allow your access through the Arduino platform. If in doubt, post back the adapter details and if known, the controller chip inside the adapter for a quick review.


              Many features differentiate the UART controllers on the market including, the UART model itself; supported baud rates; internal buffer sizes; USB / PCIe interface speeds; device driver support (native or via patches ?); technical support from the silicon vendor (if any ?)


              What is your timeline ? We are working towards a supporting shield that may be of interest to you (and others). For immediate gratification, you have the above choices. Hope this helps.



              1 of 1 people found this helpful
              • 4. Re: Multiple Serial Port

                Thanks Kumar,


                Its very helpful.

                Anyway, I don't need full speed data transfer, what I've been working so far is to connect to card reader, modbus device, modem, etc.

                The OXPCIe954 UART that you've suggest is quiet difficult to find in my country. I use to work with MOXA multi serial port, hope it can work with Galileo.


                Anyway, do you know how to access usb multi serial port device from Arduino IDE?




                • 5. Re: Multiple Serial Port

                  Hi mmsafr. We are not quite as far as you are on adding the extra serial ports to the Galileo and then attempt to access these extra ports under Arduino but hope to do so very soon. We have the FTDI UARTs and others in the lab now. Will report back after we do perform the review.


                  Have a read of the following:




                  It appears the mappings are 'hard coded into the BSP'. So first step would be confirm the Linux kernel is able to detect (enumerate) your add-on serial port (whether it is PCIe or USB based). You may review the DMESG log for such details.


                  You noted Moxa serial - is that USB ? Do you know the controller used on the product ? If not, check for their Linux support which will be required to move forward. Once you have confirmed that the Linux kernel can see the extra serial port(s) then you should be able to extend the Galileo BSP to support these additional ports by following the pattern noted in the above user form link.


                  I would think the following should work:


                  TTYUARTClass Serial3(&rx_buffer4, 3);       // ttyS2


                  If the add-on serial port is assigned to be ttyS2 - this will be the case for mini-PCIe designs like the OXPCIe95x. If Linux, the portname will be different (ie. /dev/ttyUSB0, /dev/ttyUSB1, etc.).


                  Again, not confirmed but you should be able to do a symbolic link to suit. See here for an article on this topic:




                  Perhaps the following will work (let us all know if it does):


                  // step # 1

                  ln -s /dev/ttyUSB0 /dev/ttyS2

                  //step # 2 - add this to the serial support of the Galileo BSP

                  TTYUARTClass Serial3(&rx_buffer4, 3);   // since the above symbolic link has mapped this port to ttyS2



                  Summary - confirm the add-on port is supported on the Linux kernel. If it is not, find out how to add this support. Then move to modify the Galileo BSP serial port as noted -> compile the BSP and test again. In theory, this should all work.


                  You mention modbus - so is your Moxa adapter RS232 or RS422 / RS485 capable ? For your project, do you require simple UART support or also multidrop (9 bit) ? The reason for this question is that some UARTs are supported only in a very simple form (ie. enumerate like a 16550 only, without additional features). For many, this may be good enough.


                  If you get stuck, would be interested to see your dmesg log to check how far the USB enumeration process completes before halting.



                  • 6. Re: Multiple Serial Port

                    Hi Kumar,


                    You give clear explanation.

                    I use USB to Multi Serial port from MOXA and it support RS232/RS485.

                    Thanks for your link, this gave me idea on how to access the additional serial port.


                    Best Regards

                    • 7. Re: Multiple Serial Port

                      Hi mmsafr,
                      Can you explain more about the software and the hardware you've used on Galileo as I have the same objective that you have. mmsafr ! !