Page 3 of 7
Re: PiFace support added
Posted: Thursday 14 November 2013 10:22
by antwan
piotr wrote:Two questions regarding the piface:
- Can i still use my BMP085 sensor with the piface installed ?
Thanks !
That's not that easy. You have to solder the wires of the bmp085 to the piface interface.
Re: PiFace support added
Posted: Thursday 14 November 2013 10:46
by bistoury
Ni RobinS,
Teleinfo is a interface, by which your can receive several informations regarding your eletricity subscribtion.
You can have the instataneous power usage, the overall consumtion your allowed to depending of your substitution 6/9/12/15/18/36 KVA),
The actual tarif (full rate = heure pleine = HP, derated = heure creuse = HC), and much more.
So in that sense, it is not a basic impuls as would be a gas or water counter (i already use piface for that usage)
When i said it has no voltage in the wires (so potential free), i did not mean it was simple than that
To what i have understood, we need a decoder (i.e. a modem) to read the datastream. The question is : can a piface with the calculation power of a Pi be used to decode the datastream.
I also understood that the teleinfo can be read by the modem thru a standard serial interface. As the pi and piface use already that kind of interface = SPI), maybe it is possible to avoid to plug another USB device.
That's all i can help with. That said, if you need me to translate some (small) stuff or you need some detailed explanations on a french-written doc, I can give a hand.
Regards,
Bistoury.
Re: PiFace support added
Posted: Thursday 14 November 2013 19:43
by RobinS
piotr wrote:
- Can i still use my BMP085 sensor with the piface installed ?
Yes, you can use the BMP085 sensor with the Piface, as the BMP085 uses the I2C interface, and the PiFace uses the SPI interface, and the first slave select line, which leaves a secondary slave select line for other SPI chips (note that multiple PiFaces will use the same slave select line)
piotr wrote:
- Can i measure waterusage with the piface + optical sensor ?
Sure you can, using the piface.conf file you can configure any piface input to be used as a pulse counter.
The Piface inputs are configured with pullup resistors enabled, so depending on the output of your optical sensor you might be able to hook it up to the Piface input directly.
Please note that the Piface has 3v3 IO lines.
One other factor to consider is the maximum pulse frequency of the optical sensor, as the usefull maximum frequency of the PiFace is about 5 Hz, although high frequencies are possible however the accuracy declines as the frequency rises.
Re: PiFace support added
Posted: Thursday 14 November 2013 19:49
by RobinS
antwan wrote:piotr wrote:Two questions regarding the piface:
- Can i still use my BMP085 sensor with the piface installed ?
Thanks !
That's not that easy. You have to solder the wires of the bmp085 to the piface interface.
Actually that greatly depends on the BMP085 solution, as there are numerous boards available the allow for easy installation.
As the BMP085 is compatible with 3v3 levels it can directly be connected to the I2C interface of the Pi.
With some handy work its very possible to solder an additional header onto the PiFace, with allows stack through, and create an BMP085 addon board (using veroboard).
(Please check one of my earlier PiFace posts, either in this topic or the development question Piface topic, for a picture of the stack through setup).
Re: PiFace support added
Posted: Thursday 14 November 2013 20:11
by RobinS
bistoury wrote:Ni RobinS,
Teleinfo is a interface, by which your can receive several informations regarding your eletricity subscribtion.
You can have the instataneous power usage, the overall consumtion your allowed to depending of your substitution 6/9/12/15/18/36 KVA),
The actual tarif (full rate = heure pleine = HP, derated = heure creuse = HC), and much more.
So in that sense, it is not a basic impuls as would be a gas or water counter (i already use piface for that usage)
When i said it has no voltage in the wires (so potential free), i did not mean it was simple than that
To what i have understood, we need a decoder (i.e. a modem) to read the datastream. The question is : can a piface with the calculation power of a Pi be used to decode the datastream.
I also understood that the teleinfo can be read by the modem thru a standard serial interface. As the pi and piface use already that kind of interface = SPI), maybe it is possible to avoid to plug another USB device.
That's all i can help with. That said, if you need me to translate some (small) stuff or you need some detailed explanations on a french-written doc, I can give a hand.
Regards,
Bistoury.
Hi Bistoury,
Hmm, then the teleinfo interface is much more intelligent than I expected....
As you mention the use their contact to 'modulate' a digital datastream that can be read.
I do not think that the Piface is the way togo to read / decode this datastream, as its not possible to have serious sample rate to detect / decode the databits, as its dependant on the timeslices Linux assigns the sampling process, and it can fluctuate significantly ((best)50 - (worst)300 msec ).
As the teleinfo uses a contact to 'modulate' the data, It might be possible to connect it to a uart using a pull up (or down) to read the data (provided that they use normal async framing), and the Piface has an TTL serialport on its 26 pin header...
Although if they use a different encoding like manchester, then you will need special hardware like a microcontroller or special chip to preprocess your info.
Best Regards,
Robin
PiFace support added
Posted: Thursday 14 November 2013 22:09
by bistoury
I am afraid I can't give your more input. Hope some one reed our discussion

