Sensor ultrasónico HC-SR04 en Icaro

Para conectar un sensor ultrasónico HC-SR04 a una placa Icaro vamos a usar el conector P16 a como se muestra en la siguiente imágen.

Opcionalmente podríamos tomar corriente del banco de sensores analógicos.

En Icaro Bloques podemos ir a Archivo -> Ejemplos y escoger la carpeta hc-sr04 y abrir el ejemplo llamado ping.icr

Este firmware lo que hace es mostrar la distancia en centimetros en valores binarios en la barra de leds de la placa.

Icaro Bloques 1.0.8-3 y Pingüino Bootloader Versión 4

Icaro Bloques llega a la versión 1.0.8-3 y trae como principal cambio el uso del bootloader de pingüino  versión 4.

Este bootloader esta escrito en sdcc3 y entre los cambios notables está que es más pequeño y nos deja más espacio para nuestro firmware.

El cambio se ve impulsado por problemas con en Fedora 24 y 25 en la comunicación serial. En algunos casos no se lograba montar adecuadamente el dispositivo ACM, aunque en algunos casos el PIC se colgaba al inicializar. Lo que uno veía era que la luz de estado del PIC se apagaba justo después de encender, haciendo un parpadeo de un lapso apagado largo y un breve destello.

Lo más novedoso es el proceso de ejecución y carga de firmwares. Ahora la placa entra en estado de ejecución del firmware al encender y solo entra en la rutina de carga al apretar el botón reset.

Con el nuevo bootloader el proceso de carga del firmware cambia. Los pasos son a como siguen:

  1. Dar click en el botón de “Compilar” en Icaro Bloques para compilar el firmaware
  2. Dar click en Cargar para enviar el firmaware al PIC
  3. Oprimir el botón de reset en la placa. (El led de estado parpadea de forma continua)
  4. Dar click “Aceptar” en la ventanita lanzador.py que nos muestra la comunicación de la PC y la placa
  5. Dar click en OK en la notificación del resultado de la carga.

La carga es mucho más rápida.

Otras ventajas del nuevo bootloader es que se han trabajado las librerías, y por ejemplo ahora el control de servos es más preciso.

Si bien Icaro Bloques 1.0.8-3 tiene por defecto comunicarse con la versión 4 del bootloader uno puede editar el archivo /home/user/.icaro/config.ini

[general]
turtlear = /usr/share/sugar/activities/TurtleBlocks.activity/turtleblocks.py
dir = firmware
sdcc = sdcc-sdcc

[icaro_config]
bootloader = v4

Solo hay que reemplazar el número 4 por un número 2. Con ese cambio estaremos listos para correr el programa con PICs que tengan aun el bootloader de la versión 2 de pingüino.

Pilas no esta disponible en Icaro Bloques 1.0.8-3 debido a que no se ha trabajado las nuevas librerías para comunicación Bulk. Sin embargo se ha optado por avanzar debido a los grandes problemas de comunicación con el firmaware de tortucaro para comunicación CDC.

Conectar un shield Bluetooth a Ícaro

Arduino tiene dos shields de Bluetooth, el HC-05 y el HC-06. El HC-05 tiene la posibilidad de funcionar como unidad master o slave, mientras que el HC-06 solo puede funcionar como slave. En este caso me enfocaré al uso como slave, donde abrimos un canal de comunicación de la PC hacia la placa para enviar ordenes y recibir respuesta de estado de los sensores.

El HC-05 tiene 6 pines y el HC-06 tiene solo 4. Para este caso solo usaremos 4 pines, en cualquiera de los dispositivos. En el reverso del dispositivo están claramente indicados los pines RXD, TXD, GND y VCC

Por otra parte hay que ver el mapa de pines de la placa icaro para identificar en los puertos de servos cuales corresponden a señal, cuales a VCC ( corriente de +5VDC) y GND (Tierra). Igual pueden verse en la ilustración a continuación

Asignación
TXD – Pin de Señal K5 (pin más cerca del micro)
RXD – Pin de Señal K6
VCC – VCC K5 (pin del centro)
GND – GND K5 (pin más lejos del micro)

