PiFace support added

Moderator: fantom

antwan
Posts: 292
Joined: Saturday 13 July 2013 13:28
Target OS: Linux
Domoticz version: Latest
Location: Hilversum, The Netherlands
Contact:

Re: PiFace support added

Post by antwan » Thursday 14 November 2013 11:22

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.
Rasp Pi 2B: 3x DS18S20 (1-wire), BME280 (i2c)
Cubietruck 1: Aeotec Z-Wave+, RFXtrx433E, RFXtrx868, P1 Converter, TE923 display, Voltcraft CO-20, SolarEdge proxy
Cubietruck 2: Aeotec Z-Wave, RFXtrx433E

bistoury
Posts: 158
Joined: Friday 12 July 2013 14:14
Target OS: -
Domoticz version:
Contact:

Re: PiFace support added

Post by bistoury » Thursday 14 November 2013 11:46

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.

RobinS
Posts: 67
Joined: Friday 13 September 2013 0:24
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: PiFace support added

Post by RobinS » Thursday 14 November 2013 20:43

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.
My domoticz setup:
PI [Doorbell on Audio out], DS1307 RTC, BMP085, PiFace [4* S0 meter, Doorbell In, PIR, GBS and Door sensors] and RFXCom 433 [5 HomeEasy, 2 Impluz]
2x P1 smartmeter on USB
Gammu-smsd with USB 3G modem
Andromoticz on control tablet

RobinS
Posts: 67
Joined: Friday 13 September 2013 0:24
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: PiFace support added

Post by RobinS » Thursday 14 November 2013 20:49

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).
My domoticz setup:
PI [Doorbell on Audio out], DS1307 RTC, BMP085, PiFace [4* S0 meter, Doorbell In, PIR, GBS and Door sensors] and RFXCom 433 [5 HomeEasy, 2 Impluz]
2x P1 smartmeter on USB
Gammu-smsd with USB 3G modem
Andromoticz on control tablet

RobinS
Posts: 67
Joined: Friday 13 September 2013 0:24
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: PiFace support added

Post by RobinS » Thursday 14 November 2013 21:11

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.... :o
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
My domoticz setup:
PI [Doorbell on Audio out], DS1307 RTC, BMP085, PiFace [4* S0 meter, Doorbell In, PIR, GBS and Door sensors] and RFXCom 433 [5 HomeEasy, 2 Impluz]
2x P1 smartmeter on USB
Gammu-smsd with USB 3G modem
Andromoticz on control tablet

bistoury
Posts: 158
Joined: Friday 12 July 2013 14:14
Target OS: -
Domoticz version:
Contact:

PiFace support added

Post by bistoury » Thursday 14 November 2013 23:09

I am afraid I can't give your more input. Hope some one reed our discussion :)

Alex
Posts: 32
Joined: Saturday 13 July 2013 17:30
Target OS: -
Domoticz version:
Location: Bordeaux, France
Contact:

Re: PiFace support added

Post by Alex » Friday 15 November 2013 10:53

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)
RaspberryPi + Domoticz + RFXCom + Razberry as home automation server
6 On/Off plugs, 2 dimmer plugs, 4 temp/hum sensors, 3 On/Off modules, 3 remotes, 1 smoke detector, 1 Karotz

RobinS
Posts: 67
Joined: Friday 13 September 2013 0:24
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: PiFace support added

Post by RobinS » Saturday 16 November 2013 12:29

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
My domoticz setup:
PI [Doorbell on Audio out], DS1307 RTC, BMP085, PiFace [4* S0 meter, Doorbell In, PIR, GBS and Door sensors] and RFXCom 433 [5 HomeEasy, 2 Impluz]
2x P1 smartmeter on USB
Gammu-smsd with USB 3G modem
Andromoticz on control tablet

RobinS
Posts: 67
Joined: Friday 13 September 2013 0:24
Target OS: Raspberry Pi
Domoticz version:
Contact:

BMP085 and PiFace

Post by RobinS » Saturday 16 November 2013 12:41

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
Foto Pi Stack_640_480.jpg
My PSU, Pi, PiFace, DS1307, 3* S0, Doorbel and BMP085 stack
Foto Pi Stack_640_480.jpg (140.46 KiB) Viewed 4494 times
My domoticz setup:
PI [Doorbell on Audio out], DS1307 RTC, BMP085, PiFace [4* S0 meter, Doorbell In, PIR, GBS and Door sensors] and RFXCom 433 [5 HomeEasy, 2 Impluz]
2x P1 smartmeter on USB
Gammu-smsd with USB 3G modem
Andromoticz on control tablet

RobinS
Posts: 67
Joined: Friday 13 September 2013 0:24
Target OS: Raspberry Pi
Domoticz version:
Contact:

Doorbell

