1

Home-made name badge pcb with scrolling messages on led display

06 Feb 2012 at 13:32

admin

Arduino, Geekiness, Hardware, MSP430

1 Comment

For people at FOSDEM 2012 (great event by the way!), you’ve surely seen my name badge around. For others, here is a picture :

spacer

As promised to some people there, here are all the details :

I used an MSP430F5171 16-bit ultra low power microcontroller (mcu), and my own arduino port for that platform (that supports nearly all the msp430G, MSP430F2xxxx and msp430F5xxx by the way, with all their ports, and pwm on all the ports if needed).

However, to save some room on the board and to limit the bill of materials, I haven’t used any resistors, playing on the multiplexing effect and praying that the mcu would handle that current (very bad practice for production designs, but for an experimental name badge… spacer ).

Enough chatting, here is the schematic :

spacer

And pictures of the badge being built :

If you wonder how I made the pcb, I used the toner transfer method (cheap store catalog paper and laminator), with traces as small as 6 mil, so it works perfectly once you’ve tried all the methods on the web and found the one that is ok for you. I hand soldered all the components using a regular iron.

And, finally, of course,a video of it scrolling :

As you may see, there is a final row on the right that doesn’t light up, that’s because I tried to put high intensity blue smd leds, that took too much current from the mcu pin, another reason why it’s a bad practice to do what I did without resistors there was just a badly soldered via, now fixed spacer

If I had to to do it again, I’d probably use real led drivers, but trying to find some that are low power (it’s a name badge after all and it runs on battery) and maybe use a bigger resolution, as reading it with a 5×3 font was a bit hard.

If people are interested, I can publish the code here if needed, and I’ll of course post a full version of my arduino lib for msp430 as open source soon don’t worry spacer

Have any question ? Use the comments spacer

4

Electroménager sur internet : galère assurée (Mondial Relay & Discounteo)

22 Oct 2011 at 13:26

admin

3615 my life

1 Comment

Edit du 24/10: titre changé, voir la fin du post pour la mise à jour.

Revenons il y a un mois. je me dis que je peux refaire ma cuisine : Je me prépare donc à acheter mon électroménager (four, plaques, lave vaisselle…).

Or, j’avais entendu parler d’un site appelé Discounteo, que j’avais déjà utilisé pour faire un achat.

Hop, commande passée pour le tout sur ce site début Octobre (“pourquoi passer par plusieurs vendeurs, la livraison sera plus simple si je fais tout sur le même site”). Grand mal m’en a pris.

Je m’explique, pour une partie de la commande (assez lourde), je dois aller en point relais mondial relay. Ce que j’ai fait : c’était lourd à porter mais soit.

Pour l’autre, moyennant finance (80 euros tout de même), ils me le livrent chez moi; Premier rendez-vous fixé pour la livraison 2 semaines après la commande (un peu tard, mais bon, ça peut arriver). Les livreurs arrivent et ne me livrent que de la moitié, l’autre étant pas complète dans l’entrepôt.

J’appelle le service Mondial Relay (le transporteur) pour comprendre, et on m’explique que le reste de ma commande est perdue dans des entrepôts : ils ne savent pas où et vont mener une enquête mais pas avant le lendemain. Le lendemain arrive, je rappelle (une nouvelle fois 40 minutes d’attente pour avoir quelqu’un), et ils ont retrouvé un colis sur deux mais refusent de livrer partiellement.

Quelques jours plus tard, le 18 Octobre (ils arrivent enfin à retrouver les colis), ils acceptent de fixer un rendez-vous le Jeudi 20 Octobre (le Mercredi étant “complet), je prend donc ma journée de congés pour recevoir le transporteur. Le transporteur ne passera pas. La raison ? Ils auraient “oubliés” mes colis au dépôt… Avec les excuses de Mondial Relay, nouveau rdv pris pour le samedi 22 Octobre entre 8h et 13h, cette fois ci “promis juré vous aurez vos colis”…. Ah.

