7 Replies Latest reply on May 28, 2015 2:41 PM by NicolasSchmidt

    Need help with /dev/ttyMFD2

    rosek

      Hi,

       

      I'm trying to disable Yocto console on UART2 and use it to connect there the GSM module, however it doesn't work. I've successfully disabled console using the following commands:

      fw_setenv bootargs_console

      systemctl disable serial-getty@ttyMFD2.service

      reboot

      I still receive u-boot data on this port on power cycle.

       

      Now I'm trying to send commands to using UART2 but it seems that only one line comes through from Edison to the GSM module and then port locks up. I'm using node.js:

       

      var serialport = require('serialport');
      
      
      var port = new serialport.SerialPort('/dev/ttyMFD2', {
              baudrate: 9600,
              parser: serialport.parsers.readline('\r\n')
          }, false);
      
      port.on('open', function() {
        setInterval(function() {
          console.log('send AT');
          port.write('AT\r\n');
        }, 1000);
        port.on('data', function(line) {
          console.log('data:', line);
        });
      });
      
      port.open();
      

       

      On the other side I receive only one "AT" message.

       

      Do you have any idea how to fix this and use UART2, please? I've been trying to use Arduino IDE as well but the results are very similar, only one line received on the GSM side.

       

      Kind regards,

      Krzysztof

        • 1. Re: Need help with /dev/ttyMFD2
          Intel_Peter

          Hello rosek,

           

          I'm not sure why it is not working for you. I did a quick test using the Arduino IDE. I just simply connected my Edison to a COM Port in my PC and read it using PuTTY. Let me show you my test:

           

          void setup()
          {
            Serial2.begin(9600);
          }
          void loop()
          {
            Serial2.println("test1");
            delay(500);
            Serial2.println("test2");
            delay(500);
          }
          

          serial2.PNG

           

          As you can see in the picture above, this simple code will write these two lines constantly in the PuTTY console. Why don't you try to test your code this way? This way you'll be able to see what's being sent from your Edison and it may be easier to debug this way.

           

          Peter.

          • 2. Re: Need help with /dev/ttyMFD2
            rosek

            Hi Peter,

             

            Many thanks for your reply. I've just checked your solution but it's the same. I receive only one line using the Arduino program:

            Capture.JPG

            I'm using Arduino board to test this, and 1.6.0+Intel IDE. Are you using Yocto OS? Here is the one which I use:

            root@Edison2:~# uname -a

            Linux Edison2 3.10.17-yocto-standard #2 SMP PREEMPT Mon Mar 9 16:05:46 CET 2015 i686 GNU/Linux

             

            I've noticed that some forum threads suggests to do the same as the TTYUARTClass::_detach_console does. I found this file in 'arduino-1.6.0+Intel\hardware\intel\i686\cores\arduino', however it seems that this file is created for older Yocto releases which was based on SysVinit, the Yocto release which I use is based on systemd and files like '/etc/inittab' does not exists on mine Edison. The _detach_console simply wouldn't work here.

             

            Any hint, please?

             

            Thanks,

            Krzysztof

            • 3. Re: Need help with /dev/ttyMFD2
              Intel_Peter

              That's an odd behavior, I'm using the same image as you. Could modify the code I posted above so it includes Serial1? Then open the Arduino IDE's serial console, to see if this behavior is happening on both serial ports or only on Serial2.

               

              Peter.

              • 4. Re: Need help with /dev/ttyMFD2
                rosek

                Okay, I'll try Serial1 using Arduino IDE. I'm pretty sure it would work though, UART1 works from node.js script. I'm using it to communicate with GPS module. I've been trying to use UART2 using two Edisons plugged into Arduino development board and other board designed here, without any luck.

                 

                If I enable console, serial output UART2 seems to work okay.

                 

                Krzysztof

                • 5. Re: Need help with /dev/ttyMFD2
                  Intel_Peter

                  What do you mean by: "If I enable console, serial output UART2 seems to work okay"?

                  What happens if you try my sketch without typing the commands:

                   

                  fw_setenv bootargs_console
                  systemctl disable serial-getty@ttyMFD2.service
                  reboot
                  

                   

                  Peter.

                  • 6. Re: Need help with /dev/ttyMFD2
                    CMata_Intel

                    Hi rosek

                     

                    Do you have updates on this? Are you still having the same performance with UART2?

                     

                    Regards;

                    CMata

                    • 7. Re: Need help with /dev/ttyMFD2
                      NicolasSchmidt

                      Dis you have any luck using ttyMFD2 with Node JS?