Post by RobinS » Saturday 16 November 2013 12:53

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 :twisted:
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
My domoticz setup:
PI [Doorbell on Audio out], DS1307 RTC, BMP085, PiFace [4* S0 meter, Doorbell In, PIR, GBS and Door sensors] and RFXCom 433 [5 HomeEasy, 2 Impluz]
2x P1 smartmeter on USB
Gammu-smsd with USB 3G modem
Andromoticz on control tablet

User avatar
Keptenkurk
Posts: 440
Joined: Wednesday 21 August 2013 17:24
Target OS: -
Domoticz version:
Location: Waalre, The Netherlands
Contact:

Re: PiFace support added

Post by Keptenkurk » Saturday 16 November 2013 12:54

:D i like the ropes keeping it all together!

commodore white
Posts: 242
Joined: Sunday 14 July 2013 11:19
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Ipswich, UK
Contact:

Re: PiFace support added

Post by commodore white » Tuesday 19 November 2013 9:22

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?

RobinS
Posts: 67
Joined: Friday 13 September 2013 0:24
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: PiFace support added

Post by RobinS » Sunday 24 November 2013 21:41

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.
My domoticz setup:
PI [Doorbell on Audio out], DS1307 RTC, BMP085, PiFace [4* S0 meter, Doorbell In, PIR, GBS and Door sensors] and RFXCom 433 [5 HomeEasy, 2 Impluz]
2x P1 smartmeter on USB
Gammu-smsd with USB 3G modem
Andromoticz on control tablet

antwan
Posts: 292
Joined: Saturday 13 July 2013 13:28
Target OS: Linux
Domoticz version: Latest
Location: Hilversum, The Netherlands
Contact:

Re: PiFace support added

Post by antwan » Sunday 24 November 2013 22:53

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.
Rasp Pi 2B: 3x DS18S20 (1-wire), BME280 (i2c)
Cubietruck 1: Aeotec Z-Wave+, RFXtrx433E, RFXtrx868, P1 Converter, TE923 display, Voltcraft CO-20, SolarEdge proxy
Cubietruck 2: Aeotec Z-Wave, RFXtrx433E

User avatar
Keptenkurk
Posts: 440
Joined: Wednesday 21 August 2013 17:24
Target OS: -
Domoticz version:
Location: Waalre, The Netherlands
Contact:

Re: PiFace support added

Post by Keptenkurk » Friday 06 December 2013 21:36

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
devices.JPG (52.39 KiB) Viewed 4398 times
/paul

antwan
Posts: 292
Joined: Saturday 13 July 2013 13:28
Target OS: Linux
Domoticz version: Latest
Location: Hilversum, The Netherlands
Contact:

Re: PiFace support added

Post by antwan » Friday 06 December 2013 21:58

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.
Attachments
Capture.PNG
Capture.PNG (11.97 KiB) Viewed 4398 times
Rasp Pi 2B: 3x DS18S20 (1-wire), BME280 (i2c)
Cubietruck 1: Aeotec Z-Wave+, RFXtrx433E, RFXtrx868, P1 Converter, TE923 display, Voltcraft CO-20, SolarEdge proxy
Cubietruck 2: Aeotec Z-Wave, RFXtrx433E

RobinS
Posts: 67
Joined: Friday 13 September 2013 0:24
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: PiFace support added

Post by RobinS » Friday 06 December 2013 22:08

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
My domoticz setup:
PI [Doorbell on Audio out], DS1307 RTC, BMP085, PiFace [4* S0 meter, Doorbell In, PIR, GBS and Door sensors] and RFXCom 433 [5 HomeEasy, 2 Impluz]
2x P1 smartmeter on USB
Gammu-smsd with USB 3G modem
Andromoticz on control tablet

User avatar
Keptenkurk
Posts: 440
Joined: Wednesday 21 August 2013 17:24
Target OS: -
Domoticz version:
Location: Waalre, The Netherlands
Contact:

Re: PiFace support added

Post by Keptenkurk » Friday 06 December 2013 22:41

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

antwan
Posts: 292
Joined: Saturday 13 July 2013 13:28
Target OS: Linux
Domoticz version: Latest
Location: Hilversum, The Netherlands
Contact:

Re: PiFace support added

Post by antwan » Saturday 07 December 2013 0:14

@Robin
Can you take a picture off your settup with the S0 meter connected to the piface?
Rasp Pi 2B: 3x DS18S20 (1-wire), BME280 (i2c)
Cubietruck 1: Aeotec Z-Wave+, RFXtrx433E, RFXtrx868, P1 Converter, TE923 display, Voltcraft CO-20, SolarEdge proxy
Cubietruck 2: Aeotec Z-Wave, RFXtrx433E

User avatar
Keptenkurk
Posts: 440
Joined: Wednesday 21 August 2013 17:24
Target OS: -
Domoticz version:
Location: Waalre, The Netherlands
Contact:

Re: PiFace support added

Post by Keptenkurk » Saturday 07 December 2013 0:46

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 :P and PiFace showed unknown port like antwan. Only after enabling and assigning P1 again PiFace came back with the ttyUSB1 port.
/paul

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest