Serial port handling: Difference between revisions

From Rsewiki
No edit summary
No edit summary
Line 1: Line 1:
Back to [[Basebot]]
Back to [[Basebot]]


== Windows ==


Kun relevant hvis du bruger Arduino IDE
==== Arduino IDE ====


== Windows ==
I couldn't find a way to save the serial monitor data to a disk file.
 
So find another app that allows communication in the serial line and save the output to a disk file (or allow copy-paste to do the same).
 
==== Visual Studio Code ====
 
From:
menu: View -> Command Palette ->
Type PlatformIO: New Terminal
 
(next time this command will be first in line)
 
In this terminal type
 
pio device monitor > aaa.txt
 
It will try to open the communication and save it to the ''aaa.txt'' file.
 
Try pressing the ''start'' button on the robot (wheels up).
Then press ctrl-C to stop the monitoring and inspect the file.
 
[[file:MS_Visual_studio_code_device_monitor.png | 500px]]


(the same for both Windows and Linux)


== Linux ==
== Linux ==
In Linux, the serial device is called ''/dev/ttyACM0'' (typically), and to copy the robot output to a file is:
$ cat /dev/ttyACM0 > aaa.txt
And use ''ctrl-C'' to stop.
You can, in another terminal, send commands to the robot, i.e.:
$ echo "start" > /dev/ttyACM0
This is the same as pressing the start button.


== Apple ==
== Apple ==


I don't know
I don't know

Revision as of 12:16, 1 September 2024

Back to Basebot

Windows

Arduino IDE

I couldn't find a way to save the serial monitor data to a disk file.

So find another app that allows communication in the serial line and save the output to a disk file (or allow copy-paste to do the same).

Visual Studio Code

From:

menu: View -> Command Palette ->

Type PlatformIO: New Terminal

(next time this command will be first in line)

In this terminal type

pio device monitor > aaa.txt

It will try to open the communication and save it to the aaa.txt file.

Try pressing the start button on the robot (wheels up). Then press ctrl-C to stop the monitoring and inspect the file.

(the same for both Windows and Linux)

Linux

In Linux, the serial device is called /dev/ttyACM0 (typically), and to copy the robot output to a file is:

$ cat /dev/ttyACM0 > aaa.txt

And use ctrl-C to stop.

You can, in another terminal, send commands to the robot, i.e.:

$ echo "start" > /dev/ttyACM0

This is the same as pressing the start button.

Apple

I don't know