Et Aujourd’hui, 14h30, ais-je reçu mes colis ? Non. Transporteur aux abonnés absents, et numéro de téléphone injoignable…

Petit check avec Discounteo sur leur site et remboursement impossible. En attenant j’ai une arrivée d’eau ouverte et ne peux pas ouvrir les robinets. Merci Discounteo spacer

Hop, donc pour résumer, si vous voyez Mondial Relay sur un site pour la livraison, fuyez. Et si les prix de Discounteo vous attirent, fuyez aussi.

Je vous tiens au courant sur la façon dont les choses évoluent. Si vous avez une idée sur les démarches que je peux entreprendre, je suis tout ouïe.

ps: il semblerait que je ne sois pas le seul, et @dansuncoin sur twitter a eu des déboires du meme genre avec Mondial Relay.

Addendum du 24/10:

J’ai reçu ma commande plus tard dans l’après midi de Samedi, après les horaires de livraison. Manque de chance, l’article restant a reçu un coup pendant le transport invalidant ainsi je pense (j’espère que non, mais bon) la garantie ainsi que l’extension de garantie que j’ai payé.

Pour faire une réclamation il faut que j’envoie une lettre recommandée confirmant mes réserves émises au transporteur car elles ont été barrées (cool le transporteur d’ailleurs…). J’abandonne, j’aurai un appareil à plus de 300 euros ayant un coup, mais plus de commande en ligne sur ce site ni par ce transporteur à l’avenir pour moi.

Je clos cet épisode ici, et désolé pour cet interlude personnel spacer Je reviens avec des actualités plus intéressantes bientôt, promis !

ps: j’ai été contacté par des personnes de Discounteo sur twitter suite à ce post et je les remercie de leur réactivité.

Addendum du 25/10:

J’ai été recontacté par Discounteo qui a voulu que j’envoie le bon de livraison avec mes réserves par email, ce que j’ai fait.

Après m’avoir proposé un geste commercial si le transporteur l’acceptait, ils m’ont recontacté en me disant que ce n’était pas possible, mais que ma garantie s’appliquerait même avec un produit ayant reçu un coup, et que si je voulais ils pouvaient renvoyer le transporteur chercher le produit pour m’en livrer un autre par la suite. N’étant pas masochiste, j’ai refusé : fin de l’histoire, et tous les acteurs ont campé sur leurs positions sans aucune évolution.

Je confirme mon avis, évitez ces deux acteurs du e-commerce pour vos achats en ligne.

6

Data-flow made easy: PyF 2.0

17 Dec 2010 at 16:01

admin

Development, Python

1 Comment

As you may know, I work a lot on a python flow-programming framework named PyF.

We just released its 2.0 version, and I thought it may be a good occasion to present it here (I used Mathieu’s article as a basis for this presentation):

PyF is a Python framework for writing highly scalable data processing, data mining applications, and more. PyF is Free software, distributed under the terms of the MIT license.

spacer

To achieve the scalability, PyF is based on flow programming: instead of processing « a certain quantity of data », we process a « flow » of data, so that at any point, we only ever have one object in memory, no matter how much data we will process in total. That’s right, mining your huge customer database and generating reports with PyF will not take your servers down to their knees.

To achieve this, we use Python generators (no need for python extensions like stackless):

Each unit of the whole processing chain takes a generator as input and yields values as soon as they were processed. We could even handle a never ending flow of input data and keep processing them, yielding each one after the other!

Now, down to the details, PyF is composed of several layers:

  • At the low level, you have only the basic subset of core functions that will help you write flow-based applications.
  • At the mid level, you can run your processes in your application, using a wide range of plugins (or writing your own)
  • At the highest level though, you will find a full-blown web application that allows you to graphically design your processing chain (we call it a tube) by dragging and dropping processing units (we call them components) and chaining them, output to input. We have several default generic components that can be used to do all sorts of processing and reporting already, and it is pretty easy to write your own if necessary (we will gladly help in any case). We even have a built-in scheduler so you can specify when to automatically launch your processes!

We wrote a simple tutorial to get PyF, and a series of tutorials to actually make your first steps.

We already have some documentation which should be more than enough to get you started, although we are working on making it more comprehensive.

About the new things in 2.0, one of the most exciting is the addition of multiprocessing: you can move any node in your tube to a separate process with a simple checkbox.

If you have any question, come hang out on our mailing-list or our IRC channel:

  • groups.google.com/group/pyf-users
  • #pyf on Freenode

Oh, and of course, visit our website: pyfproject.org/

5

Les régions de France selon l’auto-completion Google Suggest

10 Dec 2010 at 15:49

admin

Infographies

2 Comments

Comment est-ce que Google voit les régions de France, ou plutôt, qu’est-ce que nos recherches renvoient sur nos régions ?

A l’image de ce qui a été fait avec les carte des états unis selon google autocomplete, j’ai préparé cette petite infographie sous la forme d’une carte de France où les régions sont nommées selon les premières suggestions de recherche de google lorsque l’on tappe leur nom.


Cliquez sur l’image pour la voir en taille réelle.

Pour info, lorsque le premier résultat est une adresse de site web (de la région par exemple), ce résultat n’est pas pris en compte et on passe au suivant. Lorsqu’un autre résultat pertinent lui aussi est juste après un résultat commun, il est également mis en “alias” sous le nom de la région (en italique).

Résultats d’autocompletion obtenus grâce à Google.

13

Programmation python en flux: PyF

22 Sep 2010 at 15:15

admin

Développement, Python

1 Comment

PyF est un framework très complet de programmation en flux en Python, avec un éditeur graphique, un système de plugin, un webservice, un scheduler, etc.

J’ai fait une présentation à PyCon FR à ce sujet il ya de cela quelques semaines et les vidéos ont été mises en lignes.

Plutot que de rentrer dans les détails dans cet article, je vous invite à regarder cette présentation :

Pour plus d’infos, rendez-vous sur pyfproject.org spacer

9

Create PDF in Python using Genshi and RML with pyjon.reports

15 Jun 2010 at 20:35

admin

Development, Python

2 Comments

Warning, this article is technical… If you don’t care about python development, skip it spacer

You want to create pdf reports, send letters or any other action needing pdf documents ?

If you are a python expert, you’ll have surely heard about ReportLab. Yeah, I know, to use it, you need to code it, and when you change your template you have to do everything again.

A solution to that, is to use RML, an xml language done by the company that created reportlab. RML permits to use stylesheets, and to have an xml document that generates the pdf (just like html).

There is a problem with RML. The reference handler, (Reportlab RML) isn’t free (neither as in beer nor as in speech)… But the fabulous guys at Z3C did an open source handler for RML, z3c.rml !

Just one problem : when you create big documents, the process will crawl, take all your ram and die badly. The solution to that aspect ? using PyPDF to join pdf files into one (one template per document part).

Now, here comes the real deal : we will template that xml, just like we would do for html, using an xml templating language : genshi.

To ease that task, I’ve made a little python lib that handles the templating, the merging of various documents into one and much more.

For the most impatient, head directly to the examples ! spacer

How to use it ?

Example case : a data table

First, let’s initialize a factory (a class that allows to create various documents and join them in one pdf):

from pyjon.reports import ReportFactory
factory = ReportFactory()

Now let’s create a test.xml file containing our template:

<?xml version="1.0" encoding="iso-8859-1" standalone="no" ?>
<!DOCTYPE document SYSTEM "rml_1_0.dtd">
<document xmlns:py="genshi.edgewall.org/">
<template pageSize="(595, 842)" leftMargin="72" showBoundary="0">
  <pageTemplate id="main">
    <frame id="first" x1="1in" y1="1in"  />
  </pageTemplate>
