3 Replies Latest reply on Jan 10, 2014 3:03 PM by AlexT_Intel

    Output IP of LINUX to LCD

    Rafael.Gomez

      Hello Makers,

       

       

      How would one begin to output the IP value of a Galileo Board booted via SD and Ethernet to a 16x2 LCD.

       

      I know the Linux example outputs the value of ifconfig using the following command

      system("ifconfig eth0 > /dev/ttyGS0");

       

      But how can I redirect that to the connected LCD?

       

      My Sketch currently consist of:

      ###############################################

      #include <LiquidCrystal.h>

      LiquidCrystal lcd(10, 11, 5, 4, 3, 2);

      void setup() {

        // put your setup code here, to run once:

      lcd.init(1,10,255,11,5,4,3,2,0,0,0,0);

      lcd.begin(16, 2);

      lcd.clear();

      lcd.print("I AM A NINJA");

      system("telnetd -l /bin/sh");

      }

       

       

      void loop() {

        // put your main code here, to run repeatedly:

        system("ifconfig eth0 > /dev/ttyGS0");

        sleep(10);

      }

      ################################################

        • 1. Re: Output IP of LINUX to LCD
          Rafael.Gomez

          Ok well I did some playing around and was able to get what I wanted. Well sort of.

          The IP gets pulled using the EthernetClient library from the sketch directly.

          I would still like to know how to send any output from Linux to the LCD

           

          I have included my sketch for who ever wants to see it.

           

          #########################################

          #include <LiquidCrystal.h>

          #include <Ethernet.h>

          LiquidCrystal lcd(10, 11, 5, 4, 3, 2);

          EthernetClient client;

          void setup() {

            // put your setup code here, to run once:

          lcd.init(1,10,255,11,5,4,3,2,0,0,0,0);

          lcd.begin(16, 2);

          lcd.clear();

          lcd.print("I AM A NINJA");

          system("telnetd -l /bin/sh");

          lcd.setCursor(0, 1);

            lcd.print("IP: ");

            for (byte thisByte = 0; thisByte < 4; thisByte++) {

              // print the value of each byte of the IP address:

              lcd.print(Ethernet.localIP()[thisByte], DEC);

              lcd.print(".");

             

            }

            Serial.println();

          }

           

           

          void loop() {

            // put your main code here, to run repeatedly:

            system("ifconfig eth0 > /dev/ttyGS0");

            sleep(10);

          }

           

          ##########################################

          1 of 1 people found this helpful
          • 2. Re: Output IP of LINUX to LCD
            AlexT_Intel

            I haven't tried LCD by myself, but here's a thread, which may be useful, if you haven't yet come across it:

             

            Simple Serial LCD

            • 3. Re: Output IP of LINUX to LCD
              AlexT_Intel

              And just in case (and for those who may not read the entire forum) - as you have maybe seen in the other thread, you can easily exchange the data between Linux commands and the sketch by using popen() function.

              1 of 1 people found this helpful