Serial communication Linux - microcontroller


greetings.

i try arduion side comunicate linux side via serial.
i tried ideinoio , firmata, it's not what, need send messages 1 side other, not set pins , such.

so, try keep simple possible.

see code below.

sending data arduino simple, problem when try send back.

the problem when try send linux side, trigger linux console.

is there way disable linux console on serial port?



edit:

i found answer right after posted this, can't delete post anymore.

commenting ttyath0::askfirst:/bin/ash --login line /etc/inittab seems job.

on linux side
code: [select]
var serialport = require('serialport');
var portname = '/dev/ttyath0';
var sp = new serialport.serialport(portname, {
    baudrate: 115200
});


sp.open(function(err)
{
        if(err)
        {
                return console.log('error opening port :<', err.message);
        }

        setinterval(function() { sp.write('hello?');


});


and on arduino multi serial example

code: [select]

void setup() {
  // initialize both serial ports:
  serial.begin(115200);
  serial1.begin(115200);
}

void loop() {
  // read port 1, send port 0:
  if (serial1.available()) {
    int inbyte = serial1.read();
    serial.write(inbyte);
  }

  // read port 0, send port 1:
  if (serial.available()) {
    int inbyte = serial.read();
    serial1.write(inbyte);
  }
}



Arduino Forum > Products > Arduino Yún (Moderator: fabioc84) > Serial communication Linux - microcontroller


arduino

Comments

Popular posts from this blog

Flip address is out of range arduino uno r3

Arduino Uno not uploading

Indesign and MathType fonts