Originally Posted by whisper
OK, I think Biff has an iphone 4? (don't think a 4 has siri)
On Sunny he has 2 x led circuits, one is red to light the cockpit while night driving and the other is white to light the cockpit while moored up. There may be another set if he has underwater transom lights...
How it works...
Assuming the iphone can connect direct to the Pi using wifi and not the internet? (sorry i don't know how this bit works) It would need to work while walking to and from the boat.
So on the iphone there should be six commands:
White lights on
White lights off
Red lights on
Red lights off
*Blue lights on
*Blue lights off
*Assuming transom lights are fitted.
The Pi receives the signals and energises the required relay that is run in parallel to each led on/off switch.
How does that sound?? Probably completely wrong
So from a Pi principle this is a piece of p@@@. Easiest way is to put some form of webserver on the pi. Set its WiFi as an access point. Biff would connect to the WiFi and open browser and go to something like 192.168.1.1 and get web page with three toggle switches on it. Page needs to run a wee bit of code to switch the relay job done. Needs to be a latching relay I guess.
Now for some basic snags. Assuming you put a traditional switch in so you can do the lights with out the phone the web page doesn't know if they are on. If the are in parallel to the relay they will let you switch on from either but only off from the on that switched on. If they are in series they would need to both be on or either off. Better would be to put the switch panel as spring return switches to energise the relay.
Next - security. Need to think how you stop me finding Biffs boats and playing with his lights. But allow him to change phone, forget his phone and borrow a mates.
Next - he put the lights on to leave boat with the plan to switch off once in the car. He is out of range of WiFi so has to return to nearer the boat to switch off.
You could build in solutions for all of these I suspect. But unless he has shore power its gonna guzzle loads of juice. 800mA @5v is 4w, allowing for inefficient charger circuit probably 5w. From a 12v supply that's approaching 0.5A per hour. Or 12Ah per day. A decent size house battery on a boat will be flat in a week! The trouble is you can't make it go to sleep.
Bluetooth with Arduino type processor would be more efficient. Although range shorter.
Would be fine for an engine in function like monitoring fuel flow, fuel tank level, revs, GPS pos, coolant and oil temp, battery voltage and putting all on a SD card to take home and analyse to see what us most efficient etc.
Other advantage. Is you can reprogram easily. Not sure how much programming needed once the lights work.