Closed devRobotAR closed 6 years ago
I'm having trouble making a serial reading of my Serial3 port on an Arduino Mega. I have a Arduino Mega with this simple program:
void setup() { Serial.begin(9600); } void loop() { Serial.println("Serial print from serial"); delay(5000); }
This Mega Arduino is connected to another that has "Standard Firmata" loaded. The connection scheme is the following:
TX0 -> RX3 RX0 -> TX3
My JS file is as follows:
import firmata from 'firmata' const board = new firmata.Board('/dev/cu.usbmodem14201') board.on('ready', () => { const serialPort = board.SERIAL_PORT_IDs.HW_SERIAL3; board.serialConfig({ portId: serialPort, baud: 9600 }) board.serialRead(serialPort, (data) => { console.log(Buffer.from(data).toString('ascii')) console.log('Serial port reading') }) board.on('string', (message) => { console.log(message) }) console.log('Connected board...') })
The connection is established correctly but I do not get any serial reading... I am doing something wrong?
Thanks a lot
Solve the problem using the StandardFirmataPlus library. Thanks a lot
I'm having trouble making a serial reading of my Serial3 port on an Arduino Mega. I have a Arduino Mega with this simple program:
This Mega Arduino is connected to another that has "Standard Firmata" loaded. The connection scheme is the following:
TX0 -> RX3 RX0 -> TX3
My JS file is as follows:
The connection is established correctly but I do not get any serial reading... I am doing something wrong?
Thanks a lot