Luego de haber conectado el shield de Bluetooth a la placa procedemos a cargar el firmware de Bluetooth a la placa de Ícaro. Para ello conectamos la placa con un cable USB a la computadora, cargamos Ícaro bloques y buscamos el botón de icaroblue.

Este firmware se compila automáticamente y nos invita a resetear la placa Ícaro. Procedemos a oprimir el botón reset de la placa Ícaro esperamos por el mensaje de que la carga se realizó con éxito.

Podemos continuar usando el cable USB como fuente de energía, conectado a la PC o a un transformador. O bien pasamos a alimentar la placa desde una fuente externa, haciendo el cambio del jumper K1.

Para iniciar la comunicación debemos usar el administrador de dispositivos Bluetooth y hacer el emparejamiento con el dispositivo. Luego necesitamos hacer un clic derecho sobre dicho dispositivo para conectarlo como un puerto serial.

Una vez conectado como puerto serial podemos verificar la conexión usando un programa de comunicación serial como cutecom. Los parámetros de conexión que debemos configurar son:
Device: /dev/ttyrfcomm0
Baud rate: 9600bps

Le damos clic al botón Open device y debería establecerse la conexión.

Procedemos a escribir la letra “b” en la barra de input y damos enter.

Deberíamos ver en la pantalla una respuesta Icaro USB2.0 que es la respuesta al comando de estado.

Esto es suficiente para ver que esta funcionando. Mi siguiente reto es documentar los comandos seriales que pueden usarse con la placa ya sea por el cable USB o vía Bluetooth.

Conectar una pantalla LCD a Ícaro

Tengo esta pantalla de 16 caracteres por 2 lineas que deseaba conectar a la placa Ícaro. Esta pantalla es de las más comunes, pero ahora están tomando popularidad pantallas que incluyen un modulo I2C de comunicación. Esta pantalla no incluye dicho módulo. Espero hacer notas sobre trabajo con dispositivos I2C e Ícaro en el futuro.

Para conectar la pantalla LCD 2×16 vamos a ocupar 12 lineas de conexión. Pero lo más importante, antes de iniciar, es conocer nuestro Port B o P5 de la placa Ícaro.

El Port B es la salida del micro-controlador hacia el UNL2803. Si sostenemos placa con la barra de led hacia la derecha de forma que el micro controlador este arriba del integrado UNL2803, entonces en el Port B tendrás los pines de izquierda a derecha. El primer pin de la izquierda sera P0 y el ultimo hacia la derecha será P7.

Para conectar hay que seguir la siguiente asignación.

Pantalla – Placa Ícaro
VSS – Ground
VDD – +5VDC
V0 – Ground
RS – P4 Port B
RW – Ground
E – P5 Port B
D0
D1
D2
D3
D4 – P0 Port B
D5 – P1 Port B
D6 – P2 Port B
D7 – P3 Port B
A – +5VDC
K – Ground

Las lineas de +5VDC y Ground las conecte a los pines de VCC y Ground de los sensores analógicos. Igual podría conectarse a los pines respectivos en los puertos de servos.

Opcionalmente en la linea A se puede conectar una resistencia para variar el brillo o contraste de la pantalla, dado que A y K son los que alimentan la luz de la pantalla.

Para probar que todo esta bien solo hace falta abrir un script del menú Archivo, seleccionar Ejemplos, ahí navegar a la carpeta LCD y cargar el archivo llamado hola mundo. Como siempre, compilar el script y luego cargar al micro-controlador.

Al ver el script podemos identificar que se envían 0 y 0 antes de enviar los caracteres “hola”. El primer cero corresponde a la Columna y el siguiente corresponde a la Fila. Esto la posiciona en la primera columna de la primera fila. Como vemos “mundo” recibe de previo 0 y 1, es decir primera columna, segunda fila.

La pausa al final es importante, es lo que mantiene los caracteres en pantalla antes de reiniciar el bucle infinito del script. Sin la pausa, o con un valor muy pequeño, no podríamos ver el mensaje. Por otro lado las pausas son importante antes de borrar la pantalla o asignarle un nuevo valor. Sin pausa, el nuevo valor se mostrara en pantalla antes de que podamos haberlo leído.

Ahora lo que resta en experimentar y aprender.

