Stevepi
Posts: 6
Joined: Sun Jan 19, 2014 4:04 pm

Re: Control Relay Switches via Android using a Raspberry Pi

Thu Jan 30, 2014 4:56 pm

Hi Jazzler,

I have bought your excellent PiRelay app (pro version), and have an 8-relay board.
Everything works absolutely brilliantly, and I wanted to say thanks for such a great product and easy-to-use interface.
I use it to switch various bits of my marine aquarium.

My question is this:
In addition to controlling the relays, I would like to add a temperature sensor (18DS20B). This works fine on its own, but HAS to be connected to GPIO #4 (currently relay 7). As I only use 7 of the 8 relays, is there a way I can configure things to free-up GPIO #4 and use a different GPIO pin for relay 7?

Thanks,
Steve.

dschoolderman
Posts: 3
Joined: Fri Jan 31, 2014 6:03 am

Re: Control Relay Switches via Android using a Raspberry Pi

Fri Jan 31, 2014 6:10 am

Hi im bit of a newb have just brought my raspberry pi and relays etc brought pirelay pro and think its fantastic only thing im having trouble with is connnecting from another network. It works fine on my wifi but trouble is I cant set port forwarding in my router without it connecting to a port. it seems to me this app doesnt use a port on the pi. I am just wondering what the easy way round this is and also what can be done in the way of security login credentials etc cheers

User avatar
Richard-TX
Posts: 1549
Joined: Tue May 28, 2013 3:24 pm
Location: North Texas

Re: Control Relay Switches via Android using a Raspberry Pi

Fri Jan 31, 2014 10:01 am

jazzler wrote:Hi Richard-TX,

Great call about using a webpage to change/start/stop a radio station. It's got me thinking of tweaking my PHP script to do this or similar from within the app..

Thanks for the feedback
I did that and then a went to mpd/mpc. Now I control the Rpi's music using either my PC, the droid phone or the hp touchpad. All it takes is a mpd client app for android or windows. gmpclient.org
Richard
Doing Unix since 1985.
The 9-25-2013 image of Wheezy can be found at:
http://downloads.raspberrypi.org/raspbian/images/raspbian-2013-09-27/2013-09-25-wheezy-raspbian.zip

ondrej1024
Posts: 172
Joined: Thu Dec 05, 2013 3:09 pm

Re: Control Relay Switches via Android using a Raspberry Pi

Sat Feb 01, 2014 6:06 pm

dschoolderman wrote:... I cant set port forwarding in my router without it connecting to a port. it seems to me this app doesnt use a port on the pi.
Hi dschoolderman,

if you don't specify a port in the "Server URL" setting of PiRelay app, it will connect to the standard HTTP server port 80, which is where the web server on the RPi is listening. So if you want to connect to it from outside your LAN you need to forward port 80 to the RPi. But there are no protection, anyone with an internet connection will be able to control your relays. :shock:

You could configure some access control on the web server yourself, but it seems that PiRelay does not support this yet.

Ondrej

dschoolderman
Posts: 3
Joined: Fri Jan 31, 2014 6:03 am

Re: Control Relay Switches via Android using a Raspberry Pi

Sat Feb 01, 2014 8:55 pm

hi Ondrej thanks a lot for that worked a treat works fine on mobile 3g now. Am hoping that login credentials may possibly be included in future updates as i was hoping to use it to control garage door opener and heatpump etc remotely. "hoping" nobody finds my ip and port probably isnt enough security for me haha.

amak
Posts: 1
Joined: Thu Feb 13, 2014 8:12 am

Re: Control Relay Switches via Android using a Raspberry Pi

Thu Feb 13, 2014 8:17 am

Hey guy's

A bit new to the raspi and coding in general but i would like to build a similar project but with the use of a usb bluetooth adapter rather than having the whole thing run on a home network. Any suggestions? I have yet to come across any specific apps that will control relay's via bluetooth.

thanks,
Al

KAJ
Posts: 1
Joined: Thu Feb 13, 2014 3:59 pm

