9 Replies Latest reply on Mar 20, 2016 11:14 PM by ubk

    Xbee + GSM module make Galileo Gen2 run out of serial ports and HW interrupts

    thomasricci

      Hi, I've just bought a Galileo Gen2 and I'm porting an Arduino project that involves both GSM and Xbee communications.

       

      I'm wondering if it's possible to use different pins (than IO2 and IO3) for the SoftwareSerial library in Arduino sketches... I'm facing issues when I initialize a SoftwareSerial object on pins different from IO2 and IO3. The board simply stops the execution and no warnings or errors are displayed in the IDE while upoading the sketch.

       

      In my project, I need 2 serial lines: one used by an Xbee Shield and another to communicate with the GSM module...

       

      I can use the 2 native UARTS available on the Galileo Gen2 but I also need to handle an HW interrupt (Arduino interrupt 0 or 1 -> IO2 or IO3) that comes from the GSM module to notify an incoming phone call and so I run out of Serial ports or interrupt pins!

       

      Is there any workaround or solution to use 2 Serial lines + 1 interrupt pin?

        • 1. Re: Xbee + GSM module make Galileo Gen2 run out of serial ports and HW interrupts
          flummer

          Hi Thomas,

           

          The second UART (UART1) is the same as the one that connects to the 6 FTDI compatible pins next to the ethernet jack. You might be able to use the IO2 and IO3 pins for interrupts and use the second UART (UART1) on the other pins (the FTDI ones), just remember that it's 3.3 V only.

           

          SoftwareSerial as used on Arduino isn't really available on the Galileo boards. If it works on IO2 and IO3, it's gotta be some hacking on the code side that simply hooks it up to the second UART (UART1) and sets the Muxes.

           

          You could maybe also use a different pin for your CALL signal from the GSM module and do simple polling, but it's not as clean.

           

          Hope it helps!

           

          /Thomas

          • 2. Re: Xbee + GSM module make Galileo Gen2 run out of serial ports and HW interrupts
            DiegoV_Intel

            Hi thomasricci,

             

            I'm afraid the SoftwareSerial library isn't supported by the Galileo (Gen 1 and Gen 2). You can check the release notes in order to know which libraries are currently supported: Intel® Galileo Gen 2 Release Notes. I'll recommend you also a couple of posts where the users have discussed about the SoftwareSerial library topic:

                 SoftwareSerial library doesn't work

                 Is there a software serial library for Galileo?

             

            Check the post, they might be helpful for you. Have a nice day!

             

            Regards,

            Diego.

            • 3. Re: Xbee + GSM module make Galileo Gen2 run out of serial ports and HW interrupts
              Intel_Alvarado

              Hi thomasricci


              We are following up on your post to see if you still need help. If you still need help please reply to this thread so that we may continue to assist you.


              Regards

              Sergio

              • 4. Re: Xbee + GSM module make Galileo Gen2 run out of serial ports and HW interrupts
                thomasricci

                Hi Sergio,

                Thanks for your interest!

                 

                My problem is that I need both 2 UARTs and at least an HW interrupt pin, as I previously reported.

                 

                I'm trying a "mixed" solution for my porting that involves both an Arduino sketch (to handle the GSM module) and a Python script on Linux to drive the Xbee on the USB host port (with an Xbee dongle Explorer connected).

                 

                Moreover, the official library of my GSM module (a FONA by Adafruit) only supported SoftwareSerial implementation... I'm glad to say that I ported the whole FONA library to HW serial and I have already submitted a pull request to Adafruit's GitHub repository in order to share my HW serial implementation to all Galileo's makers  :-)

                 

                So now, I'm successfully communicating with my FONA through pins 0,1 (Serial1) and 2 (HW interrupt)!

                 

                Regarding the Xbee instead, I'd like to use my Xbee dongle and connect it to the USB Host port, communicating with it through pyserial... I tested it on a Raspberry and it works fine but on the Galileo I'm facing some problems because it seems that no USB device is mapped to /dev/ttyUSB0!

                 

                I found a topic in the Galileo community that spots this issue. It seems related to a wrong/missing kernel module for usb interface on the current Yocto image but I have not tried the proposed fix yet ... Any workaroud or solution is warmly appreciated!

                 

                If interested, I'll keep letting you know my progress.

                 

                Regards

                 

                Thomas

                • 5. Re: Xbee + GSM module make Galileo Gen2 run out of serial ports and HW interrupts
                  flummer

                  Hi Thomas,

                  So now, I'm successfully communicating with my FONA through pins 0,1 (Serial1) and 2 (HW interrupt)!

                   

                  Have you tried to use the console pins next to the ethernet jack at the same time as the above? I have a feeling it won't conflict.

                   

                  Xbee and 3.3 V UART should just be a matter of a few wires to hook up.

                   

                  /Thomas

                  • 6. Re: Xbee + GSM module make Galileo Gen2 run out of serial ports and HW interrupts
                    thomasricci

                    Not yet, I'll give it a shot too.

                     

                    Is the 3.3V UART  (the one next to the ethernet jack) indipendent from the pin 2 and 3 in the Arduino breakout or these pins (2 and 3) are simply connected to the  TX and RX of the 3.3V UART?

                    If they are indipendent it should be ok, otherwise I should have issues if I use the pin 2 as an HW interrupt and if it replicate the RX data flow that is used by the Xbee on the 3.3V UART... 

                     

                    Does someone know exactly how the 3.3V UART works and how it is "accessible" though pin 2 and 3 in the Arduino breakout?

                     

                    Thomas

                    • 7. Re: Xbee + GSM module make Galileo Gen2 run out of serial ports and HW interrupts
                      flummer

                      It's the same UART (UART1), but it's run through the MUX/SHIFT part and if we are lucky the interrupt is on one of the GPIO pins that can be muxed in.

                       

                      The tricky thing is that the headers etc. in the Arduino environment might modify the mux settings when you start using the Serial2 (I think that's the object in Arduino env. corresponding to the UART1).

                       

                      One check to do is to simply hook up a terminal to the UART1 header next to the ethernet jack and see if there are any conflicts with the interrupts. By default it's hooked up to the console in Linux, but when you start using it in Arduino it disconnects the console.

                       

                      Digging into the code in the Arduino env. regarding interrupts and serial might also reveal something, mainly of they share pins deeper in.

                       

                      /Thomas

                      • 8. Re: Xbee + GSM module make Galileo Gen2 run out of serial ports and HW interrupts
                        thomasricci

                        Hi all,

                         

                        I have successfully handled both GSM + Xbee communication with my "hybrid" solution: Arduino + Python script running on Yocto!

                         

                        I'm using Serial1 (pin 0 and 1) + pin 2 (HW interrupt) for the FONA (GSM) and the Xbee is handled by Python through an USB dongle connected to the host port.

                        This last part didn't go so smooth because I had to enable first Yocto's packet manager and also re-install and mount the ftdi-sio kernel module because the current Yocto image has an open issue that is discussed in some topics.

                         

                        I have not tried yet flummer's proposed solution using the 3.3V UART next to the Ethernet jack. When I find some time, I'll give it a shot too. Anyway, thanks for the support!

                        1 of 1 people found this helpful
                        • 9. Re: Xbee + GSM module make Galileo Gen2 run out of serial ports and HW interrupts
                          ubk

                          Hi Thomas,

                           

                          I have a project where I will be needing exactly the same configurations as you did. I am a newbie to Galileo and Linux. Can you, if possible, share a detailed step by step tutorial of what you did and how you solved your problem.

                           

                          Thanks.