Usar funciones en Icaro Bloques

Usar funciones al programar nos permite reutilizar código. En particular al tratar con bloques, nos evita atiborrar la pantalla, pero también nos evita errores de conexión entre bloques al repetir varias veces lo mismo.

Lo primero es crear una rutina que será nuestra función. Un ejemplo sencillo, hacer parpadear un led. Esta rutina la salvamos como un archivo de icaro.

Luego la salvamos como una función con el mismo nombre.

En el ejemplo siguiente mostramos como hacer la llamda de la función. Usamos un bloque de carga_func para llamar a la funcion y luego un bloque de acción con la función.

Para que esto funcione debemos salvar la rutina como un archivo de icaro y luego darle compilar. Todos los archivos deben estar en la misma carpeta, de esta manera Ícaro Bloques encuentra el código a usar de los archivos.

Si nos vamos a la pestaña de código fuente y damos click en el boton recargar, podremos ver el código con la declaración de la función y el llamado a la misma en lenguaje C.

 

Flisol 2016 Managua

Usualmente Flisol se celebra en Abril, pero por diversas razones, se decidió postergar para celebrase el 14 de Mayo de 2016. Para este evento, por parte de Fedora tuvimos la oportunidad de tener presencia en tres espacios.  En instalaciones, las mesas y las charlas.

 

Samuel estuvo ayudando en el área de instalaciones. Como siempre es un apoyo general, pero es importante que colaboradores que tienen experiencia en Fedora esten disponibles. Les brindan seguridad a los usuarios. Además estuvieron copiando las imagenes ISO del sistema operativo.

En la mesa nos turnamos varios. William, Naima, Fernando, Eduardo y yo recibimos a las personas, les comentamos sobre Fedora y contestamos sus preguntas. Gracias al patrocinio del Proyecto Fedora teniamos calcomanías para distribuir. De parte de la comunidad habiamos colectado para tener algunos discos.

Algo que llamó la atención fue la presencia de los robots del proyecto icaro. Robots hechos 100% con Fedora, tanto hardware como software.  Teniamos una araña con una placa NP-05 y un auto evasor de obstaculos con una placa NP-07 funcionando. En proceso de construcción tenemos un brazo robot. EezyBotArm es un diseño para ser replicado en impresoras 3D. Con una placa Icaro NP-06 estabamos controlando 4 servos usando potenciometros para controlarlos. Aun nos faltan ajustes, pero da idea de la variedad de aplicaciones de Icaro y como las placas han ido evolucionando. También teniamos una laptop para mostar el uso de Icaro bloques, aunque la mayor parte del tiempo se uso para preguntas de Fedora.

Recibimos publico en general, pero en particular podemos destacar la visita de estudiantes de Cyber-Periodismo que hicieron sus prácticas de entrevistas con distintos expositores. Una de las entrevistas salio publicada en El Nuevo Diario. También nos visitaron dos tropas de Scouts.

Omar presentó una charla sobre virtualizar sistemas android. Por mi parte estuve hablando sobre robótica educativa. (Descarga aqui la presentación)

Aura Lila apoyo al evento y tomó muchas fotos. Gracias a ella puedo ilustrar mi reporte sobre este evento.

Un agradecimiento especial a la comunidad de Mozilla Nicaragua por organizar este evento donde todos pudimos divulgar distintas facetas del software libre.

Curso de Robótica Educativa con Icaro

Estamos emocionados y con algo de pánico al anunciar que vamos a hacer un Curso de Robótica Educativa con Icaro. Bueno, en realidad son dos cursos.

La idea es aprovechar a Valentin Basel, iniciador del Proyecto Icaro, a Niacaragua. El fin más importante detras del curso es la documentación que vamos a generar con el proceso de preguntas y respuestas a lo largo del curso.

Pero la parte más especial es que el curso implica construir un robot que el participante se va a llevar a su casa para seguir experimentando y aprendiendo. Quien no quiere un robot?

Carro Robot detector de obstaculos

El costo del curso es $95, que  prácticamente el costo de los componentes para ensamblar la palca de control Icaro, más los accesorios para armar el robot. En la documentación pueden ver los anexos 1 y 2. La lista es algo larga y la estamos entregando al participante.

