Partie interactive du site pédagogique ELECINF344/ELECINF381 de Télécom ParisTech (occurrence 2011).


IRL: Tweets on the laser and DMX

This morning our armadeus board seemed not to want to work properly. We must repare it or use another one.


We did our first real tests with the DMX yesterday. We are now able to control a light with our DMX board. The information sent to the light can be modified by ZigBee. The ZigBee signal will be generated by a daemon on the armadeus which will listen to requests sent through 0MQ. These features are written but we need to get our armadeus back before performing full tests.
Next step is to use data from the database to select which parameters must be send to the light depending on the tweet we want to display.

Displaying tweets on the laser

Yesterday, we finally displayed a tweet retreived in the database on the laser, with a smooth scroll.
The main daemon, in C, starts by querying the oldest validated tweet in the database, then sends the string to a program that converts it to ILDA frames representing the animation of the scrolling text. As this processing is a bit too heavy to be efficiently done on the board, we decided to offload it on Google AppEngine, which offers great performances ! Whenever we do not have access to AppEngine, the processing is done on the board, but it is really slower. A cache mecanism is being implemented. If you want to use this service, you can find a documentation at irlrose2011.appspot.com. For the moment, it is protected by a password because we need to keep the bandwith and CPU time for our own tests.
Then, the result (a series of ilda points) is sent back to the main daemon through a socket, that tranforms these ILDA points in points that will be displayed on the laser, and passes it through a 0MQ socket to the process handling the laser queue.

IRL : Settings !

In our last article we described some ways to enhance the display of a text scrolling smoothly.
We actually tried several possibilities of settings for the scrolling text and finally found a convenient one (as shown on the video above).

We did some major improvements concerning the speed of the code on the card succeeding in speeding it by a factor of 5. We deemed that a major issue of that program lays on the access time of the memory. Indeed it takes more than 20 seconds to write an ILDA file of a tweet from the ram to the flash. Samuel suggested that we could use a socket to directly send the ILDA file from the python script to the C program in charge of the FPGA communication. In fact, with such a strategy we would avoid the slow speed flash access and be able to send a tweet to the laser around 30 seconds after its validation.

In addition we’re going to add some bit stuffing to make the frames equally populated in terms of points so as to assure a constant frame rate. You can easily notice that disturbing effect on the video above.

In parallel, we’re getting familiar with the DMX protocol and are working on the DMX board.
We haven’t forgotten the software fifo between the C program and the FPGA. We deemed that a zeromq socket would be a interesting solution and we are currently working on it.

IRL : firsts tests with the real laser

Real laser

Today we replaced the oscilloscope by the real laser. As expected, it does not exactly work the same way, but our first test with « The Riddle » is not so bad. You can see it on the video below, it is little as we do not have a lot of space in the classroom. You can see that the image is blinking, this is partly due to our code, but also partly due to the camera sync, and the « real » result is cleaner than what can be seen here.

FPGA design

The new design suggested by our teachers has been implemented, except for the FIFO which for the moment does not use the internal RAMs This will normally be done tomorrow. The FIFO, as it is now sometimes, leads to some bugs that we do not really understand yet. We will also investigate those issues tomorrow. Nevertheless, we have a functional design, the one we used tonight to make the video.

Tweet to ILDA

Concerning the way we will display tweets, Sam suggested us to make a smooth horizontal scrolling. Our first idea was to generate a big ILDA image containing the whole tweet on one line, and to clip it at display time, just before sending it to the laser. It seems that is was not the best way to act. So, we are now trying to generate an ILDA animation corresponding to the scrolling with a Python script. We are on our way and we have yet disclosed a few points of intersert to change in our design to make it work soon.

Web interface

The library we mentionned last time (libmicrohttpd) seems to fit quite well with our needs. It is not a complete Web server, but it is enough to make the card serve a static HTML page and a little REST API to get tweets and validate them. The authentication is for the moment very basic it consists in a « secret » token as segment of the URI. It is not very secure, but it is not our priority at the very moment.

IRL is back


