Web app. & Ergo jr

(english version below)

Bonjour à tous.

Je travaille sur un d’atelier éducatif qui a pour but le développement d’une application web permettant de piloter un Ergo Jr.

J’ai développé une première application (en Python) pour tester la faisabilité du projet. Elle permet de commander individuellement chacun des six moteurs de l’Ergo Jr. Elle servira de base pour développer les autres applications.

Comme je ne possède pas d’Ergo Jr, je l’ai testée avec un simulateur, et elle fonctionne correctement. J’ai eu l’occasion de la tester avec un Ergo Jr réel, mais là, l’application s’interrompt au bout d’un délai plus ou moins long. En tuant les processus python qui tournaient par ailleurs, l’application fonctionne correctement. Il y a apparemment conflit entre mon application, et les applications python qui sont lancées d’office.

Si vous voulez l’essayer, il suffit de lancer les commandes suivantes dans un terminal sur le Raspberry Pi (comme indiqué, vous devrez probablement au préalable tuer les autres processus python) :

git clone http://github.com/epeios-q37/atlas-python
cd atlas-python
python ErgoJr

puis d’ouvrir le lien affiché dans un navigateur web.

Vous pouvez ouvrir ce lien depuis n’importe quel appareil (votre smartphone, par exemple) sans avoir à le reconfigurer pour qu’il soit connecté au même réseau local que l’Ergo Jr. Et pas besoin de configurer votre routeur/box pour ouvrir un port vers l’Ergo Jr. Il n’est pas nécessaire qu’il soit accessible depuis internet. Il suffit qu’il ai accès à internet.

Il y a juste cette nécessité de devoir tuer tous les processus python qui se lance au démarrage pour que l’application fonctionne correctement ; si quelqu’un a une idée pour éviter cela…


Hello, everyone.

I am working on an educational workshop that aims to develop a web application to pilot an Ergo Jr.

I developed a first application (in Python) to test the feasibility of the project. It allows to operate each of the Ergo Jr’s six engines individually and will serve as a basis for the development of other applications.

As I don’t own an Ergo Jr, I tested it with a simulator, and it works fine. I had the opportunity to test it with a real Ergo Jr, but then the application stops after a more or less long delay. By killing the other python processes that were running, the application works correctly. There seems to be a conflict between my application, and python applications that are automatically launched.

If you want to try it, just launch the following commands in a terminal on the Raspberry Pi (as stated, you probably have to kill other python processes before):

git clone http://github.com/epeios-q37/atlas-python
cd atlas-python
python ErgoJr

then open the displayed link in a web browser.

You can open this link from any device (your smartphone, for example) without having to reconfigure it to be connected to the same local network as the Ergo Jr. And no need to configure your router/box to open a port to the Ergo Jr. It is not necessary for it to be accessible from the internet. All it needs is access to internet.

There is just this need to have to kill all the python processes that are automatically launched at boot for the application to work properly; if someone has an idea to avoid this…

Bonjour @Epeios

j’étais passé à coté de ce post …

c’est déjà ce que fait poppy monitor (GitHub - poppy-project/poppy-monitor: Web tool to monitor and pilot poppy project robot.) qui est également accessible via un smartphone. Y as-tu jeté un œil ?

je te conseil d’utiliser le module Flask pour python qui est utilisé nativement pour l’ErgoJr :
tu peux ajouter tes pages html (incluant éventuellement du code JavaScript) ici : http://poppy.local:8888/tree/poppy_src/puppet-master/templates et faire l’appel de ces pages ici : http://poppy.local:8888/edit/poppy_src/puppet-master/bouteillederouge.py
Sinon, effectivement tu risque d’avoir des problèmes de compatibilité (notamment à cause des processus python que tu dois killer pour lancer ta propre webapp)

malgré cela, merci de ta contribution !

Bonjour, @tibo

Les fonctionnalités de l’appli que je présente ne sont pas une fin en soi. C’est juste un exemple dont peuvent s’inspirer ceux qui veulent développer leur propre application pour contrôler un Ergo Jr.

Cette application s’inscrit dans un projet plus large (http://atlastk.org/) visant à offrir un moyen simple (du moins, je l’espère) de créer une application avec une interface web, et ce, quelques soi (à terme) le langage.

Je viens justement d’écrire un article, en français, dans lequel je cite l’Ergo Jr d’ailleurs, qui détaille certaines particularités de ce projet : https://linuxfr.org/news/les-jeunes-et-la-programmation-atlas-toolkit-v0-7.

1 Like