User avatar
ilovemipi
Posts: 161
Joined: Mon Dec 02, 2013 11:52 am
Location: UK + Cyprus
Contact: Website

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Thu Dec 19, 2013 1:16 pm

txt3rob wrote:where possible i would suggest the status sockets as i have them working with my home automation script perfectly.
My Status remote sockets arrived today but I am still waiting for the 'filters' to arrive from China. Am I likely to get any joy over say a few inches until the filters arrive or would I be wasting my time? When I tried **** my radio picked up something but the wav file was unrecognisable.

Also a bit confused as to whether I should go through the PiHat process and then Rob's process or just Rob's. Was the original PiHat modified to cater for Status remotes (>1m combinations) or is it just for Nexa devices?

User avatar
ilovemipi
Posts: 161
Joined: Mon Dec 02, 2013 11:52 am
Location: UK + Cyprus
Contact: Website

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Thu Dec 19, 2013 4:38 pm

Wicked so PiHat worked first time with the Status remote socket.

Well it worked until I used the actual remote for the Status. Right out the box PiHat was ok but now I am struggling. I will have to work out how they actual work with the Pi and the physical remote control.

User avatar
ilovemipi
Posts: 161
Joined: Mon Dec 02, 2013 11:52 am
Location: UK + Cyprus
Contact: Website

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Thu Dec 19, 2013 10:17 pm

Ok so I am getting over 6m range with the 49cm wire on GPIO4 (pin 7) before I fit the filters. Quite impressive and all 3 sockets are performing very well. I need slightly more range, perhaps 10m, but so far so good.

I think I am missing a few bits though with the basic PiHat program.

1. If I add --frequency=1 I don't hear anything on 100mhz FM. Any ideas why?
2. What is 'decoding' as described by the Status (RCS-K09) self learning procedure?
3. Presumably some of you are able to operate the sockets with the Pi AND the remote control. Convenient until I get a slightly better range. I see reference to obtaining the 'code' within this thread which I believe is one of the million plus learning code combinations. How do I obtain this and will it allow me to operate the sockets with the Pi and the remote control? If so what is the procedure to obtain the code and how do I use it once I have the code?

Bit unfortunate that the sockets lose their pairing after the power fails. Are there any sockets working with PiHat that retain their pairing when they are unplugged from the mains?

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Thu Dec 19, 2013 10:47 pm

3. Presumably some of you are able to operate the sockets with the Pi AND the remote control.
Yes providing you're using the same id number as used with the remote control.

Richard S.

User avatar
ilovemipi
Posts: 161
Joined: Mon Dec 02, 2013 11:52 am
Location: UK + Cyprus
Contact: Website

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Thu Dec 19, 2013 11:06 pm

redhawk wrote:
3. Presumably some of you are able to operate the sockets with the Pi AND the remote control.
Yes providing you're using the same id number as used with the remote control.

Richard S.
How do I obtain the ID number?

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Fri Dec 20, 2013 12:19 am

You need some way of capturing the signals from your remote control so that the data can be analysed.
I've written a small Pascal PoC program (requires Free Pascal or Turbo Pascal to compile) to do just that, it reads from a WAV file recording and prints what it finds - http://pastebin.com/39jBCjzL

C:\>remote r2.wav -f2
0011000001000100100111010
0011000001000100100111010
0011000001000100100111010
0011000001000100100111010
0011000001000100100111010
0011000001000100100111010
001100000100010010011101

C:\>remote r2.wav -f2 -s
0011000001000100100111010 --brand=5 --id=197705 --channel=5 --state=1

Ideally you would need an 433.92Mhz receiver board, but there are other alternatives such as an FM radio, homemade basic AM receiver, or opening the remote control and tapping into the antenna signal directly into your sound card.

Richard S.

User avatar
ilovemipi
Posts: 161
Joined: Mon Dec 02, 2013 11:52 am
Location: UK + Cyprus
Contact: Website

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Fri Dec 20, 2013 11:04 am

redhawk wrote:You need some way of capturing the signals from your remote control so that the data can be analysed.
I've written a small Pascal PoC program (requires Free Pascal or Turbo Pascal to compile) to do just that, it reads from a WAV file recording and prints what it finds - http://pastebin.com/39jBCjzL

