FHEM Forum

FHEM => English Corner => Thema gestartet von: phervier am 06 Mai 2015, 13:02:56

Titel: New I2C chips support
Beitrag von: phervier am 06 Mai 2015, 13:02:56
Hello

I just finished to add support for some I2C devices to fhem  for my own needs.
There are :
- TMP006  infrared temperature sensor
- HTU21D temp/humidity sensor
- MCP9808 high precision temperature sensor

To make them work i had to modify the 00_RPII2C.pm module to add read and write word capability for both SMBus and IOCTL.

What is the procedure to contribute ?
Titel: Antw:New I2C chips support
Beitrag von: rudolfkoenig am 06 Mai 2015, 13:27:32
Post a patch in the correct area of this forum, in this case it is Einplatinencomputer (http://forum.fhem.de/index.php/board,32.0.html), as it is documented in the MAINTAINER.txt file.
Titel: Antw:New I2C chips support
Beitrag von: phervier am 06 Mai 2015, 15:19:24
As I hardly understand german the use of this forum is quite difficult for me.

So there is a MAINAINER.txt file, where could i get it ?
Titel: Antw:New I2C chips support
Beitrag von: rudolfkoenig am 06 Mai 2015, 15:27:46
This file is on the top level, if you check out the FHEM source code.
It is also available here (http://fhem.de/MAINTAINER.txt), which is linked at the bottom of the fhem.de page.
Titel: Antw:New I2C chips support
Beitrag von: Fritz!Maxi am 19 Mai 2015, 09:49:08
Zitat von: phervier am 06 Mai 2015, 13:02:56
...
I just finished to add support for some I2C devices to fhem  for my own needs.
There are :
- TMP006  infrared temperature sensor
- HTU21D temp/humidity sensor
- MCP9808 high precision temperature sensor

To make them work i had to modify the 00_RPII2C.pm module to add read and write word capability for both SMBus and IOCTL.
...

Until now I struggled to get the MCP9808 working in FHEM. Would it be possible for you to share your modules with me / us so that I can test them?
Titel: Antw:New I2C chips support
Beitrag von: phervier am 24 Mai 2015, 12:51:02
No problem, here is the file I used for a while without any problem on a raspberry pi.

The only trick is that I made this development with a previous version of the 00_RPII2C.pm. to use my sensors I modified this module and added support of word read/write .

In the last version of 00_RPII2C.pm you can use blockread and blockwrite, and it is more portable than word who suffer of little indian/big indian issue.

I should port my file to the new version of 00_RPII2C.pm but as it work perfectly now i am quite lazy to do it.
Titel: Antw:New I2C chips support
Beitrag von: Fritz!Maxi am 05 Juni 2015, 21:27:49
Thanks for sharing this with us! When I installed it I realized that I had to rename the module to 52_I2C_MCP9808.pm. It's defined now, but not initialized. Don't now why yet...