11

I'm using the Arduino Starter Kit so I have a Uno R3 and going through the examples I'm trying to read temperature data from my controller in Arduino Studio.

In essence my problem can be reduced down to

void setup() {
    Serial.begin(9600);
}

void loop() {
    Serial.print("stuff");
}

Which I'd expect to keep printing "stuff" on the serial monitor.

(In practice I'm running this exact code but all the temperature-reading going on feels irrelevant to my problem, I'm simply mentioning it because I can observe that mye LEDs light up when the temperature rises so I know the code is uploaded and running on the Duo).

I'm not seeing any errors in the studio console, and if I connect using gtkterm or screen I can see data being sent so the problem seems to be isolated to the AndroidStudio serial monitor itself.

I'm running Ubuntu 14.04 and I've connected via USB on /dev/ttyACM3.

I tried running

stty -F /dev/ttyACM3 cs8 9600 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts

as suggested here and I also tried with baud 115200, taking care to also change the value in my setup function.

I also ran

chmod a+rw /dev/ttyACM3

But I'm still not seeing any errors or output. How do I proceed to debug this issue?

Running ls -l /dev/ttyACM* gives

crw-rw---- 1 root dialout 166, 0 feb. 20 14:22 /dev/ttyACM0

crw-rw---- 1 root dialout 166, 1 feb. 20 14:22 /dev/ttyACM1

crw-rw---- 1 root dialout 166, 2 feb. 20 14:22 /dev/ttyACM2

crw-rw-rw- 1 root dialout 166, 3 feb. 20 14:30 /dev/ttyACM3

ivarni
  • 211
  • 1
  • 6
  • 1
    Test GtkTerm or PuTTY. – Mikael Patel Feb 20 '16 at 12:45
  • @MikaelPatel Thanks, that should help me isolate the problem at least :) – ivarni Feb 20 '16 at 12:50
  • 1
    What's the output of "ls -l /dev/ttyACM*"? – Avamander Feb 20 '16 at 13:29
  • @Avamander I've edited that into the question, along with what I'm getting from gtkterm – ivarni Feb 20 '16 at 13:40
  • If it matters, my user is in the dialout group – ivarni Feb 20 '16 at 13:42
  • 2
    Try putting the string "stuff" into double quotes instead of single quotes. – Avamander Feb 20 '16 at 13:47
  • @Avamander Oh.. yeah.. double quotes. That's embarassing. It's still not showing in the IDE but now I get sensible data with both `screen` and `gtkterm`. Oh my... I guess the problem with the AndroidStudio still persists but since it's working with the terminal I guess I should go see if they have an issue tracker somehere. Thanks, if there's a close-reason here for *a problem that can no longer be reproduced or a simple typographical error* I guess it won't be misplaced here. – ivarni Feb 20 '16 at 13:59
  • Android Studio issue? Have you solved your issue you mentioned in the question or not? – Avamander Feb 20 '16 at 14:51
  • It's not solved as I still don't see any data in the serial monitor but I've isolated the problem after fixing the quotes and using gtkterm to confirm that the Arduino is indeed sending data. I'm still diggin into why the IDE doesn't show it but I suspect it's not an error I've done but rather an issue with the software itself. – ivarni Feb 20 '16 at 15:08
  • Edited to clarify that the issue has been narrowed down by the help received in comments. – ivarni Feb 20 '16 at 15:16
  • What version of the IDE are you using? Also, can you add the output of an `lsusb`? – cjs Apr 10 '17 at 12:52
  • Are you 100% sure that your arduino is seen on your computer as /dev/ttyACM3 ? if you unpug the arduino, run "sudo dmesg -C", plug the arduino and then issue "dmesg" what do you get back ? My Arduino nano clone (with ch340) shows up as /dev/ttyUSB0. – louigi600 Apr 27 '17 at 12:45
  • @louigi600 I don't own either the arduino itself or the computer I was using any more, but if someone else has the same issue I encourage them to try that and provide information. – ivarni Apr 27 '17 at 12:49
  • this is how my ch340 based nano clone is seen on my linux pc: [14429.560354] usb 1-2.2: ch341-uart converter now attached to ttyUSB0 I don't have any genuine arduino products but I suspect you may have been looking at the wrong device file – louigi600 Apr 27 '17 at 12:54
  • What serial port are you running on? – Legend Mai Gaming May 09 '17 at 12:11
  • 1
    I'm voting to close this old unresolved question because the asker reports in comments that **"I don't own either the arduino itself or the computer I was using any more"** which means that it will be impossible to ever conclusively resolve this issue. – Chris Stratton Aug 07 '17 at 20:03

1 Answers1

0

By default, on a linux system without specific udev binding rules to rename the device into something non standard, the FTDI driver should map the usb to serial port on /dev/ttyUSB* and not to /dev/ttbACM*. I suspect that you were just looking in the wrong place. I think it defaults to /dev/ttyUSB* for any usb to serial dongle:

usb-serial.c:   usb_serial_tty_driver->name = "ttyUSB";
louigi600
  • 131
  • 4
  • In order to make sure you're looking in the correct device file run "sudo dmesg -C" priot to plugging in the Arduino, and subsequently just 'sudo dmesg" to see where teh usb to serial converter was attached. You should see a message much like this: ch341-uart converter now attached to ttyUSB0 where the ch341-uart is replaced by what your arduino has (most likely FT232'ish) – louigi600 Apr 27 '17 at 14:18
  • This is probably not applicable. The post claims to be using an Uno R3, which does not have an FTDI but rather has a custom USB serial implementation in an ATmega16u2 which *will* map as a ttyACM device *not* a ttyUSB one - that only happen on boards using other USB serial solutions, like older Arduinos and assorted clones and compatibles. – Chris Stratton Aug 07 '17 at 20:00
  • Ok but still doing the dmesg thing will tell you which is the correct device that linux is assigning to the arduino .... it won't show ch340 or FT* .... but it will still report what's the assigned character special file in /dev . – louigi600 Aug 17 '17 at 08:22