For an IOT Solution, I am trying to connect two Galileo Gen 2 boards using the Gadget serial port on both. Connecting RX from first board to TX on second one and vice versa.
The client and server program running on both sides is written in C (not Arduino) and uses the mraa library to access the UARTs, but as raw by using the device names (/dev/ttyS0 | /dev/ttyS1).
Which device should be used for the Gadget serial port on Galileo gen2 (/dev/ttyS0 or /dev/ttyS1 or /dev/ttyGS0 ?). Also is there any MUX that i need to do for communicating over Gadget serial or is that not possible ?. I tried /dev/ttyS1 first since from the board schematics, it seemed that UART1 is connected to the Gadget serial unless mux is used to route it to IO2 & IO3 ports. Thanks in advance for all the help.
To prevent confusions, adding a picture marking the port. The port in question is the one right above the red coloured text.
Message was edited by: Arun P
If you would like to communicate from one Galileo to another using serial ports I'd suggest you to use pins 0 and 1. This is because the port you mention is reserved on Galileo to exclusively access the Linux terminal. I mean, it's not impossible to achieve, it would require kernel changes that would have to be included during the image's building process. So, it would be a lot simpler to use pins 0 and 1 even more if you note that they are in fact accessible from mraa while the port you mention isn't.
If you decide to use this pins, there is a MUX configuration to use them but if you use mraa you don't need to set them automatically. Anyway, in case you need it, you can find it in
Tks for the fast and informative response. We have already got it working on IO ports 0 and 1 and also on 2 & 3. The MUX part also was worked out for ttyS1 (IO 2 & 3) and mraa uart init did work for IO 0 & 1 ports.
We want to use the specific port, reason being we would have to otherwise solder a large number of Galileo cards with connectors on 0/1 or 2/3 which will be integrated as part of our solution. That increases our production time considerably. Pl point me to detailed instructions on how to compile such an image and which device (ttyS0 or ttyS1) to use in our program.
To add to the question, would it be different if we are connecting between Galileo and another board using that port Versus between 2 galileo's.
If you would like to disable the console output and enable this serial port as a regular serial port, you will have to find the recipe that sets this port to be the console output by default. In that case I'd suggest you to read http://www.intel.com/content/dam/www/public/us/en/documents/release-notes/quark-x1000-bsp-build-sw-r... Quark's BSP 1.2.1. I have never tried to disable Galileo's console output so I'm not sure which recipe you will have to modify but I'll do some research and I'll get back to that as soon as I can.
To answer your second question, no it would not make a difference if you were to use a different board instead of another Galileo since you will have to modify the image for Galileo anyways.
Right now my suggestion is that you read the BSP and understand how it works in order to understand how to disable the console output.
I have some extra information that might interest you:
Two files need to be changed in order to use this port as a regular serial port but first make sure you can SSH/Telnet to the board using Ethernet or Wi-Fi as you will lose access to Linux console through the FTDI cable and if you don't have a way to login to the Linux then you may have to start with fresh SD image to boot from, the files are:
/boot/grub/grub.conf: find "console=ttyS1" and change ttyS1 to another tty device or null.
/etc/inittab: find "getty 115200 ttyS1" and change ttyS1 to another tty or null.
You shouldn't have to recompile kernel, but do make sure to have access to console from another way as I mentioned above. If this does not work it'll probably mean that you indeed need to modify the kernel for it to work. Test it and let us know what happens.