Las fechas tentativas son del Lunes 20 al Viernes 24 de Junio de 2016 en Mansión Teodolinda, Bolonia, Managua. MAPA

Pero porque dos cursos?

Curso para Docentes: Iniciamos desde cero y vamos despacio. Eso significa que solo cubrimos Icaro Bloques, la interfase para niños. Pero el docente tendra suficiente pasa seguir aprendiendo. Horario 3:00pm a 5:30pm. Ver la docuemtación del curso AQUI

Curso para Experimentadores: Suponemos que el participante usa linux, puede distinguir una resistencia de un led y además puede soldarlos. Pasamos Icaro Bloques rápido para entrar a lenguaje C y Python. Horario de 6:00pm a 8:30pm. Ver la documentación AQUI.

Solo vamos a ofrecer 15 cupos para cada curso. Hemos hecho gestiones para ver si conseguimos que algunas instituciones nos patrocinen el cupo de algunas personas. Si eso sucede, estaremos avisando por la lista de la Comunidad de Software Libre de Nicaragua.

Para incribirse o si tienen dudas puede escribir a:

correo de neville

La idea es que posterior al curso vamos a tener componentes para seguir pomocionando la robótica, de forma que esto no sea un esfuerzo aislado, sino que de alguna manera tenga continuidad.

Pondering personal outcomes from FUDCon Cordoba 2015

Traveling to the other side of the world is a basket of surprises. I can’t help to be amazed by tiny details. Having furnaces for heating, gas boilers for heating water and keys that look from a fantasy world; changed a lot my first contact with Argentina. I was no longer bothered by funny power sockets or the toilet water sniping in the wrong direction.

In some graffiti I read something like, there is no worst nostalgia like the one that come form things that didn’t happened. I longer for walking the city. At Managua is not possible, people usually think about the temperature. Managua is aggressive toward the pedestrian which has no side walk and can not expect priority crossing at an intersection. Pedestrian also have to endure this over long distances as the city is disperse. So been loose in Cordoba with so many pedestrian pass on the center was a bless. I was amazed that the city has critical mass to sustain business like bookstores, electronic stores, photo processing among others. I was jealous. Wantend to walk in every direction and see every corner. Walking 15 or 20 blocks was such an opportunity to see the architecture. Tall buildings, side to side. Managua grew flat scared from the mayor earthquake on 1972, you have few buildings to look up. My leg ached every night and woke up with cramps every morning, but I was happy.

Food took time to become something. Minimalist breakfast is not for me. Get to eat at a shopping center didn’t spark it either. But as FUDCOn satarted and I move into the hotel, they did a great job giving us different samples of Argentinian food: pizza (Argentina has a strong Italian culture due several waves on immigration), choripan (real sausage with bread) and Argentinian grill. Beto’s gave us the taste of popular food with its lomitos (big sandwiches) and french fries with egg on the side. There is also the sweet side Argentina savoring ‘dulce de leche’ and alfajores. I still do not know what to make of Fermet, a digestive drink. People suppose to love it or hate it, I am still puzzled. Street bakery giving us cheeses mandioca bread, ending up with a big bag, more that I should ate. Luckily was easy to share. Sorry Argentina, but the top prize for food was for Jared’s pancakes. He messed with me, I am now spoil. From that moment on, every single pancake will be compared to Jared’s pancakes and will fail miserable. For the rest of my life I will think of Jared when I ate pancakes.

I always saw Fedora people as special, Laura gave me a better word, they are magical. Getting to see old friends, attach a face to a email or irc nick name, get to know the people when is happy, sleep deprived, thoughtful, or silly make understand better what drives them. Beyond that as part of the project you understand better at what they are the best so you can point them as a valuable source of knowledge that I don’t have.

Energy is the most key element of the event. People recharge at FUDCon. They get recharged to keep doing the marvelous thing that they do for our beloved project. This alone I think is the most valuable gain for Fedora Project, get people ready to keep collaborating. Even better is contagious, because this people are overcharged, so when the get home the pass energy and excitement to other people.