Re: PiFace support added
Posted: Friday 15 November 2013 9:53
by Alex
Hello Guys,
I saw your questions RobinS, so i'll try to bring a few elements in this discussion

The french "teleinfo" system is available on electricity meters using 2 wires. This is not a pulse/unit system. Actually, it's a serial line, that's why a lot of french people plug their raspberryPi _directly_ on their electricity meters, with juste 2/3 electronic components to clean the signal !
The electricty meter keep sending information on that serial line. Each information is sent as a key/value couple.
This is a example of the output :
Code: Select all
ADCO 524563565245 /
OPTARIF HC.. <
ISOUSC 20 8
HCHC 001065963 _
HCHP 001521211 '
PTEC HC.. S
IINST 001 I
IMAX 008 2
PMAX 06030 3
PAPP 01250 +
HHPHC E 0
MOTDETAT 000000 B
PPOT 00 #
ADCO 524563565245 /
OPTARIF HC.. <
ISOUSC 20 8
Each line contains a label and the associated value. There are several price plans in France and the key/value pairs depend on the price plan you subscribed. The previous example is the most common price plan used in France, with a "peek hour timeframe" (HCHP) and a "low cost hour timeframe" (HCHC). The value associated to those labels is the meter index for these timeframes.
The official document describing the protocol is available here (in french) :
http://norm.edf.fr/pdf/HN44S812emeeditionMars2007.pdf
If it can help, this is how i open the serial port to read the teleinfo packets in python (in my case, i use a serial<->usb converter instead of the /dev/ttyAMA0 line :
Code: Select all
ser = serial.Serial('/dev/ttyUSB1', 1200,timeout=30, bytesize=7, stopbits=1, parity=serial.PARITY_EVEN)
Re: PiFace support added
Posted: Saturday 16 November 2013 11:29
by RobinS
Hi Alex,
Thank you very much for your input.
It clears up a lot.
The info you provided, should help everyone alot to implement a teleinfo <-> domoticz link.
As I noticed that more people are interested in hooking up the teleinfo to domoticz, and you already have a functional python script, maybe you could consider to make available to the other domoticz users...
Best Regards,
Robin
BMP085 and PiFace
Posted: Saturday 16 November 2013 11:41
by RobinS
Hi Piotr,
Yesterday I received some stuff I ordered (along time ago) in China, including a BMP085 sensor.
I hooked it up to my domoticz setup, and as predicted... it works
Best Regards,
Robin

- My PSU, Pi, PiFace, DS1307, 3* S0, Doorbel and BMP085 stack
- Foto Pi Stack_640_480.jpg (140.46 KiB) Viewed 9459 times
Doorbell
Posted: Saturday 16 November 2013 11:53
by RobinS
Hi Titanothere,
I received the amplifiers that I ordered on eBay yesterday, and tested with them today.
I first tried a 3W stereo amplifier, although the sound quality was better than my breadboard experiment, the volume was not much better.
The 3W amplifier:
http://www.lctech-inc.com/Hardware/Deta ... eda630c064
Then I tried a 15W stereo amplifier, which works perfectly... And the volume control is not set to max yet
The 15W amplifier:
http://www.lctech-inc.com/Hardware/Deta ... 471180a02f
Now I need to focus a bit on the playback script, to prevent multiple playbacks (canon) when impatient people press my doorbell...
Best Regards,
Robin
Re: PiFace support added
Posted: Saturday 16 November 2013 11:54
by Keptenkurk

i like the ropes keeping it all together!
Re: PiFace support added
Posted: Tuesday 19 November 2013 8:22
by commodore white
I know I can't use the i/f I bought from Sheep electronics to measure temp using ds1820. However can I use Piface instead and retain my temp sensor network?
Re: PiFace support added
Posted: Sunday 24 November 2013 20:41
by RobinS
The PiFace driver is not capable of supporting a 1 wire network on one of its I/O pins, so hooking up a ds1820 will not work, as its timing is not consistent enough.
You should be able to hook it up to the Pi I/O lines (did you purchase the RPI1 for sheepwalk ?) if so your should be able to directly connect it, but you will need to install a kernel driver.
BTW: there is 1 wire support in domoticz, however I do not know for which hardware. Guess Gizmocuz will know all about it.
Re: PiFace support added
Posted: Sunday 24 November 2013 21:53
by antwan
RobinS wrote:
BTW: there is 1 wire support in domoticz, however I do not know for which hardware. Guess Gizmocuz will know all about it.
I have 1-wire via gpio-4 working perfect for half a year in Domoticz.
Re: PiFace support added
Posted: Friday 06 December 2013 20:36
by Keptenkurk
Today i attached my newly installed smart-meter and hooked it to Domoticz through a P1 cable. Works right away!
However while adding the P1 Smart-meter USB device i noticed that both the PiFace1 and the Smart-meter use ttyUSB1.
Does the PiFace really use this interface? Both the Smart-meter and PiFace1 seem to be happy sharing the interface...

- devices.JPG (52.39 KiB) Viewed 9363 times
/paul
Re: PiFace support added
Posted: Friday 06 December 2013 20:58
by antwan
The piface is using the spi-interface, so no problems.
It would indeed be nice to show this. This is also for the i2C interface.
Re: PiFace support added
Posted: Friday 06 December 2013 21:08
by RobinS
Hi Paul,
Strange, the PiFace does not use any of the tty ports, USB or otherwise.. as it uses the SPI interface (/dev/spidev0.0).
The domoticz is not aware of this port as it uses a different method of access, and should report unkown (like the BMP085 which uses I2C).
Why domoticz is reporting the usage of this port is a bit of mystery to me.
Do you perhaps recall if prior to the connection of the P1 meter domoticz also reported the usage of the tty port ?
I will see if its possible to have domoticz report the /dev/spidev instead of the unknown. (I will be picking up the development on the Piface next week).
Best Regards,
Robin
Re: PiFace support added
Posted: Friday 06 December 2013 21:41
by Keptenkurk
RobinS wrote:Strange, the PiFace does not use any of the tty ports, USB or otherwise.. as it uses the SPI interface (/dev/spidev0.0).
That's what i thought...
RobinS wrote:Do you perhaps recall if prior to the connection of the P1 meter domoticz also reported the usage of the tty port ?
It was already at ttyUSB1 before adding the P1 because when i added the P1 and had to assign the port i wondered what USB to use since both options seemed occupied.
/paul
Re: PiFace support added
Posted: Friday 06 December 2013 23:14
by antwan
@Robin
Can you take a picture off your settup with the S0 meter connected to the piface?
Re: PiFace support added
Posted: Friday 06 December 2013 23:46
by Keptenkurk
It was already at ttyUSB1 before adding the P1 because when i added the P1 and had to assign the port i wondered what USB to use since both options seemed occupied
...wait a minute.. Not so sure anymore. Just had a nasty problem with RFXCOM not starting with "Input buffer out of sync, going to restart!" messages every 30sec.
Tried all kind of restarts, persistent names for the USB devices, and finally went back where i came from i.e. no P1 serial and no PiFace. After powerdown the sync failures had disappeared

and PiFace showed unknown port like antwan. Only after enabling and assigning P1 again PiFace came back with the ttyUSB1 port.
/paul