Difference between revisions of "Rockpi4/dev/libmraa/es es"
(Created page with "{{rockpi4_header}} {{Languages|rockpi4/dev/libmraa}} ROCK Pi 4 > Desarrollando > rockpi4/dev/libmraa/es_es | Instalar L...") |
|||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
| − | {{ | + | {{Languages|rockpi4/dev/Debian}} |
| + | {{rockpi4_header_es}} | ||
| − | + | ||
| + | <div class="col-md-12" style="text-shadow: 2px 2px 4px #DDDDDD; box-shadow: 2px 2px 5px #999999;"> | ||
[[rockpi4/es_es | ROCK Pi 4]] > [[rockpi4/dev/es_es | Desarrollando]] > [[rockpi4/dev/libmraa/es_es | Instalar Libmraa ]] | [[rockpi4/es_es | ROCK Pi 4]] > [[rockpi4/dev/es_es | Desarrollando]] > [[rockpi4/dev/libmraa/es_es | Instalar Libmraa ]] | ||
| Line 10: | Line 12: | ||
Estas son las instrucciones para saber instalar '''libmraa'''. | Estas son las instrucciones para saber instalar '''libmraa'''. | ||
| − | == | + | == Instalación de Paquetes Esenciales == |
| − | + | Edita /etc/apt/sources.list y añade lo siguiente: | |
| − | ''' | + | '''Para Debian Stretch''' |
deb http://apt.radxa.com/stretch/ stretch main | deb http://apt.radxa.com/stretch/ stretch main | ||
| − | ''' | + | '''Para Ubuntu bionic''' |
deb http://apt.radxa.com/bionic/ bionic main | deb http://apt.radxa.com/bionic/ bionic main | ||
| − | + | Obtenemos la clave pública | |
wget -O - apt.radxa.com/stretch/public.key | sudo apt-key add - | wget -O - apt.radxa.com/stretch/public.key | sudo apt-key add - | ||
| − | + | Actualizamos | |
sudo apt-get update && sudo apt-get upgrade | sudo apt-get update && sudo apt-get upgrade | ||
| − | + | Instalamos los paquetes esenciales: | |
sudo apt-get install -y rockchip-overlay rockchip-fstab && sudo apt-get install -y rockpi4-dtbo | sudo apt-get install -y rockchip-overlay rockchip-fstab && sudo apt-get install -y rockpi4-dtbo | ||
| − | == | + | == Instalamos el último cargador u-boot y el último núcleo== |
apt-get install rockpi4b-rk-u-boot-lastest | apt-get install rockpi4b-rk-u-boot-lastest | ||
| − | + | Ejecutamos manualmente el script de u-boot flash | |
/usr/local/sbin/rockpi4b_upgrade_bootloader.sh | /usr/local/sbin/rockpi4b_upgrade_bootloader.sh | ||
| − | + | Tecleamos '''YES''' para realizar la grabación de la imagen uboot.img. | |
| − | + | ... instalamos el núcleo | |
apt-get install linux-base | apt-get install linux-base | ||
apt-get install linux-4.4-lastest | apt-get install linux-4.4-lastest | ||
| − | + | Después, comprobamos el fichero '''/boot/extlinux/extlinux.conf'''. Debe de listar todas las versiones del núcleo instaladas en el ROCK Pi. El núcleo correspondiente a la primera etiqueta es la versión más nueva y la primera opción de inicio. | |
| − | == | + | == Activando una Interfaz == |
| − | + | Mirar en rockpi4 [[Rockpi4/hardware/rockpi4/es_es#gpio | pines GPIO]],ROCK Pi 4 tiene 40 pines de expansión. Cada pin se diferencia por un color. En la librería mraa se definen así los pines: | |
15 GPIO: | 15 GPIO: | ||
| Line 83: | Line 85: | ||
PIN13 PWM'''1''' | PIN13 PWM'''1''' | ||
| − | + | modifica '''/boot/hw_intfc.conf''' para activar '''pwm0,pwm1,spi1,i2c2,i2c7''' para su comprobación | |
root@localhost:/# cat boot/hw_intfc.conf | root@localhost:/# cat boot/hw_intfc.conf | ||
| − | # Hardware | + | # Configuración de Interfaz Hardware |
| − | # | + | # Para más detalles, mira el archivo /usr/local/share/doc/rockpi4-dtbo/README |
| − | # | + | # Descomenta la línea de configuración si quieres usar esta característica. Como ejemplo i2c6. |
| − | # | + | # off desactiva el bus i2c6 y on activa el bus i2c6. |
'''intfc:pwm0=on''' | '''intfc:pwm0=on''' | ||
| Line 103: | Line 105: | ||
'''intfc:i2c7=on''' | '''intfc:i2c7=on''' | ||
| − | # DTS Overlay | + | # Configuración DTS Overlay |
| − | # 1. | + | # 1. comprobar nombre.dtbo en /boot/overlays |
| − | # 2. | + | # 2. añadir intfc:dtoverlay=nombre como se usa debajo |
#intfc:dtoverlay=at24c02 | #intfc:dtoverlay=at24c02 | ||
| Line 112: | Line 114: | ||
#intfc:dtoverlay=console-on-uart4 | #intfc:dtoverlay=console-on-uart4 | ||
root@localhost:/# | root@localhost:/# | ||
| − | |||
| − | == | + | luego '''reinicia''' |
| + | |||
| + | ==Instala la librería libmraa-rockpi4== | ||
apt-get install libmraa-rockpi4 | apt-get install libmraa-rockpi4 | ||
| − | == | + | ==Haciendo Pruebas...== |
| − | === | + | ===Probando los gpio=== |
| − | + | Usa la herramienta '''mraa-gpio''' para probar | |
root@localhost:~# mraa-gpio list | root@localhost:~# mraa-gpio list | ||
| Line 139: | Line 142: | ||
38 GPIO4_A6: GPIO | 38 GPIO4_A6: GPIO | ||
40 GPIO4_A7: GPIO | 40 GPIO4_A7: GPIO | ||
| − | root@localhost:~# mraa-gpio set 40 1 //pin40 | + | root@localhost:~# mraa-gpio set 40 1 // pin40 se activa a nivel alto |
| − | root@localhost:~# mraa-gpio set 40 0 //pin40 | + | root@localhost:~# mraa-gpio set 40 0 // pin40 se activa a nivel bajo |
root@localhost:~# | root@localhost:~# | ||
| − | === | + | |
| − | + | ===Probando i2c=== | |
| + | Usa la herramienta '''mraa-i2c''' para probar, si tenemos un dispositivo esclavo i2c, por ejemplo una EEPROM I2C, haremos: | ||
root@localhost:~# mraa-i2c list | root@localhost:~# mraa-i2c list | ||
Bus 0: id=07 type=linux default | Bus 0: id=07 type=linux default | ||
Bus 1: id=02 type=linux | Bus 1: id=02 type=linux | ||
| − | root@localhost:~# mraa-i2c detect 0 // | + | root@localhost:~# mraa-i2c detect 0 // dispositivo en el bus 0 |
00: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | 00: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | ||
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | ||
| Line 156: | Line 160: | ||
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | ||
70: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | 70: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | ||
| − | root@localhost:~# mraa-i2c detect 1 // | + | root@localhost:~# mraa-i2c detect 1 // ningún dispositivo en el bus 1 |
00: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | 00: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | ||
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | ||
| Line 165: | Line 169: | ||
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | ||
70: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | 70: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | ||
| − | root@localhost:~# mraa-i2c set 0 0x50 0x10 0x55 // | + | root@localhost:~# mraa-i2c set 0 0x50 0x10 0x55 // escribir |
| − | + | en el dispositivo 50, en su registro 10 el valor 55; grabará 0x55. | |
| − | root@localhost:~# mraa-i2c get 0 0x50 0x10 // | + | |
| − | + | root@localhost:~# mraa-i2c get 0 0x50 0x10 // leer | |
| + | del dispositivo 50, su registro 10; se devolverá 0x55. | ||
| + | |||
root@localhost:~# | root@localhost:~# | ||
| − | === | + | ===Probando spi=== |
| − | + | Usamos '''c''' para probar el spi, compilamos spi.c | |
| + | |||
root@localhost:~# cat spi.c | root@localhost:~# cat spi.c | ||
#include <signal.h> | #include <signal.h> | ||
| Line 178: | Line 185: | ||
#include <unistd.h> | #include <unistd.h> | ||
| − | /* mraa | + | /* cabecera mraa */ |
#include "mraa/spi.h" | #include "mraa/spi.h" | ||
| − | /* SPI | + | /* declaración SPI */ |
#define SPI_BUS 0 | #define SPI_BUS 0 | ||
| − | /* SPI | + | /* frecuencia SPI Hz */ |
#define SPI_FREQ 400000 | #define SPI_FREQ 400000 | ||
int | int | ||
| Line 193: | Line 200: | ||
int i, j; | int i, j; | ||
| − | /* | + | /* inicializar mraa para la plataforma (no es necesario la mayoría de las veces) */ |
mraa_init(); | mraa_init(); | ||
| − | //! [ | + | //! [Interesante] |
| − | /* | + | /* inicializamos en bus SPI */ |
spi = mraa_spi_init(SPI_BUS); | spi = mraa_spi_init(SPI_BUS); | ||
if (spi == NULL) { | if (spi == NULL) { | ||
| − | fprintf(stderr, " | + | fprintf(stderr, "Fallo al inicializar SPI\n"); |
mraa_deinit(); | mraa_deinit(); | ||
return EXIT_FAILURE; | return EXIT_FAILURE; | ||
} | } | ||
| − | /* | + | /* establecemos la frecuencia del bus SPI */ |
status = mraa_spi_frequency(spi, SPI_FREQ); | status = mraa_spi_frequency(spi, SPI_FREQ); | ||
if (status != MRAA_SUCCESS) | if (status != MRAA_SUCCESS) | ||
goto err_exit; | goto err_exit; | ||
| − | /* | + | /* ponemos el modo big endian */ |
status = mraa_spi_lsbmode(spi, 0); | status = mraa_spi_lsbmode(spi, 0); | ||
if (status != MRAA_SUCCESS) { | if (status != MRAA_SUCCESS) { | ||
| Line 221: | Line 228: | ||
mraa_result_print(status); | mraa_result_print(status); | ||
| − | /* | + | /* paramos el bus spi */ |
mraa_spi_stop(spi); | mraa_spi_stop(spi); | ||
| − | /* | + | /* desinicializamos mraa para la plataforma (no es necesario la mayoría de las veces) */ |
mraa_deinit(); | mraa_deinit(); | ||
| Line 230: | Line 237: | ||
} | } | ||
root@localhost:~# gcc spi.c -lmraa | root@localhost:~# gcc spi.c -lmraa | ||
| − | + | ||
| + | entonces usamos '''pin19''' y '''pin21''' y ejecutamos run a.out | ||
| + | |||
root@localhost:~# ./a.out | root@localhost:~# ./a.out | ||
0xaa | 0xaa | ||
| Line 236: | Line 245: | ||
...... | ...... | ||
| − | === | + | ===Probando pwm=== |
| − | + | Para probar pwm con python, deberemos instalar python y libpython2.7 | |
apt-get install libpython2.7 python | apt-get install libpython2.7 python | ||
| − | + | usamos el siguiente script python: | |
root@localhost:~# cat pwm.py | root@localhost:~# cat pwm.py | ||
#!/usr/bin/env python | #!/usr/bin/env python | ||
| − | # | + | # Ejemplo de Uso: Genera un PWM a un ratio de paso de 0.01 constantemente. |
import mraa | import mraa | ||
import time | import time | ||
| Line 267: | Line 276: | ||
root@localhost:~# | root@localhost:~# | ||
| − | + | entonces ejecutamos run pwm.py | |
root@localhost:~# ls | root@localhost:~# ls | ||
| Line 274: | Line 283: | ||
root@localhost:~# ./pwm.py | root@localhost:~# ./pwm.py | ||
| − | === | + | ===Probando uart=== |
| − | + | Desactivando la consola de depuración y activando uart2 | |
root@localhost:/# cat boot/hw_intfc.conf | root@localhost:/# cat boot/hw_intfc.conf | ||
| − | # Hardware | + | # Configuración Interfaz Hardware |
| − | # | + | # Para más detalles, mira el fichero /usr/local/share/doc/rockpi4-dtbo/README |
| − | # | + | # Descomenta la línea de configuración si quieres usar esta característica. Como ejemplo i2c6. |
| − | # | + | # off desactiva el bus i2c6 y on activa el bus i2c6. |
intfc:pwm0=on | intfc:pwm0=on | ||
| Line 295: | Line 304: | ||
intfc:i2c7=off | intfc:i2c7=off | ||
| − | # DTS Overlay | + | # Configuración DTS Overlay |
| − | # 1. | + | # 1. comprobar nombre.dtbo en /boot/overlays |
| − | # 2. | + | # 2. añadir intfc:dtoverlay=nombre como se usa debajo |
#intfc:dtoverlay=at24c02 | #intfc:dtoverlay=at24c02 | ||
| Line 303: | Line 312: | ||
'''intfc:dtoverlay=console-disabled''' | '''intfc:dtoverlay=console-disabled''' | ||
#intfc:dtoverlay=console-on-uart4 | #intfc:dtoverlay=console-on-uart4 | ||
| + | |||
root@localhost:/# | root@localhost:/# | ||
| − | + | entonces '''reinicia''' y conecta '''pin8''' y '''pin10'''. | |
| − | + | usa ssh para conectarte al rockpi4, debemos tener 2 ventanas, una para enviar datos y otra para recibirlos. | |
| − | + | enviar el siguiente comando: | |
sudo mraa-uart dev 0 baud 1500000 send data | sudo mraa-uart dev 0 baud 1500000 send data | ||
| − | + | recibir el siguiente comando: | |
sudo mraa-uart dev 0 baud 1500000 recv 1000 | sudo mraa-uart dev 0 baud 1500000 recv 1000 | ||
| − | + | la ventana de recepción mostrará los datos | |
| + | |||
| + | </div> | ||
Latest revision as of 19:47, 19 March 2019
ROCK Pi 4 > Desarrollando > Instalar Libmraa
Contents
Libmraa-rockpi4
Estas son las instrucciones para saber instalar libmraa.
Instalación de Paquetes Esenciales
Edita /etc/apt/sources.list y añade lo siguiente:
Para Debian Stretch
deb http://apt.radxa.com/stretch/ stretch main
Para Ubuntu bionic
deb http://apt.radxa.com/bionic/ bionic main
Obtenemos la clave pública
wget -O - apt.radxa.com/stretch/public.key | sudo apt-key add -
Actualizamos
sudo apt-get update && sudo apt-get upgrade
Instalamos los paquetes esenciales:
sudo apt-get install -y rockchip-overlay rockchip-fstab && sudo apt-get install -y rockpi4-dtbo
Instalamos el último cargador u-boot y el último núcleo
apt-get install rockpi4b-rk-u-boot-lastest
Ejecutamos manualmente el script de u-boot flash
/usr/local/sbin/rockpi4b_upgrade_bootloader.sh
Tecleamos YES para realizar la grabación de la imagen uboot.img.
... instalamos el núcleo
apt-get install linux-base apt-get install linux-4.4-lastest
Después, comprobamos el fichero /boot/extlinux/extlinux.conf. Debe de listar todas las versiones del núcleo instaladas en el ROCK Pi. El núcleo correspondiente a la primera etiqueta es la versión más nueva y la primera opción de inicio.
Activando una Interfaz
Mirar en rockpi4 pines GPIO,ROCK Pi 4 tiene 40 pines de expansión. Cada pin se diferencia por un color. En la librería mraa se definen así los pines:
15 GPIO:
PIN07 GPIO2_B3 PIN12 GPIO4_A3 PIN15 GPIO4_C5 PIN16 GPIO4_D2 PIN18 GPIO4_D4 PIN22 GPIO4_D5 PIN29 GPIO2_B2 PIN31 GPIO2_B1 PIN32 GPIO3_C0 PIN33 GPIO2_B4 PIN35 GPIO4_A5 PIN36 GPIO4_A4 PIN37 GPIO4_D6 PIN38 GPIO4_A6 PIN40 GPIO4_A7
2 I2C:
PIN3 I2C7_SDA PIN5 I2C7_SCL PIN27 I2C2_SCL PIN28 I2C2_SCL
1 SPI:
PIN19 SPI1_MOSI PIN21 SPI1_MISO PIN23 SPI1_CLK PIN24 SPI1_CS0
1 UART:
PIN8 UART2_TX PIN10 UART2_RX
2 PWM:
PIN11 PWM0 PIN13 PWM1
modifica /boot/hw_intfc.conf para activar pwm0,pwm1,spi1,i2c2,i2c7 para su comprobación
root@localhost:/# cat boot/hw_intfc.conf # Configuración de Interfaz Hardware # Para más detalles, mira el archivo /usr/local/share/doc/rockpi4-dtbo/README # Descomenta la línea de configuración si quieres usar esta característica. Como ejemplo i2c6. # off desactiva el bus i2c6 y on activa el bus i2c6. intfc:pwm0=on intfc:pwm1=on intfc:uart2=off intfc:uart4=off intfc:spi1=on intfc:spi2=off intfc:i2c2=on intfc:i2c6=off intfc:i2c7=on # Configuración DTS Overlay # 1. comprobar nombre.dtbo en /boot/overlays # 2. añadir intfc:dtoverlay=nombre como se usa debajo #intfc:dtoverlay=at24c02 #intfc:dtoverlay=two-color-led #intfc:dtoverlay=console-disabled #intfc:dtoverlay=console-on-uart4 root@localhost:/#
luego reinicia
Instala la librería libmraa-rockpi4
apt-get install libmraa-rockpi4
Haciendo Pruebas...
Probando los gpio
Usa la herramienta mraa-gpio para probar
root@localhost:~# mraa-gpio list 07 GPIO2_B3: GPIO 12 GPIO4_A3: GPIO 15 GPIO4_C5: GPIO 16 GPIO4_D2: GPIO 18 GPIO4_D4: GPIO 22 GPIO4_D5: GPIO 29 GPIO2_B2: GPIO 31 GPIO2_B1: GPIO 32 GPIO3_C0: GPIO 33 GPIO2_B4: GPIO 35 GPIO4_A5: GPIO 36 GPIO4_A4: GPIO 37 GPIO4_D6: GPIO 38 GPIO4_A6: GPIO 40 GPIO4_A7: GPIO root@localhost:~# mraa-gpio set 40 1 // pin40 se activa a nivel alto root@localhost:~# mraa-gpio set 40 0 // pin40 se activa a nivel bajo root@localhost:~#
Probando i2c
Usa la herramienta mraa-i2c para probar, si tenemos un dispositivo esclavo i2c, por ejemplo una EEPROM I2C, haremos:
root@localhost:~# mraa-i2c list Bus 0: id=07 type=linux default Bus 1: id=02 type=linux root@localhost:~# mraa-i2c detect 0 // dispositivo en el bus 0 00: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: 50 51 52 53 54 55 56 57 -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- root@localhost:~# mraa-i2c detect 1 // ningún dispositivo en el bus 1 00: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- root@localhost:~# mraa-i2c set 0 0x50 0x10 0x55 // escribir en el dispositivo 50, en su registro 10 el valor 55; grabará 0x55.
root@localhost:~# mraa-i2c get 0 0x50 0x10 // leer del dispositivo 50, su registro 10; se devolverá 0x55.
root@localhost:~#
Probando spi
Usamos c para probar el spi, compilamos spi.c
root@localhost:~# cat spi.c
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>
/* cabecera mraa */
#include "mraa/spi.h"
/* declaración SPI */
#define SPI_BUS 0
/* frecuencia SPI Hz */
#define SPI_FREQ 400000
int
main(int argc, char** argv)
{
mraa_result_t status = MRAA_SUCCESS;
mraa_spi_context spi;
int i, j;
/* inicializar mraa para la plataforma (no es necesario la mayoría de las veces) */
mraa_init();
//! [Interesante]
/* inicializamos en bus SPI */
spi = mraa_spi_init(SPI_BUS);
if (spi == NULL) {
fprintf(stderr, "Fallo al inicializar SPI\n");
mraa_deinit();
return EXIT_FAILURE;
}
/* establecemos la frecuencia del bus SPI */
status = mraa_spi_frequency(spi, SPI_FREQ);
if (status != MRAA_SUCCESS)
goto err_exit;
/* ponemos el modo big endian */
status = mraa_spi_lsbmode(spi, 0);
if (status != MRAA_SUCCESS) {
goto err_exit;
}
while(1) {
printf("0x%x\n",mraa_spi_write(spi, 0xaa));
}
err_exit:
mraa_result_print(status);
/* paramos el bus spi */
mraa_spi_stop(spi);
/* desinicializamos mraa para la plataforma (no es necesario la mayoría de las veces) */
mraa_deinit();
return EXIT_FAILURE;
}
root@localhost:~# gcc spi.c -lmraa
entonces usamos pin19 y pin21 y ejecutamos run a.out
root@localhost:~# ./a.out 0xaa 0xaa ......
Probando pwm
Para probar pwm con python, deberemos instalar python y libpython2.7
apt-get install libpython2.7 python
usamos el siguiente script python:
root@localhost:~# cat pwm.py
#!/usr/bin/env python
# Ejemplo de Uso: Genera un PWM a un ratio de paso de 0.01 constantemente.
import mraa
import time
x = mraa.Pwm(11) # pin11 pwm0
# x = mraa.Pwm(13) # pin13 pwm1
x.period_us(700)
x.enable(True)
value= 0.0
while True:
x.write(value)
time.sleep(0.05)
value = value + 0.01
if value >= 1:
value = 0.0
root@localhost:~#
entonces ejecutamos run pwm.py
root@localhost:~# ls pwm.py root@localhost:~# chmod +x pwm.py root@localhost:~# ./pwm.py
Probando uart
Desactivando la consola de depuración y activando uart2
root@localhost:/# cat boot/hw_intfc.conf # Configuración Interfaz Hardware # Para más detalles, mira el fichero /usr/local/share/doc/rockpi4-dtbo/README # Descomenta la línea de configuración si quieres usar esta característica. Como ejemplo i2c6. # off desactiva el bus i2c6 y on activa el bus i2c6. intfc:pwm0=on intfc:pwm1=on intfc:uart2=on intfc:uart4=off intfc:spi1=on intfc:spi2=off intfc:i2c2=on intfc:i2c6=off intfc:i2c7=off # Configuración DTS Overlay # 1. comprobar nombre.dtbo en /boot/overlays # 2. añadir intfc:dtoverlay=nombre como se usa debajo #intfc:dtoverlay=at24c02 #intfc:dtoverlay=two-color-led intfc:dtoverlay=console-disabled #intfc:dtoverlay=console-on-uart4
root@localhost:/#
entonces reinicia y conecta pin8 y pin10. usa ssh para conectarte al rockpi4, debemos tener 2 ventanas, una para enviar datos y otra para recibirlos.
enviar el siguiente comando:
sudo mraa-uart dev 0 baud 1500000 send data
recibir el siguiente comando:
sudo mraa-uart dev 0 baud 1500000 recv 1000
la ventana de recepción mostrará los datos
