I have an Arduino Uno connected via USB to a Raspberry Pi. The Raspberry Pi is accessible via SSH only.
Just started a bit with arduino-cli. I upload a sketch which reads my analog pins. How can I access the serial monitor to get the data?
-
I'm trying to upload a program for serial communication with 9600 Br with 1sec delay. but this error is avrdude: stk500_recv(): programmer is not responding what should I do?user137442– user13744208/16/2021 08:17:24Commented Aug 16, 2021 at 8:17
-
@user137442, Welcome! Placing a question in the comments section under an existing one, will probably not get your question answered. Please consider asking a separate question once you've made sure your question has not been answered elsewhere on Arduino Stack Exchange.StarCat– StarCat08/16/2021 15:29:54Commented Aug 16, 2021 at 15:29
4 Answers 4
Programs such as screen
, minicom
or (my favorite)
picocom
are useful if you want bidirectional communication
between the Arduino and the host computer. If you only want to read
what the Arduino sends, that can be done with cat
:
stty -F /dev/ttyACM0 raw 115200
cat /dev/ttyACM0
I use minicom
.
$ sudo apt-get install minicom
... blah blah blah ...
$ minicom -D /dev/ttyACM0 -b 115200
Minicom can take a bit of getting used to. Use CTRL-A
to initiate a command sequence. CTRL-A X
is exit. CTRL-A O
is configuration ("Options") where you can configure flow control and such.
Many people also use screen
to do the same job, but I like the interface that minicom
gives - it's more terminal-like.
-
thx! Forgot about that, I knew it and also screen. Obviously did a bad job at web search on the topic :Pgroovehunter– groovehunter11/03/2020 22:31:23Commented Nov 3, 2020 at 22:31
-
And how do you send "Hi Arduino" to the Arduino board?user171780– user17178007/11/2022 13:09:28Commented Jul 11, 2022 at 13:09
-
1@user171780 With minicom? Just type it when connected. With screen? Just type it when connected. From the command line?
echo "Hi Arduino" > /dev/ttyACM0
Majenko– Majenko07/11/2022 14:34:58Commented Jul 11, 2022 at 14:34 -
If I type and hit enter, nothing happens. I only see whatever Arduino sent (after reset) but he is not listening to me (so no answer either).user171780– user17178007/12/2022 10:49:49Commented Jul 12, 2022 at 10:49
-
@user171780 Unless you have programmed your Arduino to echo back what it receives you won't see anything. Without knowing what your code is I cannot help you.Majenko– Majenko07/12/2022 11:16:16Commented Jul 12, 2022 at 11:16
I also had the problem that arduino-cli includes no serial monitor. I tried out screen, minicom and other but they are a bit difficult to get used with them. So I created a small python script which works as an serial monitor in the command line: https://github.com/PBahner/Serial-Monitor
You can easily access the monitor with Arduino CLI:
arduino-cli monitor [flags]
For example, you can use this command for Arudino UNO:
arduino-cli monitor -p /dev/ttyACM0 -b arduino:avr:uno
Using this, you can get the values you read from the analog pins on the Arduino UNO via the serial monitor. You can view the Arduino CLI documentation about using the monitor here.
-
1Note that this tool is very poorly documented. You can get out of it with Ctrl-C.Edgar Bonet– Edgar Bonet09/04/2024 20:23:33Commented Sep 4, 2024 at 20:23
-
1I absolutely agree that the documentation is very poor, I think there is not enough explanation in the documentation. But it's still useful, isn't it?Çınar Civan– Çınar Civan09/05/2024 21:05:57Commented Sep 5, 2024 at 21:05
Explore related questions
See similar questions with these tags.