</template>
<stylesheet>
  <blockTableStyle id="mynicetable" spaceBefore="12">
    <lineStyle kind="OUTLINE" colorName="black" thickness="0.5"/>
    <blockFont name="Times-Bold" size="6" leading="7" start="0,0" stop="-1,0"/>
    <blockBottomPadding length="1"/>
    <blockBackground colorName="0xD0D0D0" start="0,0" stop="-1,0"/>
    <lineStyle kind="LINEBELOW" colorName="black" start="0,0" stop="-1,0" thickness="0.5"/>
    <!--body section-->
    <blockFont name="Times-Roman" size="6" leading="7" start="0,1" stop="-1,-1"/>
    <blockTopPadding length="1" start="0,1" stop="-1,-1"/>
    <blockBackground colorsByRow="0xD0FFD0;None" start="0,1" stop="-1,-1"/>
    <blockAlignment value="right" start="1,1" stop="-1,-1"/>

    <!-- closing the table when restarting it on next page -->
    <lineStyle kind="LINEBELOW" colorName="black" start="0,splitlast" stop="-1,splitlast" thickness="0.5"/>
  </blockTableStyle>
</stylesheet>
<story>
  <h1>$title</h1>
  <blockTable repeatRows="1" style="mynicetable">
    <tr><td py:for="i in range(10)">Row ${i}</td></tr>
    <tr py:for="line in data"><td py:for="col in line" py:content="col" /></tr>
  </blockTable>
  <para py:content="dummy" />
</story>
</document>

Let’s have a look at this template:

  • The template node permits to choose the document size
  • The stylesheet node permits to define the styling of the document
  • The story nodes contains the document content (just like body in html)
  • Like in html, h1 defines a level 1 title (we print the title var inside)
  • A para is like an html p (a paragraph)
  • The blockTable is the table tag containing rows and columns (td and tr). The py:for attributes define the iterations over list vars
  • The first one (py:for=”i in range(10)”) defines the columns (Row 0 to Row 9)
  • The second (py:for=”line in data”) shows the whole content of the data var (item per item)
  • The last one (py:for=”col in line”) shows the content of each line (with a py:content printing it inside the tag)

Now let’s generate a document with this template:

template = 'test.xml'
testdata = [range(10)] * 100

factory.render_template(
        template_file=template,
        title=u'THE TITLE',
        data=testdata,
        dummy='foo')

We passed various variables and a data list (testdata) containing the numbers 0 to 9, 100 times: [[0, ..., 9], …, [0, ..., 9]].
Please note that all keyword arguments passed to the function (beside template_file or template_string) are passed to the genshi template, and accessible as root variables there.

Needing to add another secion in the document with the same template ? No problem !

factory.render_template(
        template_file=template,
        title=u'THE TITLE 2!',
        data=testdata,
        dummy='bar'
        )

Eventually, we will create a single pdf files, with all the content, finalising the factory (cleaning it):

factory.render_document('test.pdf')
factory.cleanup()

And voilà! It’s as simple as that.

How to install it ?

To install pyjon.reports it’s very simple: just type easy_install pyjon.reports in your console (in a virtual env or globally), and you’ll be able to generate pdf documents in your applications in less than 5 minutes.

If you want to see the source code or contribute, see the bitbucket page: bitbucket.org/jon1012/pyjonreports

For more info:

  • Download page
  • Genshi documentation
  • RML format documentation (pdf)
  • z3c.rml specific format documentation (pdf)
9

New blog…

14 Jun 2010 at 19:09

admin

Unclassified

6 Comments

Hi dear readers.

What you did know as JonDesign disappeared. But fear not, as instead comes my personnal blog, hopefully updated much more often!

I’ll blog about tech, development (python, css, javascript), design or otherwise interesting news and tutorials.

SmoothGallery continues to live at smoothgallery.jondesign.net/.

For all contact about professionnal activities, please use my company website (JMSI).

See you soon here !