Re: Control Relay Switches via Android using a Raspberry Pi

Thu Feb 13, 2014 4:30 pm

Hello Jazzler,
I am looking input dry contact closures to a Raspberry Pi and have it
send via USB to a cell phone to cause the cell phone to send a specific text message.

Question is have you or anyone else done it? And if so is there a link
explaining the application. Thank you.

2410Davie
Posts: 1
Joined: Sun Feb 16, 2014 12:30 am

Re: Control Relay Switches via Android using a Raspberry Pi

Sun Feb 16, 2014 12:36 am

Hi Im Davie, new to the whole RPI thing but im looking to control relays with a tablet and this looks awesome and what I am after, I have a few questions that I'd love answers too if possible.

1. Is it only 8 relays or can i add more to say 16 or 32?
2. is there a way to make the relays be either latching (on with press then off with another press) and momentary (on when touched and off when not touched.
3. is there anyway I can get the source code to change the app design at all?

the reason i ask is i use touch controls just now in my car to control things like heating, lights etc and have now installed a tablet and would like to have an app on that to control everything instead.

Thanks Davie

miketmurray
Posts: 1
Joined: Sat Mar 08, 2014 4:24 pm

Re: Control Relay Switches via Android using a Raspberry Pi

Sat Mar 08, 2014 5:00 pm

Hi Newbie here
You asked for feedback so here goes
I have started to set up rasberrypi to run the relay project. all going well so far - great project.
Image of op sytem worked fine

The wiring of the GP10 pi pins seems fine but I had trouble with the colours of the wires and making certain I had attached them to the correct pins. The colours Orange and yellow were difficult to differentiate on my screen as was grey and white. A two column table (with words starting brown and red in the right hand column etc and so on down the table) would back up the top and bottom pictures.
I have some working knowledge of electricity and realised the importance of getting the 5v supply wires right but keep thinking I might fry something if i get the other pins wrong. What comes down those pins, just small volt pulse? Can it harm any thing if I get them wrong?
Relay hasn't arrived yet so can't test it yet.

Thanks
Mike

timothy_098
Posts: 1
Joined: Tue Mar 11, 2014 11:51 pm

Re: Control Relay Switches via Android using a Raspberry Pi

Tue Mar 11, 2014 11:56 pm

Hi All,

Just installed all this onto my pi and android. All works a treat.

Question- If i have two raspberrypi's is it possible to have a app for each pi with different url's?

I have two pi's and two relay banks and want to control both without changing the url every time.

Any help?

Weirdfish
Posts: 2
Joined: Thu Mar 13, 2014 9:43 pm

Re: Control Relay Switches via Android using a Raspberry Pi

Tue Mar 25, 2014 10:55 pm

Hi wonder if you can help me
I have download the Pirelay pro app and copied ever thing of the web site to my raspberry pi. The problem am getting is when I run the app I can turn the relays on but can't get then to turn off again (please help) I have tried switching relay type from high to low but it still does the same, I also tried the relay signals and still got no luck. I am new to all of this so I think it is more likely sum-thing am doing wrong, I can write the command gpio mode 7 out / in and it turns on/off but not on the app thanks Dan

miki
Posts: 1
Joined: Tue Apr 08, 2014 6:57 pm

Re: Control Relay Switches via Android using a Raspberry Pi

Tue Apr 08, 2014 7:08 pm

Hello,
great application. But is access to Pi, password protected?

raspy
Posts: 17
Joined: Thu Apr 19, 2012 6:15 pm

Re: Control Relay Switches via Android using a Raspberry Pi

Sun Apr 13, 2014 5:43 pm

Hi. I have brought this relay http://www.ebay.co.uk/itm/271422240642? ... 26_rdc%3D1

I'm having trouble using it with this program. Is it compatible with this?What pin should it be on? I have it on gpio4. I can't get it to switch on.

I switch on the relay with the app and using relay number 7. I get 3.3v on the pin I connected it to but the relay don't switch. And when i switch off i get 0v but it wont switch.

Any help?

Tarcas
Posts: 741
Joined: Thu Jan 09, 2014 5:38 am
Location: USA

Re: Control Relay Switches via Android using a Raspberry Pi

Sun Apr 13, 2014 7:39 pm

raspy wrote:Hi. I have brought this relay http://www.ebay.co.uk/itm/271422240642? ... 26_rdc%3D1

I'm having trouble using it with this program. Is it compatible with this?What pin should it be on? I have it on gpio4. I can't get it to switch on.

I switch on the relay with the app and using relay number 7. I get 3.3v on the pin I connected it to but the relay don't switch. And when i switch off i get 0v but it wont switch.

Any help?
If you disconnect the IN pin from the GPIO and connect it instead to +5v, does it switch then? What if you connect it to GND?) If one of these works, then either you're not triggering the GPIO pin that it's connected to (there are several different pin numbering schemes that can be very confusing, so double-check that you're using the same one consistently) or it doesn't work at 3.3v. To test the latter, connect it to 3.3v (header pin 1.) If it works on 5v but 3.3v doesn't work, find a relay board that has separate VCC and JD-VCC connections on the board. Most 4-relay boards I've seen have this feature. (The JD-VCC is used for comparison with the IN pins, so you can use 3.3v as inputs on a 5v relay by connecting JD-VCC to 3.3v and VCC to 5v.) Alternately, you can use a logic level converter to shift the 3.3v output up to a 5v input for the relay board.

Clear as mud?

raspy
Posts: 17
Joined: Thu Apr 19, 2012 6:15 pm

Re: Control Relay Switches via Android using a Raspberry Pi

Sun Apr 13, 2014 8:12 pm

Hi. Thank you. Ok. I just looked. I put the input on 3.3v header 1 and it clicks when i put it on and remove so it does work off 3.3v. I am not sure what pin I should have it on? Can any one help?

I have put it on header 12. When I activate it the green light dims very slightly. But don't turn off. With the green light on. I have 3.3v with the relay status in the app is on.

With the status off I have 0.01v. And the green light is still on. If I pull the wire off the light goes out.

I have 4v on the in wire coming out of the relay module when it's disconnected.

I also have 0v on the pin on the pi with it disconnected.


Ps I have a rev 1 board
Thanks

raspy
Posts: 17
Joined: Thu Apr 19, 2012 6:15 pm

Re: Control Relay Switches via Android using a Raspberry Pi

Mon Apr 14, 2014 12:24 pm

I have been playing a bit more with it. If I switch on my pi. The green light is out. I then use the app to activate relay one. The relay then clicks and the green light comes on. I then switch off using the app and nothing happens. The green light stays on. If I quickly switch relay one on/off the green light dims ever so slightly.
If I use sudo halt. The green light will go off when it's halted
Help

Tarcas
Posts: 741
Joined: Thu Jan 09, 2014 5:38 am
Location: USA

Re: Control Relay Switches via Android using a Raspberry Pi

Mon Apr 14, 2014 3:10 pm

raspy wrote:I have been playing a bit more with it. If I switch on my pi. The green light is out. I then use the app to activate relay one. The relay then clicks and the green light comes on. I then switch off using the app and nothing happens. The green light stays on. If I quickly switch relay one on/off the green light dims ever so slightly.
If I use sudo halt. The green light will go off when it's halted
Help
Sounds like an issue with the app to me. Have you tried it from the command line using WiringPi's gpio utility? If that works but the app still doesn't, it's definitely a code problem.

raspy
Posts: 17
Joined: Thu Apr 19, 2012 6:15 pm

Re: Control Relay Switches via Android using a Raspberry Pi

Mon Apr 14, 2014 4:57 pm

Hi. Do I use this?

First type in:
gpio mode 1 out

Then:
gpio write 1 1

This will turn on the GPIO input for relay 1,

To turn it off again use:
gpio write 1 0.

I type first line in and the relay light comes on. Then if I use any of the other 2 commands it won't go off.

Thanks

Tarcas
Posts: 741
Joined: Thu Jan 09, 2014 5:38 am
Location: USA

Re: Control Relay Switches via Android using a Raspberry Pi

Tue Apr 15, 2014 3:48 am

That's strange. The commands are correct, and removing power should certainly power down the relay. Sounds like you have a bad transisitor on the board, that's not switching off to remove the power from the relay. Do you have any LEDs around to test the GPIO pin to make sure that's switching off properly when the command is issued? If that doesn't turn off either, the Pi is bad and should be replaced under warranty, if your warranty is still valid. If it does turn off, your relay board is bad and should be replaced instead. If you do that, look into a 4-channel relay board. I think you'll find it not much more expensive than your 1-channel was, and it should have separate VCC and JD-VCC inputs. Only downside is that most of them are inverse logic (gpio on turns relay off, gpio off turns relay on) but that's easy to correct for in code.

raspy
Posts: 17
Joined: Thu Apr 19, 2012 6:15 pm

Re: Control Relay Switches via Android using a Raspberry Pi

Tue Apr 15, 2014 12:20 pm

Thanks to everyone that replied. I got a 4 relay module and it all works. A dodgy relay.

Many thanks.

paulrockliffe
Posts: 1
Joined: Tue May 20, 2014 1:08 pm

Re: Control Relay Switches via Android using a Raspberry Pi

Tue May 20, 2014 1:26 pm

Hello, my board of relays finally arrived from China, so just set this up and all working great. Really impressed with how easy it was, even down to the App finding the Pi without even needing to be told an IP address!

Can I quickly ask what would happen if I added another Pi running your software to my network? I can't see any way of distinguishing between each in the App, so presume either they'd both do the same thing or neither would work?

Couple of thoughts and suggestions for you if you're planning to develop the system further:

It would be great if it was possible to run more than 8 relays from the Pi using the unused pins. Is there a hardware limit on this, or would it just be a case of coding it?

Would it be possible to control your App with Tasker or similar? If so, that would add a whole load more functionality by making it possible to setup timers on the switches or link relays to tasks etc. As an example, I'd like to be able to open a relay when opening certain apps on my phone. My phone is connected to a Bluetooth receiver, which plays music etc around the house, so a relay to turn on my amplifiers would be really useful.

On the App side of things, being able to add the switches directly to a home screen, via a Widget or Shortcut would be really handy too.

Anyway, thanks again for your hard work!

southpaw
Posts: 52
Joined: Wed Nov 30, 2011 2:23 pm

Re: Control Relay Switches via Android using a Raspberry Pi

Wed May 21, 2014 5:52 pm

you can use it on 2 pi`s mate, just make sure 2nd pi has its own i-p address, you can then control it via this on local network, for controling it over 3g, you will need to configure a seperate port for pi number2, and forward that port to pi2 in your home router , with standard port 80 already forwarded to pi-1, and pi-2 to port 90 for instance
hope that makes some sense to you

edit, sorry, just realised your q was regarding the app, not sure how the app would work with 2 pi`s

[avi]
Posts: 56
Joined: Mon Dec 10, 2012 3:00 pm

Re: Control Relay Switches via Android using a Raspberry Pi

Thu May 29, 2014 11:42 am

Great! I will be using this with my Moto G!

the relay you mentioned: http://www.ebay.co.uk/itm/400514325341

can I use to control water pump? its 1HP, 240V and 8A. Have you tried?

kieran kehoe
Posts: 2
Joined: Thu Oct 16, 2014 3:00 pm

Re: Control Relay Switches via Android using a Raspberry Pi

Thu Oct 16, 2014 3:12 pm

will this work with pi b+

poweredbyant
Posts: 10
Joined: Mon Dec 10, 2012 2:17 am

Re: Control Relay Switches via Android using a Raspberry Pi

Wed Oct 22, 2014 8:55 pm

how about more gpios on the raspberry pi B+?

would be great if have more than eight relay thanks cheers

Return to “Android”