SRA Lab Open Source Code

27Apr/110

Not compliant device can be time consuming!

Travis Atkinson of Com-Pac Filtration and me have worked together to find out why the HMI of Weintek Labs I-Series, with Ethernet, answered only to request sent by the modpoll program (proprietary software).

After many emails and the help of Wireshark, we have discovered modpoll uses the unit identifier as slave ID for TCP requests, according to the Modbus specs that's incorrect (cf page 23 of Modbus Messaging Implementation Guide v1.0b) but else the device drops the request! Two problems can sometimes lead to proper operation or Weintek company has designed this product on modpoll requests :-/

PS: The workaround was to set the slave ID with modbus_set_slave()

18Apr/110

La DjangoCong 2011 est terminée

Grâce à Makina Corpus, j'ai pu assister à nouveau à la DjangoCong. C'est une occasion idéale pour retrouver l'équipe des Djangonautes de Makina au grand complet ;)

La nouvelle organisation du WE mettait l'accent sur la participation avec des mini-confs très courtes le matin (12 mn) et des ateliers à la barcamp, et encore une fois les organisateurs ont été irréprochables, bravo ! C'est un plaisir de retrouver des têtes connues et de rencontrer de nouveaux venus pleins de bonnes idées. Les entreprises étaient plus impliquées cette année (merci les sponsors) et l'écosystème autour de Django semble en bonne voie avec des produits tels Django SHOP et Django CMS,

Nous quittons Marseille avec quelques outils à utiliser au plus vite et de bonnes idées:

DjangoCong est la conférence Django francophone à suivre !

Quelques photos http://www.flickr.com/photos/vineolia/sets/72157626398900439/

14Apr/110

libmodbus for Arduino (almost!)

The libmodbus project is a real success on many platforms and to conquer the world, I've written a version dedicated to Arduino devices. My goals are:

  • to talk with a standard Arduino UNO or Duemilanove via the integrated USB
    serial line (8N1)
  • to have the lowest footprint (binary sketch size and SRAM)
  • to be robust

OK, you're right, other projects exist already:

  • Master/slave by jpmzometa and others is great but the reading in loop doesn't handle serial latency and the code contains too many arrays IMHO
  • ModbusMaster is a master and I want a slave.
  • Arduino-Modbus, the code is, eh, ugly!
  • modbusmq by Mario Di Bacco is based on libmodbus but it aims Modbus TCP.

So I've extracted/adapted only the slave, RTU, reading/writing registers of libmodbus. To reduce the footprint even further, I've replaced the fast CRC code based on precomputed arrays (512 bytes) by a slow one (not so slow!). The result is clean library for Arduino able to handle exceptions if an error occurs.

The binary sketch size is 2,450 bytes and around 1,830 bytes of memory still free when running on 2K SRAM model.

The source code is available on github and have the project is referenced in the arduino.cc playground wiki.

6Apr/110

New IRC channel

I've just registered #libmodbus channel on Freenode, so let's talk!