macosgnu-screenusbserialarduino-due

Terminals are not working with USBSerial on an Arduino DUE. Ports are ok


I have firmware installed on an Arduino DUE from a different mac, it is designed to interface with a Matlab-based application. It has been tested and known to work. I am attempting to modify the firmware from the mac in my office, but I ran into a snag after installing the Arduino IDE.

First, I cannot get the Arduino Serial Monitor to interact with the DUE. I have tried multiple times, it worked once but I have not managed to make it work since. No errors are reported.

Second, I cannot get the screen terminal command to interact with the DUE either. No errors are reported.

Third, if I simply use text pipes in the terminal (e.g., echo 'status' > /dev/cu.usbmodem1421 or head -20 /dev/cu.usbmodem1421 &) I get appropriate responses from the DUE.

Fourth, the Matlab application can interact with the DUE just as designed.

Note that this is the native USB port in the DUE, no serial adapters (with their driver weirdnesses) are involved. I have not tried to download new code to the DUE as the firmware works as it is as long as we use macs (it is just that I need to modify it so that it can work with the much-slower ports in a Windows PC).

I need to be able to debug the code I am modifying, and for that I need to be able to interact via a terminal, any terminal. Any ideas of where to look?


UPDATE: I noticed that the code was not waiting for USB to be ready. So I added

while(!WiredSerial){
  digitalWrite(PIN_LED, HIGH);
  delay(125);
  digitalWrite(PIN_LED, LOW);
  delay(125);
}

After this change the DUE waits for the terminal to be opened and the terminals display the initialization text without a hitch. After that the behavior is the same as reported before.


Solution

  • Never mind.

    I was certain that I had already checked this before posting. As a matter of fact, I am sure that it is the first thing I checked, something else must have changed in the interim.

    The code was expecting a newline character before it sent anything back while the terminals were just sending a carriage return.