Hello I'm following this tutorial by Tom Igoe (http://www.tigoe.com/pcomp/code/arduinowiring/1216/).
I'm able to get values from my server using node.js and successfully pass on those values to the arduino side. But I'm not able to send values from Arduino side to the node.js side.
For example...Serial.println("Hello from Arduino"); doesn't evoke this line
lineReader.on('line', function (data) { console.log('You sent me: '+ data); });
even nodejs.write("Hello from Arduino \n"); doesnt send any data to echo.js
I'm referring to the BridgeToNode codes. (BridgeExamples/NodeToSerial.ino at master · tigoe/BridgeExamples · GitHub)
Please Help! Thank you for your time.
Hi!
I am right now researching about this, so maybe I can help. Nevertheless, I am not sure if I get you. Those Tom's tutorials are quite mixed now and are difficult to follow.
Which part of the tutorial are you referring to?
I am having the same problem. Works fine from node to Yun but I have tried many approaches to get the other direction working- no luck. When I send a command to the Yun asking it to send some serial data back the comms become unresponsive for a period so I know that it is trying to communicate. I have played with parsers, baud rates, and Yun serial functions.
Some new tests yield some success. I found this http://danialk.github.io/blog/2014/04/26/arduino-and-processingjs-and-socketio-in-action/ so I started it with it and got the Linux side to read the 1's and'0's with a "Raw" parser. Then I tried sending a String with Serial1.println and the readline parser --no luck. The only way I am able to get the library to read anything sent from the ATMega side is to preface the message with a Serial1.write(1)
before sending the string and it will only react if a series of 20 or so messages are sent. I have played with many combinations and no consistent results.
I have tried to be methodical in my approach. The buffer contents with the same procedures are very inconsistent. I believe I have my software installed properly but I think this library on the Yun is a waste of time. Its too bad because the same port works well in the other direction.