I have to said that the recharging issue has changed for me. Either I am getting older or I am maturing as a collaborator after 8 years on the Project. Maybe is both and maybe is a good thing. Previous years I got over excited wanting to do everything. Now I got plenty on energy, but I get exited about certain stuff and not about other. Hopefully this means that I get to do fewer stuff but better, sustained, with deeper impact.

I wanted to do a lot regarding Icaro an educational robotics project. I did just a little bit. More of my attention went to 3D printing, which I hope will bring a boost to Icaro when I became proficient in printing robot parts. Again time is scarce. We did a lot of shopping for nuts and bolts, testing, and assembling for the 3D printer that it shattered my heart to dismantle it to be able to put it on the suit case. At least the care of packing paid off and everything seems fine.

Another topic that I wanted to engage was documentation. Some people struggle to write, I have to see how I keep things short. But for me, I needed better grasp of the tooling around Fedora Documentation. I have to deeply thanks to William Moreno who gave me a big push into practicing the basic of publican. During FUDCon that paid off as I have time with Jared Smith (the before mentioned pancake wizard) who help me understand some working of publican with the current version of Fedora. Some tweaks and some advises. Short time but highly valuable.

I pushed as hard as i could before the FUDCon to make space for a meeting about the future of LATAM and FUDCon. It worked out, we got the meeting, there were several ideas, some concerns were aired and some actions proposed. Not sure how this will evolve, but at least is moving. This lead to a very interesting session one on one with Remy Decausemaker. I am on board of Comm-Ops, I see that as the place that I should be helping the project. Just as now we have a partial translation of the web site What can I do for Fedora to Spanish. We should work with website team to make it fully translatable. Get a new domain in Spanish, maybe?

From the bottom of my hear I want to thanks the event owners, FUDCon game me so much. Laura who was watching over us, making sure that we were fine. Shared a systematic way of thinking that is unique to me, hope the hints that I got help me to be better at deconstructing problems. She also gave the map to the hidden paradise in Cordoba, a candy supermarket. Matias who orchestrated the event and opened his house, pick most of us at the airport and shared his quick and sharp sense of humor. Valentin gave a place to stay in Cordoba and he organized the sessions. I owe him big time for all the time, effort and money that he put into making my 3D printer a reality. I tried to repaid as much as I could his expenses, but he keep bringing more and more stuff.

There are maore people to thanks but the list of names is mixed up with nicknames and is becoming increasingly confusing who gave that special idea, that profound thought or even just sharing the highs and lows of live.

What FUDCon is really about?

The most common assumption is that FUDCon is about create user base, recruit collaborators and strength the community. But if you think about it, it is difficult to achieve all of them at the same time with high degree of success on all of them. On top of that you have great people that undertake the task of logistics, promotion and obtain sponsorship. FUDCon needs more budget to do so all that. People doing this job are subject to regular scrutiny by the community. Sometimes people ask about how preparation are going with good intention of helping, sometimes they are just curious and sometime just to complain. The local team most likely has no experience and no expertise on this kind of undertake. Also local team has no idea of how budget has to be handled, as nobody has explained to them. On top of that there is a overhead cost for event owners for running the event: crossing the city to meet potential sponsors, paying gas, taking time off from work. Most likely all those expenses are not reported and not reimbursed. So, obviously, high performance on three different areas becomes more challenging when you take into account the context like people demanding information, radinness, and your own hability to pay your share for the event.

But really, What FUDCon is really about?
There is no common agreement on this at the region level, just a fussy idea. There is no clear direction from any stakeholder higher up on the Project. Maybe, will be better to say stakeholders with a more community wide role. This is kind of crazy, because it is impossible to give an idea of success if there is no clear direction.

Create user base.
From my stand point, creating user base is a long process that requires long time effort of guidance and nurturing. It can be boosted by a spectacular conference, but will require follow up anyway. Having said that, I think that every FUDCon is an amazing collection of stars. As a new friend said, Fedora people is magical. But I will not said they are all rock stars, as we have a very rich collection of bachata, nueva trova, cumbia, reggae, bossa nova and so other marvelous musics talents. Well not me, because I suck at music.

Seriously, we have the best talents of the region in one place, but we are talking about virtualization and robotics, graphical design and network monitoring, software translation and 3D printing. If we fall asleep on conferences, is not only about jet lag and after hours hacking, it is also that none of us can really follow all those diverse topics. We should think how to better organize and categorize topics, so we can reach niches where we could boost user base that has been seed before the event.