C:\>remote r2.wav -f2
0011000001000100100111010
0011000001000100100111010
0011000001000100100111010
0011000001000100100111010
0011000001000100100111010
0011000001000100100111010
001100000100010010011101

C:\>remote r2.wav -f2 -s
0011000001000100100111010 --brand=5 --id=197705 --channel=5 --state=1

Ideally you would need an 433.92Mhz receiver board, but there are other alternatives such as an FM radio, homemade basic AM receiver, or opening the remote control and tapping into the antenna signal directly into your sound card.

Richard S.


Some really great info on this thread even if some of it is going over my head.

For those that have used the scripts to obtain the codes how long is it taking? 1 hour, 6 hours, 2 days? I think I might try this route first as it is less technical for a novice like me. Also Status indicate over 1m codes so I am confused that this thread indicates searching in the range 196608 to 262143. Can someone please explain this to me?

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Fri Dec 20, 2013 12:02 pm

A simple wire antenna is called a 1/4 wave dipole, the optimum length can be calculated using an online converter like - http://wb5mrn.com/ham/antenna.htm
Unfortunately Pihat doesn't generate pure 433.92MHz sine radio waves it's actually the 3rd harmonic of 144.64MHz (a side effect of square waves) so length calculations are meaningless.
Getting the optimum length of wire to work is going to be trial and error, however if you use a SAW filter to allow only 433.92MHz then the 1/4 wave dipole should be optimum around 6.46 inches.

Richard S.

User avatar
ilovemipi
Posts: 161
Joined: Mon Dec 02, 2013 11:52 am
Location: UK + Cyprus
Contact: Website

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Fri Dec 20, 2013 1:50 pm

Ok tried **** again but with the PiHAT 19" antenna. Same results as before, sound wav plays on the radio but just as silence. Get continuous beep if I change frequency to 700. Tried frequencies from 100 to 10000000 with no improvement.

I am a numbers guy so I worked out with the recommended sleep of 0.04 it will do 25 codes per second and 'crack' the code in 45 minutes if range is 196608 to 262143 or 11 hours if it is a range of 1m possibles.

If it is 1m possibles what is the range? 1 to 1m, 196609 + 1m, 65536 + 1m or something else?

So far the script has worked through 7000 codes without switching off the lamp attached to the Status socket. Will see how it goes in the coming hours.

User avatar
ilovemipi
Posts: 161
Joined: Mon Dec 02, 2013 11:52 am
Location: UK + Cyprus
Contact: Website

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Fri Dec 20, 2013 4:50 pm

The reality is that the script only does about 5 codes per second rather than the theoretically 25 per second. So 65K codes will take almost 4 hours and 1m codes will take 55 hours!

I am two thirds of the way through the 65K and no joy yet but I'm convinced there are over 1m codes.

carlvk
Posts: 31
Joined: Tue Jun 19, 2012 7:43 am

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Tue Dec 24, 2013 8:22 am

OK, thanks I will look out for a set. and try again after christmas
Have a good one everyone
Carlvk
Pi killer

User avatar
ilovemipi
Posts: 161
Joined: Mon Dec 02, 2013 11:52 am
Location: UK + Cyprus
Contact: Website

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Sat Dec 28, 2013 1:45 pm

txt3rob wrote:where possible i would suggest the status sockets as i have them working with my home automation script perfectly.
Very impressed with your script Rob and has I get over 6m range WITHOUT the 433mhz transmitters it is all at zero cost. I'm using 40 cm antenna and your script is running like a dream. Thanks.

User avatar
ilovemipi
Posts: 161
Joined: Mon Dec 02, 2013 11:52 am
Location: UK + Cyprus
Contact: Website

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Fri Jan 10, 2014 4:46 pm

The transmitters arrived from China today and the 6m range is now over 14m through quite thick walls. So it covers all of my modest sized apartment.

The transmitters are rated from 3V to 12V so at present I am connected to pin 1 (3V3). I must say I am a bit confused about the 6 DNC (do not connect) pins on the 26 pin Pi rev 2 header. Are we not able to use pin 4 (5V0) pin 9 (GND), pin 14 (GND), pin 17 (3V3), pin 20 (GND) and pin 25 (GND)?

The case I have is a flip top with one of the 'hinges' obstructing pins 1 to 6 when the case is open. It has a cut out above the header but with my stubby fingers I would prefer to open the flip top and use pin 17 and 25 for 3V3 and GND rather than pin 1 and pin 6. Is this ok or are the DNC's precisely that, do not connect?

I have also read that we shouldn't use the 5V feed from the Pi either i.e. Pin 2. So if I wanted to achieve an even bigger range I couldn't use pin 2? The transmitters are rated as having a range of up to 200m which I guess would be from an external 12V feed.

User avatar
ilovemipi
Posts: 161
Joined: Mon Dec 02, 2013 11:52 am
Location: UK + Cyprus
Contact: Website

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Sat Jan 11, 2014 12:24 am

redhawk wrote:You need some way of capturing the signals from your remote control so that the data can be analysed.
I've written a small Pascal PoC program (requires Free Pascal or Turbo Pascal to compile) to do just that, it reads from a WAV file recording and prints what it finds - http://pastebin.com/39jBCjzL

C:\>remote r2.wav -f2
0011000001000100100111010
0011000001000100100111010
0011000001000100100111010
0011000001000100100111010
0011000001000100100111010
0011000001000100100111010
001100000100010010011101

C:\>remote r2.wav -f2 -s
0011000001000100100111010 --brand=5 --id=197705 --channel=5 --state=1

Ideally you would need an 433.92Mhz receiver board, but there are other alternatives such as an FM radio, homemade basic AM receiver, or opening the remote control and tapping into the antenna signal directly into your sound card.

Richard S.
Thanks for this Richard. I hooked up the receiver that came with the transmitter from China and your software successfully decoded the audacity wav file. I wasn't optimistic as the quality of my wav file was a bit ropey.

Without the -f switch your software gave me about 8 possibles. With the -f switch just 2 possibles and the first one was a success. The code is 19903 for my Status remote which explains why the bash script testing I did with all possibles between 196608 to 262143 failed.

jets
Posts: 58
Joined: Mon May 06, 2013 9:40 am

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Sat Jan 11, 2014 12:38 am

I have been quite successful with PiHat and 433Mhz RF transmitter and receiver. However, it is not very reliable. What would you consider as a best antenna for this? At the moment I am using just a unknown length piece of wire.

As I am radio amateur, more like "retired 20 years ago" - ham, I calculate the wave length to be around 70cm. But that is quite long for standard mono-antenna, and I it would be good to have ground plane as well. Maybe just some 17.7cm wire would do the trick? Advice from experienced is welcome!

I need range of roughly about 25 meters.

User avatar
ilovemipi
Posts: 161
Joined: Mon Dec 02, 2013 11:52 am
Location: UK + Cyprus
Contact: Website

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Sat Jan 11, 2014 1:07 am

jets wrote:I have been quite successful with PiHat and 433Mhz RF transmitter and receiver. However, it is not very reliable. What would you consider as a best antenna for this? At the moment I am using just a unknown length piece of wire.

As I am radio amateur, more like "retired 20 years ago" - ham, I calculate the wave length to be around 70cm. But that is quite long for standard mono-antenna, and I it would be good to have ground plane as well. Maybe just some 17.7cm wire would do the trick? Advice from experienced is welcome!

I need range of roughly about 25 meters.
I know absolutely nothing about radios but my experience tells me longer is better. I think 20cm or so and not the 6cm quoted by some. I realise the frequencies are a little different but stereo radios that still have antennas are generally well over 20cm. Perhaps you need to look at an external power supply for the transmitter to boost your range. You can go up to 12V if needed if you have the standard transmitter used by many users here.

User avatar
ilovemipi
Posts: 161
Joined: Mon Dec 02, 2013 11:52 am
Location: UK + Cyprus
Contact: Website

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Sat Jan 11, 2014 6:59 am

Like others my last post should have referred to inches not cm.

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Sat Jan 11, 2014 10:18 am

