Un ROV de agua dulce / A sweet water ROV

I’m not quiet sure if I read this correctly, but there are a lot more features in PlatformIO than the “Build” and “Upload” button. See the documentation at Your Gateway to Embedded Software Development Excellence — PlatformIO latest documentation. A main feature is the easy project configuration with which one can create multiple environments for different target boards or source code files.

I know that in your particular case you’d like extended debugging on the AVR, but as said above that’s not there yet for the AVR. Although we might want to revisit VSCode PIO debugger for AVR which may be a working AVR debugger using a serial adapter…

Either directly copy-paste code in Markdown formatted text (Markdown Cheatsheet · adam-p/markdown-here Wiki · GitHub) or upload it on popular platforms such github.com as e.g. a gist (https://gist.github.com/) and post the link to, like e.g.

Anyways if there are code compilation problems or question on general programming or “why does this code fail” question, I can answer them.

1 Like

Buenas noches.

Muchísimas gracias por su tiempo y sus respuestas, quiero que sepa que le estoy muy agradecido, y me estoy tomando sus respuestas muy enserio, y me están ayudando mucho a resolver mis problemas de novato.

Si usted está leyendo bien, precisamente a eso me refiero, a hacer algo más que “Construir” y “Cargar” un programa.

Lo de subir los programas, entiendo que es falta de costumbre de utilizar el foro, y no saber cómo hacerlo, al no ver un botón para adjuntar los archivos del programa, digamos que ha sido un pensamiento en voz alta, porque entendía que tenía que haber una manera de hacerlo, y a demás tiene que ser fácil, pero yo no entendía ni encontraba cómo hacerlo.

Muchas gracias por los enlaces.

Todavía no estoy registrado en Github, porque entiendo que es una página lo bastante seria, como para publicar mis programas que no funcionan, y no estoy orgulloso de ellos para nada, y lo mas que puedo conseguir es que alguien los encuentre y me llame la atención, con razón, por publicar una cosa que no funciona.

Voy a leer los enlaces que me ha puesto, para comprobar si se puede hacer algo más con VSC y PIO, sobre la placa Arduino Mega 2560, pero por lo que usted me dice, intuyo que voy a poder hacer poco más de lo que ya he hecho, con su ayuda.

Ya hace unos días que compre unas placas ESP32, y están de camino, no deben de tardar en llegarme, supongo que con estas placas si voy a poder hacer más cosas con los programas, y luego, devolver los programas a Arduino, o quedarme con los ESP32, ya puestos me daría igual usar unas placas u otras en mi proyecto, lo que me interesa, es que los programas funcionen correctamente.

Adelantándome bastante a los acontecimientos, ya que no tengo todavía los ESP32, supongo que se podrán utilizar los programas con la estructura que tienen, aunque haya que hacer alguna VARIACIÓN MÍNIMA del programa y de los pines utilizados. Ya he leído en varios sitios, que hay algunos pines que no se pueden utilizar para conectar componentes externos, puesto que esos pines son utilizados para el propio sistema y funcionamiento del ESP32.

Me refiero a que haya un ESP32 dentro del vehículo, que controle los ESC o BEC de los motores, y que controle los sensores así como sus datos, y los envié a otro ESP32 que esté en el puesto de control, y mediante EasyTransfer, por un cable CAT6, y que reciba esos datos. Y que esos datos los pueda ver en una pantalla Nextion de 5 pulgadas. Que con el ESP32 de control, pueda manejar el mando de PS2, y el otro ESP32, reciba esos datos del mando y los interprete. Pudiendo aprovechar al máximo los programas que ya tengo hechos.

Entiendo que la mejor manera de aprovechar las placas ESP32 es con la comunicación wifi, pero mi proyecto tiene el problema añadido de que el ROV, cuando trabaja, está sumergido en el agua, por lo tanto la opción de usar la wifi, queda descartada, por eso es que utilizo EasyTransfer y el cable.

Muchas gracias de nuevo, por ofrecerme su ayuda en la programación, pero creo que ahora mismo podemos hacer poco más de lo que ya hemos hecho, sin las pacas ESP32.

No estoy rechazando su ayuda, ni mucho menos, pero en este momento, como comenta usted en su respuesta, no podemos hacer una depuración extendida de los códigos. De todas formas, voy a leer los enlaces, a ver si se pudiera hacer algo más.

Voy a subir los códigos, siguiendo sus instrucciones, para que los vea, por curiosidad, por si usted ve algo que le pueda resultar “incomodo de procesar” por cualquiera de las placas, y como entrenamiento de adjuntar los ficheros.

Le vuelvo a dar las gracias por su tiempo y sus comentarios, es un lujo poder contar con sus respuestas, está siendo un tutor magnifico, muchas gracias.

Y no se preocupe, que voy a seguir publicando cualquier mas mínima duda que tenga.

Un saludo.

Good night.

Thank you very much for your time and your answers, I want you to know that I am very grateful to you, and I am taking your answers very seriously, and are helping me a lot to solve my rookie problems.

If you are reading well, that’s exactly what I mean, to do more than “Build” and “Load” a program.

I understand that it is unusual to use the forum, and not knowing how to do it, by not seeing a button to attach the program files, let’s say it was a thought out loud, because I understood that there had to be a way to do it, and others it has to be easy, but I did not understand or find how to do it.

Thank you very much for the links.

I’m not registered on Github yet, because I understand that it’s a serious enough page, to publish my programs that don’t work, and I’m not proud of them at all, and the most I can get is for someone to find them and get my attention, rightly, for posting a thing that doesn’t work.

I will read the links you have put me, to check if you can do something else with VSC and PIO, on the Arduino Mega 2560 board, but from what you tell me, I intuit that I will be able to do little more than I have already done, with your help.

Already a few days ago I bought some ESP32 plates, and they are on their way, they should not take long to arrive, I suppose with these plates if I will be able to do more things with the programs, and then, return the programs to Arduino, or stay with the ESP32, already put I would not mind using some plates or others in my project, which I am interested in , is that the programs work properly.

Getting in the way of the events, since I don’t have the ESP32 yet, I suppose you will be able to use the programs with the structure that they have, even if you have to do some MINIMUM VARIATION of the program and the pins used. I have already read in several sites, that there are some pins that cannot be used to connect external components, since those pins are used for the system itself and operation of the ESP32.

I mean that there is an ESP32 inside the vehicle, that controls the ESC or BECs of the engines, and that controls the sensors as well as their data, and I sent them to another ESP32 that is at the checkpoint, and via EasyTransfer, by a CAT6 cable, and that receives that data. And let that data be seen on a 5-inch Nextion screen. That with the ESP32 control, you can operate the PS2 command, and the other ESP32, receive that data from the controller and interpret it. Being able to make the most of the programs that I already have made.

I understand that the best way to take advantage of ESP32 boards is with wifi communication, but my project has the added problem that the ROV, when working, is submerged in water, therefore the option to use the wifi, is discarded, that is why I use EasyTransfer and the cable.

Thank you very much again, for offering me your help in programming, but I think right now we can do little more than we have already done, without the ESP32 bales.

I’m not refusing your help, much less, but at this time, as you say in your response, we can’t do an extended debugging of the codes. Anyway, I’m going to read the links, see if anything else could be done.

I will upload the codes, following your instructions, so that you see them, out of curiosity, in case you see anything that you may find “uncomfortable to process” by any of the plates, and as a training to attach the files.

I thank you again for your time and your comments, it is a luxury to have your answers, you are being a magnificent tutor, thank you very much.

And don’t worry, I’m going to keep posting any more doubts I have.

Greetings.

Bueno, pues ya me he registrado en Github, más que nada, porque como los programas tienen tantas líneas de código, no los puedo publicar como texto en el foro de Platform IO.

Los he llamado “Programas ROV en evolución”, y en el nombre de cada programa, he puesto la advertencia “no funcionan aun”, para que nadie que pueda verlos se confunda con programas listos para utilizar, cuando estén terminados, editare los títulos y los cambiare por “ya funcionan”, u otra cosa que se me ocurra cuando llegue el momento.

Este es el enlace a los programas.

Un saludo.

Well, I’ve already registered on Github, mostly, because since programs have so many lines of code, I can’t post them as text on the Platform IO forum.

I’ve called them “EVOLVING ROV Programs,” and in the name of each program, I’ve put the “not work yet” warning, so that no one who can see them is mistaken for ready-to-use programs, when they’re finished, edit the titles and change them to “they already work”, or something else I can think of when the time comes.

This is the link to the programs.

Greetings.

Maxgerhardt, quiero pedirte un favor.

Quieres abrir el enlace de Github, y mirar si puedes trabajar con él, me refiero a descargar los programas y las librerías, y comprobar que lo puedes pasar al programa con el que tu trabajes, quiero comprobar que lo he hecho bien.

Muchas gracias, un saludo

Maxgerhardt, I want to ask you a favor.

You want to open the Github link, and see if you can work with it, I mean download the programs and libraries, and check that you can pass it to the program you work with, I want to check that I have done well.

Thank you very much, a greeting

Buenos días.
Maxgerhardt, ya he leído los enlaces sobre la depuración extendida

Pero lamento comentarle que son demasiado complicados para mi, y se escapan a mis conocimientos, por lo tanto me toca esperar a que me lleguen las placas ESP32.

Muchas gracias, un saludo.

Good morning.
Maxgerhardt, I’ve already read the links about extended debugging

But I regret to tell you that they are too complicated for me, and they are beyond my knowledge, so it is my turn to wait for the ESP32 plates to arrive.

Thank you very much, a greeting.

Buenas noches.

Leyendo el tema

Donde se comenta, Como crear un proyecto Arduino de múltiples archivos cpp, y leyendo los enlaces a los que hace referencia de cómo dividir un programa, he entendido como hacerlo, y creo que no es tan difícil.

Aplicándolo a mi proyecto, y a posibles proyectos futuros, donde tenga que utilizar los mismos sensores.

Si yo me hago un programa donde solo haga funcionar un sensor, por ejemplo el giroscopio GY-MPU6050, cuando lo tenga que volver a utilizar el giroscopio, solo tengo que decirle al programa nuevo, que me incluya ese programa que ya hace trabajar al MPU6050, y no tendría que volver a escribir todas las líneas del código, que hacen trabajar al giroscopio.

Por ejemplo

Nombre del programa que yo he hecho para que funcione el giroscopio

MPU6050.cpp

Que está dentro de la carpeta

C:\mis_sensores\MPU60550.cpp

La orden seria

#Include “mis_sensores“ // carpeta donde están los códigos de los distintos sensores

Void set up

Init MPU6050 // inicia el giroscopio

Void loop

Int MPU6050.cpp (); // utiliza todas las ordenes del programa de trabajo de giroscopio

Y no tendría que escribir nada más para que el giroscopio funcionase.

Un saludo.

Good night.

Reading the topic

Where we comment, How to create an Arduino project of multiple cpp files, and reading the links to which it refers to how to split a program, I understood how to do it, and I think it is not that difficult.

Applying it to my project, and to possible future projects, where I have to use the same sensors.

If I do a program where I only run a sensor, for example the GY-MPU6050 gyroscope, when I have to use it again the gyroscope, I just have to tell the new program, to include that program that already makes the MPU6050 work, and I would not have to rewrite all the lines of the code, which make the gyroscope work.

For example

Name of the program I’ve done to make the gyroscope work

MPU6050.cpp

That’s inside the folder

C:\mis_sensores\MPU60550.cpp

The order would be

#Include “mis_sensores” // folder where the codes of the different sensors are

Void set up

Init MPU6050 // starts the gyroscope

Void loop

Int MPU6050.cpp (); // uses all the orders of the gyroscope work program

And I wouldn’t have to write anything else for the gyroscope to work.

Greetings.

Hola, no me he leído tus 50k lineas tal como le agradeces a maxgerhardt, hay otros modos de usar tus librerías y es precisamente creando una Clase que incluya los procedimientos que necesites.
Lo que haces es usar una especie de extensión de tus procedimientos, variables, constantes para poder incluirlas en un código nuevo y esta mas que bien. El siguiente nivel es justamente lo que te aconsejo, una clase. Creas procedimientos publicos y otros de caracter privado, al igual que con las variables.

Como nadie te ha llamado la atención, yo no traduciré al inglés.

PD: luego leeré tu detalle del ROV que es lo que me interesó.

Gracias Surbyte por contestar, estudiare tu propuesta.

Mi nivel de Ingles es casi nulo, y tengo que traducir con San Google, y al copiar el texto aqui en la publicación correspondiente, resulta que me lo vuelve a traducir, y al final no se en que idioma se ha publicado, a lo mejor por eso tengo tan poca ayuda.

Oye tu nombre me suena de otro foro, no serás el mismo Surbyte del foro SpainLabs - Comunidad 3D, Arduino, Raspberry, CNC, y más

El programa ha cambiado bastante desde que publique aquí la ultima vez, ahora esta compuesto por una serie de “pestañas” donde esta incluido el void loop de cada sensor, funciona igual, pero ahora esta algo mas claro de leer.

Voy a intentar adjuntarlo de alguna manera, y si no puedo subirlo, en spainlab esta también.

Como no puedo adjuntar los códigos, pongo el enlace a la página de Github

Un saludo.

Hola, soy novato en platformio. Me he bajado este archivo BME280-to-MySQL-logger-master.
Viene configurado para la tarjeta d1_mini pero necesito configurarlo para la Nodemcu v1 y configurar la velocidad a 115200 en vez de 9600.

¿Me podeis hacer el favor de decirme como configurar platformio.ini y si hay que hacer alguna modificacion mas en el codigo?

Gracias