Controlling Arduino from OpenERP
Recently, I started learning OpenERP: what better occasion to develop a module to control an Arduino UNO Board?
I’ve already blogged about PyFirmata (see: http://www.itopen.it/?s=pyfirmata), which is a python library to control an Arduino board flashed with Firmata firmware, this nice library integrates perfectly with OpenERP and let you read/write analog and digital values from an USB-connected board.
PWM and SERVO control are also supported natively by PyFirmata and hence by the module I’ve developed, the only thing I’ve not yet implemented is digitalWrite on the analog pins even if this would be pretty easy to do with proper checks in the code.
The module only depends on pyfirmata (and pyserial) and it’s not yet final (but if you feel brave you can download a development snapshot here: arduinocontroller-2012-05-31-00:05:52).
Github repo
You can find the latest development version on my github repository
This short (and quite laggy) screencast shows the module running:





2012-05-29 at 7.00 pm
Hello Alessandro,
Looks like a nice implementation. Thanks for sharing this.
I’ve started installing your module but don’t see how to import the PyFrimata into OpenERP.
Have you also managed to get the Arduino to control OpenERP. for example, to read serial data from the Arduino RS232 pins and use this data to open a view and update specific fields in an Open ERP database?
I’ve trying to test external devices connected to the Arduino (e.g. barcode scanner, weighing machine) and need to specify which module and database field to update.
Any further info would be appreciated.
Colin
2012-05-30 at 8.08 am
@Colin,
Hi, thanks for the feedback! If pyfirmata is not installed a nice pop-up will tell you how to install, the message is:
Pyfirmata is not installed, arduino operations are disabled. You can install pyfirmata from hg clone ssh://hg@bitbucket.org/tino/pyfirmata
The module successfully reads analog and digital data from Arduino pins, so it’s possible to use this values to update fields on other models but this should be coded on a case by case basis.
2012-09-04 at 5.42 pm
Hello Alessandro,
Thank you for sharing the results of your project. It looks really interesting. I’ve also used Arduino Uno / firmdata for other serial interface projects and (like the other Colin) I am now also exploring using the Arduino as a possible ‘external device’ interface to OpenERP (e.g for use with weighing scales, barcode scanner, Reading Production machine status, etc). Do you have any detailed technical design documentation of the OpenERP/Arduino interface and any details of the Arduino sketch?
Any further info would be appreciated.
Regards
CB
2012-09-04 at 5.57 pm
Hello Colin,
The arduino sketch is just plain standard firmata firmware shipped with the Arduino IDE.
You can find the complete code of this OE addon on my gihub repo: https://github.com/elpaso/arduinocontroller
Regards.