1 Reply Latest reply on May 11, 2014 3:24 AM by gertvanloo

    unable to get good comms from serial with raspberry pi....

    wegunterjr

      I have followed these steps:

      carefully followed the instructions for disabling login via the Pi's serial port. Then I disabled the Pi's boot messages (out to the serial port), shut down the system, set the jumpers to connect the Pi's serial transmit line to the Gertduino's serial receive line (and vice-versa), powered up the system (it booted up just fine, yay!), installed the minicom terminal emulator,


      I just can't remember if i did it manually, or if i used Gordon's script. Either way, it is complete.  I use minicom to connect to the arduino (pi - 328 using the crossed wires) but all i get is gibberish in the window. Anything I Might be missing?


      I am using the Serial_startup.in arduino sketch and it compiles and uploads, i see the upload led blink, but then when i connect to it with minicom, I get nothing useful out of it.  I start with

      minicom -b 9600 -o -D /dev/ttyAMA0

       

        • Re: unable to get good comms from serial with raspberry pi....
          gertvanloo
          all i get is gibberish in the window.

          That is a good start because it seem you have a connection and data is coming thru. 'Gibberish' suggest that your baud rate is wrong.

          I use the program below to get a serial port working:

          //

          // Serial Sartup

          //

          // Use to get your serial comport working.

          // This program outputs a pattern without flooding

          // the output too much.

          // It echo's received characters between ><

          // Written for 16MHz clock

          //

          // G.J. van Loo, 27 October 2013

          // No rights reserved. This is freeware.

          //

           

          int spaces = 0;

           

          void send_serial_string(char *str);

           

          void setup()

          {

            // start serial port at 9600 bps:

            Serial.begin(9600);

            // Serial receive is on pin 2 so make that an input

            pinMode(2,INPUT);

           

            send_serial_string("Hello world!\r\n");

           

          }

           

          char str[128];

          void loop()

          { volatile long wait;

            int inByte;

            inByte= -1;

            for (wait=0; wait<50000 && inByte==-1; wait++)

            { wait++;

              wait--;

              inByte = Serial.read();

            }

            if (inByte!=-1)

            { Serial.write('>');

              Serial.write(inByte);

              Serial.write('<');

            }

            for (wait=0; wait<spaces; wait++)

               Serial.write(' ');

            spaces++;

            if (spaces>20)

              spaces = 0;

            send_serial_string("Hi\r\n");

          }

           

          void send_serial_string(char *str)

          {

            while(*str)

              Serial.write(*str++);

          }