Actually longer is not better antennas are only optimal at a limited frequency range although at lower frequencies like 88 - 108MHz this is not so critical.
For pure 433.92MHz broadcasts the correct length of a quarter wave dipole is 16cm or 6.3 inches - http://wb5mrn.com/ham/antenna.htm

Richard S.

jets
Posts: 58
Joined: Mon May 06, 2013 9:40 am

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Sat Jan 11, 2014 4:21 pm

redhawk wrote:Actually longer is not better antennas are only optimal at a limited frequency range although at lower frequencies like 88 - 108MHz this is not so critical.
For pure 433.92MHz broadcasts the correct length of a quarter wave dipole is 16cm or 6.3 inches - http://wb5mrn.com/ham/antenna.htm

Richard S.
Lovely. I should have been able to calculate that myself, or google it :)

But how about the ground "plane", at least considering ham antennas, the "ground" is important. Dipole antenna's other half is the "ground".

I'll try that 16cm.

But also, I believe umtskeeper and other stuff take a lot of cpu and might interfere sending the signal.

I wonder if I could somehow put some priority to PiHat?

jets
Posts: 58
Joined: Mon May 06, 2013 9:40 am

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Sat Jan 11, 2014 8:38 pm

Hmm. Actually I was thought that the wavelength is calculated by dividing 300 with the Mhz of the RF. But then again we need to consider what is the speed factor of cable/what ever is delivering the RF signal..

So I believe I will try 17.283 .. in real life 17.28-9 cm length. Without any speficic "ground"-plane.

User avatar
DougieLawson
Posts: 38549
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Sun Jan 12, 2014 1:33 am

jets wrote:Hmm. Actually I was thought that the wavelength is calculated by dividing 300 with the Mhz of the RF. But then again we need to consider what is the speed factor of cable/what ever is delivering the RF signal..
You're using 300,000,000 m/s as an approximation for c in that calculation. It's close enough to 299,792,458 m/s
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

I'll do your homework for you for a suitable fee.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

sntuk
Posts: 2
Joined: Sun Jan 12, 2014 7:05 pm

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Sun Jan 12, 2014 7:09 pm

Hi,

I have some Maplin Remote Controlled sockets, and a 4 channel remote with 4 on and 4 off buttons (totalling 16 total units).

I have downloaded the code (standard) and have copied the script to search for the remote code. However, when listening on the radio, it does not sound as if the signal is the same as from the actual remote??

Can anyone let me know which id they used with the Maplin sockets. Or if anyone has developed PiHAT further to include the Maplin sockets I would love to hear about it - Thanx,
sntuk

7ewis
Posts: 130
Joined: Wed Dec 26, 2012 11:30 am

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Mon Jan 20, 2014 9:32 am

Would this be recommended over using something like a TellStick (USB RF Broadcaster)?

It would be cheaper, but probably less reliable. How well has PiHAT been working?
Raspberry Pi - Model B (512MB)

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Mon Jan 20, 2014 9:48 am

7ewis wrote:Would this be recommended over using something like a TellStick (USB RF Broadcaster)?

It would be cheaper, but probably less reliable. How well has PiHAT been working?
I don't know much about the TellStick so I cannot comment on it's effectiveness, however like all USB devices it needs to be supported in Linux and maybe additional drivers / software.
I could probably design something similar using an audio dongle, a Schmitt trigger and a 433.92MHz transmitter board to play specially generated wav files but I couldn't be bothered.
Pihat does a perfectly antiquate job of broadcasting simulated pulses, however getting the required range from the GPIO 4 pin can be hit and miss for some people due to the antenna arrangements.

Richard S.

7ewis
Posts: 130
Joined: Wed Dec 26, 2012 11:30 am

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Tue Jan 28, 2014 8:23 am

How do I pair my Nexa plugs to PiHAT?

I received them yesterday, they are a standard 3 pack with a remote, I believe they are the self learning set.

How do I find out the ID and channel to attempt a connection? It doesn't say anywhere on the packaging.

And for the aerial, it just has to be 16cm of any wire touching that particular pin?
Raspberry Pi - Model B (512MB)

Return to “Automation, sensing and robotics”