Recruit Collaborators
From my stand point, the way to recruit collaborator is to push into the water people that is looking into the pond. You can get people in the water to make more laps, true. You can get people on the water to try a different styles, also true. But we need new people, to have a healthy communnity means people comes and goes. Definitely will be bad if you drag someone from far away into the water. Trying to get people from zero to collaborator in three days is non sense.

The key point is to identify those people that are proficient on Linux using git, ssh, rsa, ftp, vim and all the rest of letter soup and show them things that they can and may like to do for Fedora. Maybe you can find people creating amazing software and invite them to package their software to be part of Fedora repos. This is a task for the local team, and they need time to focus on find them. What local team from the rest of the Project is the people that can teach the ropes, can provide credentials and even have a showcase of a example to fast forward the entire process, so people that will become collaborators have a wide view of the task, while they engage in small steps.

Let me spell it out clearly how I see it. We should sponsor people that have the talents and credentials to guide people into collaborating to the project if we are going to recruit collaborators. We should provide time, space and resources to deploy this guidance. Bad internet at small hotel is not good for this. A noisy corner at the back of the conference room is not good either. We need hacking space.

Strength the community.
Community is the key word. We get together, we do stuff, we share and we recharge energies to keep doing more stuff. The problem with this is how to measure success on recharging people’s energies? Preaching to the choir it is not the best way to do it, although some times may be good for sharing. We need to hack the community. We need to plan how to conquer the world and then eat cookies (or alfajores). This activity need time to debate and discuss, write proposals. Probably we need to select people with certain skills related to community building to be there.

Energy is contagious, one people traveling will share experience when returns to his or her local community and pass on the good vibe. Swag is a way of making this more tangible, but it is not required.

The silver-lining.
You can not engage in any of these activities without having certain impact on the other categories. If you make an event for recruiting collaborators, you will get some spill out on creating user base and most likely you will help to strength the community. So picking which you will focus does not entirely cancel positive effects on the other areas. Focusing on one or two, creating a new style of running the event, will always have good effects on those areas that we choose not to engage directly. Simplifying the event, will make life easier for local team and improve performance.

The horrible true.
I may be wrong. I am operating on the general paradigm of FUDCon which lacks direction. So, if we start asking about what FUDCon should be about, we can end with other expectations from the event. Hopefully with clear objectives. Hopefully with a better way to reward people that made FUDCon possible.

Our debt to FUDCon event Owners
All people attending to FUDCon gave a lot of hugs and thanks to organizers. Would be nice a pat on the back form major stake holders of Fedora Project thanking them for their effort and commitment. So, if you didn’t have the opportunity to attend to FUDCon Cordoba 2015, please drop a line and say thanks, they deserve it.

Media production for Bolivia

Our fellow collaborator Gonzalo Nina requested funds for producing media. This media were supposed to be used at FLISOL (Festival Latinoamericano de Instalación de Software Libre). This long name means Latin American Free Software Installation Festival. Don’t take my translation as official, it is hard to put three adjectives to one name in the correct order, specially considering that two of those adjectives are composed of two words each.

lorddemon

I am side tracking, I said «were supposed». Sure that raise questions. Unfortunately for Fedora our Bolivian Ambassador has plenty of work. I guess having plenty of work is fortunately for him. The issue is that nowadays his work require him traveling to Panama. His has been traveling to Panama several time in the past few months. Which means that he got funds from Fedora to produce media, but he didn’t have time for placing the order.

This was good and bad, as you may get the feeling of this post, plenty of looking at two faces of a coin. It was bad because the media was not ready for FLISOL. There was other issues with funds and dead lines that were bad. But FLISOL was too close to Fedora 22 release. So any left overs were surely be a waste of resources. The good side is that he placed an order for media of Fedora 22 which is quite on time for the Fedora Release party he is planning and also the rest of activities from now to Fedora 23 release, close to the end of this year.

media

Bottom line, Bolivia community now have 200 disk to raise interest about fedora and spread all the blue uber-force. There is already part of that material going to Cochabamba.