Yesterday we were working on the switching on/off of the laser spot and on the module wich will ensure security. The features are written but not yet working well. We need modelsim to debug but it is only installed on the school’s computers which are, as you know, not available this week-end. So we decided to give up and focus on the Web part until Monday.



We can now fetch the last few tweets containing a given hashtag on twitter and put them into a database. Another program queries the database to get the newest message and then displays it letter by letter on the oscilloscope. Everything is written in C and working on the Armadeus board.
For twitter, we don’t use any library apart from libcurl, to query the twitter’s API, and jansson to parse the incoming JSON object returned by twitter.

Here a small video, you can see the latest (at this time) tweet on #rose2011, displayed leter by letter on the oscilloscope.
You can read « 75% students attendance during the vacation #rose2011″.


We can pack the result from a query to the database into a JSON object. Inserting values given by a JSON object into the database won’t be difficult.
Next step is to communicate with a client. As we don’t seem to be able to make Mongrell2 work on the Armadeus, we looked for an alternative. Yesterday we have quickly tried a library called libmicrohttpd to handle HTTP queries. We have only tested a simple GET command, but at least it works on the Armadeus, and it is written in pure C. Contrary to CGI, this library is able to manage multiple connections in only one process using Posix threads.


IRL : dure journée …

Nous avons eu beaucoup de doutes ces derniers temps concernant les choix à faire pour avancer. Voici ce que nous avons fait durant les deux derniers jours.

Serveur web

Comme pouvait le laisser penser notre dernier post, nous avons exploré les possibilités offertes par mongrel2.
Il s’agit d’une application qui multiplexe des requêtes http et les recopie sur des sockets 0mq (pour plus de détail : http://mongrel2.org/home).
Nous avons testé mongrel sur nos machines avec succès et il nous semble tout à fait adapté pour résoudre nos problèmes.
Nous avons essayé de le crosscompiler mais sommes confontés pour l’heure à des problèmes.
À terme, nous voulons l’intégrer dans notre buildroot.


Nous avons l’ensemble des caractères ISO8859-15 sous la forme de fichiers ILDA. Et nous avons trouvé une nouvelle police qui donne des meilleurs résultats. Nous avons fait un script qui nous donne le numéro du caractère ISO8859-15 entré sur stdin.


Nous nous sommes familiarisés avec Twitter et nous réussissons à récupérer les tweets portant le htag #rose2011 directement sur la carte.


Nous avons synthétisé et testé sur le FPGA un code utilisant une des rams internes du FPGA et permettant d’y écrire et lire depuis le processeur. Nous sommes en train de parler à la ram SPI qui nous reste (en effet, nous avons mal routé une des deux rams SPI dont nous allons peut-être devoir nous passer).


Nous avons clarifié nos idées concernant la manière dont l’authentification sera mise en oeuvre sur la carte. Nous nous repencherons sur la question quand mongrel2 marchera.

IRL : Avancées de la journée

Aujourd’hui nous avons eu l’occasion de rencontrer un étudiant qui a travaillé il y a deux ans sur le projet Laser.
Nous lui avons expliqué l’architecture de notre projet et avons récupéré une partie des sources de son projet.

Nous avons mené des essais avec les cartes de TP concernant la transmission par zigbee des masques pour le flux DMX. Ces essais ont été concluants : nous arrivons à transmettre et recevoir sans erreurs différents masques DMX et à les stocker en RAM.

Nous cherchons une police adaptée au laser et sous forme de fichiers au format ILDA pour pouvoir afficher du texte sur l’écran. Nous avons constaté que l’équipe de l’année dernière a réalisé des caractères au format ILDA qui ont un bon rendu avec notre afficheur ILDA.

Nous avons par ailleurs décidé en suivant les conseils d’Alexis d’utiliser une RAM externe pour notre FPGA (ram SPI 256Kbits code radiospare : 666-8148).

Nous sommes en train de réaliser les PCB, de faire des simulation en Verilog et de réfléchir au format de stockage des informations à afficher par le laser dans le FPGA. Nous attendons l’Armadeus dont nous disposerons peut-être demain.