{"id":50677,"date":"2025-12-11T22:06:15","date_gmt":"2025-12-12T01:06:15","guid":{"rendered":"https:\/\/mastertrend.info\/?p=50677"},"modified":"2026-01-28T01:30:50","modified_gmt":"2026-01-28T04:30:50","slug":"that-3","status":"publish","type":"post","link":"https:\/\/mastertrend.info\/en\/tio\/","title":{"rendered":"tio, the hidden trick to mastering microcontrollers \ud83d\udd25"},"content":{"rendered":"<h2>tio, connect your serial equipment in 1 minute and without errors \u26a1<\/h2>\n<p>Serial data connections are a classic, yet surprisingly still widely used form of communication in numerous modern devices. From televisions to test equipment like multimeters and even home automation products, serial connectivity remains an essential part of many circuits.<\/p>\n<p>To access serial devices in Linux, a common way is to use the command <code>screen<\/code>However, Linux offers other very efficient options. Personally, I've been using it for years. <a href=\"https:\/\/github.com\/tio\/tio\" target=\"_blank\" rel=\"noopener\" data-schema-attribute=\"mentions\"><u>that<\/u><\/a> for managing microcontrollers, due to its ease of use and reliable operation.<\/p>\n<p>If you use Windows 10 or Windows 11, you'll also find a guide here to help you establish serial connections smoothly.<\/p>\n<aside><span class=\"bg-secondary-500 text-white text-lg font-bold uppercase py-1 px-2\">It may interest you<\/span><\/aside>\n<figure class=\"van-image-figure inline-layout\"><picture><source type=\"image\/webp\" \/><\/picture> <picture><img decoding=\"async\" src=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2025\/06\/Como-usar-Tio-\u2014-Conectarse-a-dispositivos-seriales-con-Linux.png\" alt=\"Demonstration image of Tio&#039;s use in Linux\" title=\"\"><\/picture><\/figure>\n<p>I used \"uncle\" to explore the <u>Ifixit Portable Soldering Station<\/u>He provided me with the serial connection to inspect the internal workings of the smart welder.<\/p>\n<p>In this guide we will teach you how to install and use tio with the default configuration, with a quick example using a <u><a class=\"wpil_keyword_link\" href=\"https:\/\/mastertrend.info\/en\/raspberry-pi-pico-vs-zero\/\" target=\"_blank\" rel=\"noopener\" title=\"Raspberry Pi Pico vs Zero: Key differences in 1 min \u23f1\ufe0f\ud83d\udd25\" data-wpil-keyword-link=\"linked\" data-wpil-monitor-id=\"13668\">Raspberry Pi Pico<\/a> 2<\/u> as a serial device. Then we'll see how to adjust specific parameters such as the baud rate and how to save all the serial data to a text file for later analysis.<\/p>\n<p>To follow this guide you will need:<\/p>\n<ul>\n<li>A computer with Ubuntu installed<\/li>\n<li><a title=\"The new Raspberry Pi Pico 2 has Wi-Fi\" href=\"https:\/\/mastertrend.info\/en\/the-new-raspberry-pi-pico-2-has-wi-fi\/\" target=\"_blank\" rel=\"noopener\" data-wpil-monitor-id=\"13640\">Raspberry Pi Pico 2<\/a> (o Pico \/ Pico W)<\/li>\n<li>DHT11 Temperature Sensor<\/li>\n<li>medium-sized breadboard<\/li>\n<li>3 cables jumper macho a macho<\/li>\n<\/ul>\n<h2 id=\"instalacion-tio-gestor-paquetes\">Installing TIO using the package manager<\/h2>\n<p>We're going to install tio on an Ubuntu 24.04 system, but the instructions apply to most Debian-based distributions. On other Linux systems, search for the equivalent package in your package manager.<\/p>\n<p>1. <strong>Open a terminal and update the repository list, then perform a system update.<\/strong> This step ensures you have the latest package list and that all your software is up to date. If prompted to confirm the update, press [button name]. <code>AND<\/code>.<\/p>\n<pre><code>sudo apt update sudo apt upgrade\r\n<\/code><\/pre>\n<p>2. <strong>Install that.<\/strong><\/p>\n<pre><code>sudo apt install tio\r\n<\/code><\/pre>\n<h2 id=\"circuito-demo-rapido\">Quick demo circuit<\/h2>\n<p>I've prepared a demo using a Raspberry Pi Pico 2 with a DHT11 sensor. This sensor measures temperature and humidity and sends the data to the Python shell, which we'll read via the serial connection. You don't have to replicate this; you can use any serial device.<\/p>\n<p><strong>Materials needed for this demo:<\/strong><\/p>\n<ul>\n<li>Raspberry Pi Pico 2 o Pico<\/li>\n<li>DHT11 temperature and humidity sensor<\/li>\n<li>Medium-sized breadboard<\/li>\n<li>3 cables jumper macho a macho<\/li>\n<\/ul>\n<figure class=\"van-image-figure inline-layout\"><picture><source type=\"image\/webp\" \/><\/picture> <picture><img decoding=\"async\" src=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2025\/06\/Como-usar-Tio-\u2014-Conectarse-a-dispositivos-seriales-con-Linux.jpg\" alt=\"Example circuit with Raspberry Pi Pico and DHT11 sensor\" title=\"\"><\/picture><\/figure>\n<p>The circuit connects power and data between the Pico 2 and the DHT11 sensor. The Pico powers the sensor and receives the temperature signal through the data pin.<\/p>\n<div class=\"slice-container table-wrapper\">\n<div class=\"table__container\">\n<table class=\"table__wrapper table__wrapper--inbodyContent\" tabindex=\"0\">\n<thead>\n<tr>\n<th>Raspberry Pi Pico 2<\/th>\n<th>DHT11<\/th>\n<th>Function<\/th>\n<th>Cable color<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>3V3 Out<\/td>\n<td>Pin 1 (VDD)<\/td>\n<td>3.3V Power Supply<\/td>\n<td>Red<\/td>\n<\/tr>\n<tr>\n<td>GPIO 17<\/td>\n<td>Pin 2 (Data)<\/td>\n<td>Data output<\/td>\n<td>Orange<\/td>\n<\/tr>\n<tr>\n<td>Any GND<\/td>\n<td>Pin 4 (GND)<\/td>\n<td>Earth (reference)<\/td>\n<td>Negro<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Make sure your Raspberry Pi Pico has MicroPython installed. Continue to step 4 in <u>This guide<\/u> to have MicroPython and Thonny ready.<\/p>\n<p>1. <strong>Open Thonny and create a new blank file.<\/strong><\/p>\n<p>2. <strong>Import the necessary libraries to control the GPIO and the DHT11 sensor.<\/strong><\/p>\n<pre>from machine import Pin import time import dht\r\n<\/pre>\n<p>3. <strong>Create an object called <code>sensor<\/code> which connects the code to the DHT11 on GPIO 17.<\/strong><\/p>\n<pre>sensor = dht.DHT11(Pin(17))\r\n<\/pre>\n<p>4. <strong>Program a loop <code>while True<\/code> to run the code repeatedly.<\/strong><\/p>\n<pre>while True:\r\n<\/pre>\n<p>5. <strong>Wait two seconds and take a measurement.<\/strong><\/p>\n<pre>  time.sleep(2) sensor.measure()\r\n<\/pre>\n<p>6. <strong>Store the temperature in a variable called <code>temp<\/code>.<\/strong><\/p>\n<pre>  temp = sensor.temperature()\r\n<\/pre>\n<p>7. <strong>Displays a message with the current temperature using string format.<\/strong><\/p>\n<pre>  print(\"Temperature Checker\") print('La temperatura es:', \"{:.1f}\u00baC\\n\".format(temp))\r\n<\/pre>\n<p>8. <strong>Save the file as <code>main.py<\/code> on the Pico so that it runs automatically when turned on.<\/strong><\/p>\n<h2 id=\"codigo-completo\">Full code<\/h2>\n<pre>from machine import Pin import time import dht sensor = dht.DHT11(Pin(17)) while True: time.sleep(2) sensor.measure() temp = sensor.temperature() print(\"Temperature Checker\") print('La temperatura es:', \"{:.1f}\u00baC\\n\".format(temp))\r\n<\/pre>\n<h2 id=\"usando-tio-configuracion-predeterminada\">Using the default settings<\/h2>\n<p>The default settings for tio are usually sufficient. You just need to run the command. <code>that<\/code> along with the path to the serial device. But first, how do you find the correct device? [uncle] also has the solution.<\/p>\n<p>1. <strong>Close Thonny.<\/strong> Other programs with serial functions may interfere.<\/p>\n<p>2. <strong>Open a terminal and list the available serial ports with:<\/strong><\/p>\n<pre>tio -l\r\n<\/pre>\n<figure class=\"van-image-figure inline-layout\"><picture><source type=\"image\/webp\" \/><\/picture> <picture><img decoding=\"async\" src=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2025\/06\/1749714125_691_Como-usar-Tio-\u2014-Conectarse-a-dispositivos-seriales-con-Linux.png\" alt=\"List of serial devices with Tio on Linux\" title=\"\"><\/picture><\/figure>\n<p>3. <strong>Connect to your serial device (for example, the Raspberry Pi Pico) using:<\/strong><\/p>\n<pre>tio \/dev\/ttyACM0\r\n<\/pre>\n<p>4. <strong>You will see the serial output on your terminal.<\/strong> The temperature will be displayed every second. To exit, press <code>CTRL + C<\/code> to enter the interactive Python interpreter.<\/p>\n<figure class=\"van-image-figure inline-layout\"><picture><source type=\"image\/webp\" \/><\/picture> <picture><img decoding=\"async\" src=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2025\/06\/1749714125_472_Como-usar-Tio-\u2014-Conectarse-a-dispositivos-seriales-con-Linux.png\" alt=\"Serial output using Tio in the terminal\" title=\"\"><\/picture><\/figure>\n<p>5. <strong>To close, dude, press <code>CTRL + t<\/code> followed by the key <code>Q<\/code>.<\/strong><\/p>\n<p>The command <code>tio -l<\/code> Lists all connected serial devices, allowing you to connect to multiple devices simultaneously, such as a Raspberry Pi Pico 2 alongside an Arduino Uno.<\/p>\n<figure class=\"van-image-figure inline-layout\"><picture><source type=\"image\/webp\" \/><\/picture> <picture><img decoding=\"async\" src=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2025\/06\/1749714125_119_Como-usar-Tio-\u2014-Conectarse-a-dispositivos-seriales-con-Linux.png\" alt=\"List of multiple serial devices with Tio\" title=\"\"><\/picture><\/figure>\n<h2 id=\"configuracion-parametros-conexion\">Configuring the connection parameters<\/h2>\n<p>By default, tio uses configuration 115200 8N1:<\/p>\n<ul>\n<li><strong>115200:<\/strong> Transmission speed (baud rate).<\/li>\n<li><strong>8:<\/strong> Data bits per character.<\/li>\n<li><strong>N:<\/strong> Without parity bit.<\/li>\n<li><strong>1:<\/strong> Stop bit.<\/li>\n<\/ul>\n<p>This speed is usually standard on many boards, including Arduino and the Raspberry Pi Pico 2.<\/p>\n<p>We can modify these parameters to adapt them to the configuration of our serial device. For example, if an Arduino sends data at 9600 baud (Serial.begin(9600)), we must tell tio that.<\/p>\n<figure class=\"van-image-figure inline-layout\" style=\"max-width: 480px;\"><picture><source type=\"image\/webp\" \/><\/picture> <picture><img decoding=\"async\" src=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2025\/06\/1749714125_125_Como-usar-Tio-\u2014-Conectarse-a-dispositivos-seriales-con-Linux.png\" alt=\"Example Arduino serial configuration with Tio\" title=\"\"><\/picture><\/figure>\n<p>Steps to adjust the connection:<\/p>\n<p>1. <strong>Open terminal and run tio with the parameters for baudrate 9600, 8 bits, no flow control, 1 stop bit and no parity:<\/strong><\/p>\n<pre>tio \/dev\/ttyACM0 --baudrate 9600 --databits 8 --flow none --stopbits 1 --parity none\r\n<\/pre>\n<p>2. <strong>Verify that the message is being processed correctly in the terminal.<\/strong><\/p>\n<p>3. <strong>To exit, press <code>CTRL + t<\/code> and then <code>Q<\/code>.<\/strong><\/p>\n<h2 id=\"registrar-datos-en-archivo-log\">Record data in a log file<\/h2>\n<p>A very useful function is to save a copy of the serial output to a file for later analysis.<\/p>\n<p>With the temperature sensor project, we will save the information in a file called <code>temperature-log.txt<\/code>.<\/p>\n<p>1. <strong>Run tio from the terminal, specifying the file and enabling registration:<\/strong><\/p>\n<pre>tio \/dev\/ttyACM0 --log-file temperature-log.txt -L\r\n<\/pre>\n<figure class=\"van-image-figure inline-layout\" style=\"max-width: 866px;\"><picture><source type=\"image\/webp\" \/><\/picture> <picture><img decoding=\"async\" src=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2025\/06\/1749714126_864_Como-usar-Tio-\u2014-Conectarse-a-dispositivos-seriales-con-Linux.png\" alt=\"Record serial output data to a file using Tio\" title=\"\"><\/picture><\/figure>\n<p>2. <strong>Run it for as long as you need to collect data.<\/strong><\/p>\n<p>3. <strong>To exit, press <code>CTRL + t<\/code> and then <code>Q<\/code>.<\/strong><\/p>\n<p>4. <strong>Open the file in a text editor to view the log.<\/strong><\/p>\n<p>5. <strong>To add data to an existing file without overwriting it, use:<\/strong><\/p>\n<pre>tio \/dev\/ttyACM0 --log-append --log-file temperature-log.txt -L\r\n<\/pre>\n<figure class=\"van-image-figure inline-layout\" style=\"max-width: 1146px;\"><picture><source type=\"image\/webp\" \/><\/picture> <picture><img decoding=\"async\" src=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2025\/06\/1749714126_966_Como-usar-Tio-\u2014-Conectarse-a-dispositivos-seriales-con-Linux.png\" alt=\"Add data to the log without overwriting with Tio\" title=\"\"><\/picture><\/figure>\n<p>6. <strong>Open the file to verify that the data was added correctly.<\/strong><\/p>\n<p>If you want to add a timestamp to each line to identify the exact time of each event, add the flag <code>-t<\/code> to the command, as follows:<\/p>\n<p>7. <strong>Run tio with timestamp and log entry:<\/strong><\/p>\n<pre>tio \/dev\/ttyACM0 --log-append --log-file temperature-log.txt -L -t\r\n<\/pre>\n<figure class=\"van-image-figure inline-layout\" style=\"max-width: 1236px;\"><picture><source type=\"image\/webp\" \/><\/picture> <picture><img decoding=\"async\" src=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2025\/06\/1749714126_101_Como-usar-Tio-\u2014-Conectarse-a-dispositivos-seriales-con-Linux.png\" alt=\"Serial data with timestamp in log file using Tio\" title=\"\"><\/picture><\/figure>\n<p>8. <strong>To exit, press <code>CTRL + t<\/code> followed by <code>Q<\/code>.<\/strong><\/p>\n<p>9. <strong>Open the file to see the data with the exact time of each record.<\/strong><\/p>\n<figure class=\"van-image-figure inline-layout\" style=\"max-width: 1079px;\"><picture><source type=\"image\/webp\" \/><\/picture> <picture><img decoding=\"async\" src=\"https:\/\/mastertrend.info\/wp-content\/uploads\/2025\/06\/1749714126_986_Como-usar-Tio-\u2014-Conectarse-a-dispositivos-seriales-con-Linux.png\" alt=\"Log output with timestamps using Tio on Linux\" title=\"\"><\/picture><\/figure>\n<h2 id=\"funciones-avanzadas-tio\">Advanced features of uncle<\/h2>\n<p>tio includes multiple additional features accessible during its execution. Use <code>CTRL + t<\/code> followed by a key to activate different commands.<\/p>\n<pre>CTRL+t ? Lists available commands CTRL+tb Sends break signal CTRL+tc Displays current configuration CTRL+te Enables\/disables local echo mode CTRL+tf Enables\/disables logging to file CTRL+t F Clears data buffers CTRL+tg Enables\/disables serial line CTRL+ti Changes input mode CTRL+tl Clears screen CTRL+t L Displays line statuses CTRL+tm Changes character mapping CTRL+to Enables\/disables output mode CTRL+tp Pulses serial line CTRL+tq Exits tio CTRL+tr Executes a script CTRL+t R Executes a shell command redirecting I\/O to the device CTRL+ts Displays statistics CTRL+tt Enables\/disables online timestamps CTRL+tv Displays version CTRL+tx Sends file via Xmodem CTRL+ty Sends file via Ymodem CTRL+t CTRL+t Sends the character\r\n<\/pre>\n<p>\ud83d\udd25 Try these features to get the most out of your serial connections! Remember that tio is lightweight, fast, and very practical for developers and electronics enthusiasts. \ud83d\ude80<\/p>\n<p>\ud83d\udc49<a href=\"https:\/\/github.com\/tio\/tio\/releases\" target=\"_blank\" rel=\"noopener\" data-schema-attribute=\"mentions\"> Start installing here<\/a> and explore its functionalities for your microcontroller projects.<\/p>\n<\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>tio simplifies serial connections in Linux and Windows, speeding up your work with microcontrollers and sensors without complications \u26a1\ud83d\udd27\ud83d\ude80<\/p>","protected":false},"author":1,"featured_media":89107,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ai_generated_summary":"","iawp_total_views":44,"jnews-multi-image_gallery":[],"jnews_single_post":{"format":"standard","override":[{"template":"1","parallax":"1","fullscreen":"1","layout":"right-sidebar","sidebar":"default-sidebar","second_sidebar":"default-sidebar","sticky_sidebar":"1","share_position":"top","share_float_style":"share-monocrhome","show_share_counter":"1","show_view_counter":"1","show_featured":"1","show_post_meta":"1","show_post_author":"1","show_post_author_image":"1","show_post_date":"1","post_date_format":"default","post_date_format_custom":"Y\/m\/d","show_post_category":"1","show_post_reading_time":"1","post_reading_time_wpm":"300","post_calculate_word_method":"str_word_count","show_zoom_button":"1","zoom_button_out_step":"2","zoom_button_in_step":"3","show_post_tag":"1","show_prev_next_post":"1","show_popup_post":"1","show_comment_section":"1","number_popup_post":"1","show_author_box":"1","show_post_related":"1","show_inline_post_related":"0"}],"image_override":[{"single_post_thumbnail_size":"crop-500","single_post_gallery_size":"crop-500"}],"trending_post_position":"meta","trending_post_label":"Trending","sponsored_post_label":"Sponsored by","disable_ad":"0","subtitle":""},"jnews_primary_category":[],"jnews_social_meta":[],"jnews_review":[],"enable_review":"","type":"percentage","name":"","summary":"","brand":"","sku":"","good":[],"bad":[],"score_override":"","override_value":"","rating":[],"price":[],"jnews_override_counter":{"view_counter_number":"0","share_counter_number":"0","like_counter_number":"0","dislike_counter_number":"0"},"footnotes":""},"categories":[1435],"tags":[1445,1821,1566],"class_list":["post-50677","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutoriales","tag-evergreencontent","tag-linux","tag-raspberrypi"],"_links":{"self":[{"href":"https:\/\/mastertrend.info\/en\/wp-json\/wp\/v2\/posts\/50677","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mastertrend.info\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mastertrend.info\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mastertrend.info\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mastertrend.info\/en\/wp-json\/wp\/v2\/comments?post=50677"}],"version-history":[{"count":30,"href":"https:\/\/mastertrend.info\/en\/wp-json\/wp\/v2\/posts\/50677\/revisions"}],"predecessor-version":[{"id":105167,"href":"https:\/\/mastertrend.info\/en\/wp-json\/wp\/v2\/posts\/50677\/revisions\/105167"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mastertrend.info\/en\/wp-json\/wp\/v2\/media\/89107"}],"wp:attachment":[{"href":"https:\/\/mastertrend.info\/en\/wp-json\/wp\/v2\/media?parent=50677"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mastertrend.info\/en\/wp-json\/wp\/v2\/categories?post=50677"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mastertrend.info\/en\/wp-json\/wp\/v2\/tags?post=50677"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}