Hi All,
I have developed a new iOS App & Python script for Home Automation projects:
It's very easy to use, installation takes only couple of minutes.
Please download and try, let me know what you think.
App URL :
https://itunes.apple.com/app/id1098156642
My home automation demo video:
https://www.youtube.com/watch?v=6jnO74Hd3fE
App usage demo:
https://www.youtube.com/watch?v=yNSkWW9n_dA
Setup tutorial:
https://www.youtube.com/watch?v=EHqi5CKSnmQ
Re: MyPi - New iOS App for Home Automation projects
Oooh! ooh! ooooh!
This is perfect. I'm looking for something like this in for my automation project, but, I need to mod the UI.
Would you consider sharing source?
This is perfect. I'm looking for something like this in for my automation project, but, I need to mod the UI.
Would you consider sharing source?
Re: MyPi - New iOS App for Home Automation projects
Hi,
I have an issue to run mypi_server.pyc
Python 3.4 is installed.
pi@RBPI ~ $ sudo python3 mypi_server.pyc
Traceback (most recent call last):
File "mypi_server.py", line 5, in <module>
ImportError: No module named 'RPi'
Looks like import RPi.GPIO as GPIO is not recognized
If I run it by python like:
pi@RBPiServer ~ $ sudo python mypi_server.pyc
RuntimeError: Bad magic number in .pyc file
Also an error.
Could you give a hint how to fix...Thx
I have an issue to run mypi_server.pyc
Python 3.4 is installed.
pi@RBPI ~ $ sudo python3 mypi_server.pyc
Traceback (most recent call last):
File "mypi_server.py", line 5, in <module>
ImportError: No module named 'RPi'
Looks like import RPi.GPIO as GPIO is not recognized
If I run it by python like:
pi@RBPiServer ~ $ sudo python mypi_server.pyc
RuntimeError: Bad magic number in .pyc file
Also an error.
Could you give a hint how to fix...Thx
Re: MyPi - New iOS App for Home Automation projects
Hi,
What Pi model & os do you have?
What Pi model & os do you have?
Re: MyPi - New iOS App for Home Automation projects
Hello KobiSnir,
Thx for your reply, still having the issue as discribed above.
To come back to your questions
Pi-Model = Pi2
OS =
PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian
If more info needed, just let me know...
Thx for your reply, still having the issue as discribed above.
To come back to your questions
Pi-Model = Pi2
OS =
PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian
If more info needed, just let me know...
Re: MyPi - New iOS App for Home Automation projects
I guess the GPIO package is missing/not installed.
You can install it by typing :
sudo apt-get install python3-rpi.gpio
It's recommended to update your os by typing:
sudo apt-get update
sudo apt-get upgrade
You can install it by typing :
sudo apt-get install python3-rpi.gpio
It's recommended to update your os by typing:
sudo apt-get update
sudo apt-get upgrade
Re: MyPi - New iOS App for Home Automation projects
Dear KobiSnir,
This GPIO Package was installed long time ago
Many updates and upgrades are done after that...
I have no other issues with using GPIO's.
There are now around 12 in use for several functions.
offcourse I checked and changed the mypi.cfg into free GPIO's
But I followed your instructions again.
Result stays the same
pi@RBPi ~ $ sudo python3 mypi_server.pyc
Traceback (most recent call last):
File "mypi_server.py", line 5, in <module>
import RPi.GPIO as GPIO
ImportError: No module named 'RPi'
Tried also:
pi@RBPi ~ $ sudo python mypi_server.pyc
RuntimeError: Bad magic number in .pyc file
Any other suggestions? Would be nice to have this running...Thx
This GPIO Package was installed long time ago
Many updates and upgrades are done after that...
I have no other issues with using GPIO's.
There are now around 12 in use for several functions.
offcourse I checked and changed the mypi.cfg into free GPIO's
But I followed your instructions again.
Result stays the same
pi@RBPi ~ $ sudo python3 mypi_server.pyc
Traceback (most recent call last):
File "mypi_server.py", line 5, in <module>
import RPi.GPIO as GPIO
ImportError: No module named 'RPi'
Tried also:
pi@RBPi ~ $ sudo python mypi_server.pyc
RuntimeError: Bad magic number in .pyc file
Any other suggestions? Would be nice to have this running...Thx
Re: MyPi - New iOS App for Home Automation projects
Please try to run python3 and type import RPi.GPIO as GPIO
If you will get the same error than it's not a problem with my script.

If you will get the same error than it's not a problem with my script.

Re: MyPi - New iOS App for Home Automation projects
Dear KobiSnir,
I am somehow a step further. Thx
Before installing PIP:
==================
pi@RBPi ~ $ python3
Python 3.4.2 (default, Aug 5 2016, 15:54:33)
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import RPi.GPIO as GPIO
>>>
KeyboardInterrupt
No isses with the RPi.GPIO as GPIO
But no connection possible with your app on iphone 6 IOS 9.3.4
By installing re-installing PIP I got a connection (Yes!) on a local network with the app:
I installed these:
sudo apt-get -y install python3-rpi.gpio
sudo apt-get install python3-pip
sudo pip3 install unicornhat
Almost there....But I see a lot of Disconnected/Connected in the log (See below)
and the I/O inputs turning on and off like crazy!
Seems not to be possible to add just one input and one output in the config to check if there is an issue.
What I do not like is that webiopi shows also other GPIO's going on and off as soon I start the app on the phone.
So I took to be sure a other pi2 with nothing hardwired connected on the pi, to be sure no outputs/inputs where send high/low where something physical. is connected.
pi@RBPi ~ $ sudo python3 mypi_server.pyc
MyPi TCP Server v1.4
Loading configuration file: /home/pi/mypi.cfg
Init GPIO Output pins
Init GPIO Input pins
Pin 7: level=0
Pin 13: level=0
Pin 15: level=0
Listening for incoming connections on Port 5000
Pin 7: level=1
Pin 13: level=1
Pin 15: level=1
Pin 7: level=0
10.0.0.13 Disconnected...
Connected to: 10.0.0.13
Pin 7: level=1
Pin 13: level=1
Pin 15: level=1
Pin 7: level=0
Pin 13: level=0
Pin 15: level=0
Pin 7: level=1
Pin 13: level=1
Pin 15: level=1
Connected to: 10.0.0.13
10.0.0.13 Disconnected...
Pin 7: level=0
Pin 13: level=0
Pin 15: level=0
10.0.0.13 Disconnected...
Connected to: 10.0.0.13
Pin 7: level=1
Pin 13: level=1
Pin 15: level=1
10.0.0.13 Disconnected...
Connected to: 10.0.0.13
Pin 7: level=0
Pin 13: level=0
Pin 15: level=0
Pin 7: level=1
Pin 13: level=1
Pin 15: level=1
10.0.0.13 Disconnected...
Connected to: 10.0.0.13
Pin 7: level=0
Pin 13: level=0
Pin 15: level=0
10.0.0.13 Disconnected...
Connected to: 10.0.0.13
When mypi_server.pyc in the terminal is stopped, the I/O' come back to normal state, that was easy to follow with webiopi
Any suggestions to make this work! Thx in advanced
I am somehow a step further. Thx
Before installing PIP:
==================
pi@RBPi ~ $ python3
Python 3.4.2 (default, Aug 5 2016, 15:54:33)
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import RPi.GPIO as GPIO
>>>
KeyboardInterrupt
No isses with the RPi.GPIO as GPIO
But no connection possible with your app on iphone 6 IOS 9.3.4
By installing re-installing PIP I got a connection (Yes!) on a local network with the app:
I installed these:
sudo apt-get -y install python3-rpi.gpio
sudo apt-get install python3-pip
sudo pip3 install unicornhat
Almost there....But I see a lot of Disconnected/Connected in the log (See below)
and the I/O inputs turning on and off like crazy!
Seems not to be possible to add just one input and one output in the config to check if there is an issue.
What I do not like is that webiopi shows also other GPIO's going on and off as soon I start the app on the phone.
So I took to be sure a other pi2 with nothing hardwired connected on the pi, to be sure no outputs/inputs where send high/low where something physical. is connected.
pi@RBPi ~ $ sudo python3 mypi_server.pyc
MyPi TCP Server v1.4
Loading configuration file: /home/pi/mypi.cfg
Init GPIO Output pins
Init GPIO Input pins
Pin 7: level=0
Pin 13: level=0
Pin 15: level=0
Listening for incoming connections on Port 5000
Pin 7: level=1
Pin 13: level=1
Pin 15: level=1
Pin 7: level=0
10.0.0.13 Disconnected...
Connected to: 10.0.0.13
Pin 7: level=1
Pin 13: level=1
Pin 15: level=1
Pin 7: level=0
Pin 13: level=0
Pin 15: level=0
Pin 7: level=1
Pin 13: level=1
Pin 15: level=1
Connected to: 10.0.0.13
10.0.0.13 Disconnected...
Pin 7: level=0
Pin 13: level=0
Pin 15: level=0
10.0.0.13 Disconnected...
Connected to: 10.0.0.13
Pin 7: level=1
Pin 13: level=1
Pin 15: level=1
10.0.0.13 Disconnected...
Connected to: 10.0.0.13
Pin 7: level=0
Pin 13: level=0
Pin 15: level=0
Pin 7: level=1
Pin 13: level=1
Pin 15: level=1
10.0.0.13 Disconnected...
Connected to: 10.0.0.13
Pin 7: level=0
Pin 13: level=0
Pin 15: level=0
10.0.0.13 Disconnected...
Connected to: 10.0.0.13
When mypi_server.pyc in the terminal is stopped, the I/O' come back to normal state, that was easy to follow with webiopi
Any suggestions to make this work! Thx in advanced
Re: MyPi - New iOS App for Home Automation projects
Disconnect message is normal when you quit the app or move it to background...
If you wish to control only one I/O you should change the pin numbers of OUT2 to OUT 8 (use the same as OUT1)
also change IN2 to IN8 (same as IN1).
I guess the reason your I/O goes like crazy is several packages trying to control the GPIO at the same time.
You should stop WebIOPi and see how it works...
If you wish to control only one I/O you should change the pin numbers of OUT2 to OUT 8 (use the same as OUT1)
also change IN2 to IN8 (same as IN1).
I guess the reason your I/O goes like crazy is several packages trying to control the GPIO at the same time.
You should stop WebIOPi and see how it works...
Re: MyPi - New iOS App for Home Automation projects
Hi,
Works perfect on my Pi 3 B ,
How can I Setup another 8 relays on the same Pi,
and what to do when I use another Pi ?
Works perfect on my Pi 3 B ,
How can I Setup another 8 relays on the same Pi,
and what to do when I use another Pi ?
Re: MyPi - New iOS App for Home Automation projects
You can not control 16 relays with the same Pi,
However you can control up to 4 devices with the iOS App,
8 relays each...
However you can control up to 4 devices with the iOS App,
8 relays each...
Re: MyPi - New iOS App for Home Automation projects
This is awesome!
Will this work with Siri or HomeKit?
Will this work with Siri or HomeKit?
Re: MyPi - New iOS App for Home Automation projects
I will support it in the next update...
Re: MyPi - New iOS App for Home Automation projects
Can't wait! Thanks!KobiSnir wrote:I will support it in the next update...
-
- Posts: 950
- Joined: Tue Dec 15, 2015 4:55 pm
- Location: Detroit, MI USA
Elescalador
Any chance your app can run a command line command? I have several things I can control just fine from an Android app "hot button", but the wife and kids cannot from their iPhones without typing in a ssh client - which really kills usefulness and I don't need them typing in command line anyway.
Robotics tips, hacks, book extras https://youtube.com/practicalrobotics
Re: Elescalador
Why don't you create a Safari shortcut on the iPhone (you could do the same with a URL on Android) with a specific URL that will connect to the Pi and have that trigger the command script on the Pi. You can use various controls and such like forcing that that connection come from your local LAN in order to be allowed all through the Apache configuration.ElEscalador wrote:Any chance your app can run a command line command? I have several things I can control just fine from an Android app "hot button", but the wife and kids cannot from their iPhones without typing in a ssh client - which really kills usefulness and I don't need them typing in command line anyway.
-
- Posts: 950
- Joined: Tue Dec 15, 2015 4:55 pm
- Location: Detroit, MI USA
Re: MyPi - New iOS App for Home Automation projects
That's an interesting idea. Would take a little more work/doing on my part....I really like how hot button handles it - does the ssh handshake, enters the command to run a program, and actually returns results to me.
Robotics tips, hacks, book extras https://youtube.com/practicalrobotics
Re: MyPi - New iOS App for Home Automation projects
That's a lot more overhead between the devices than loading a simple URL. You'd need to leverage a scripting language on the Pi in order to get it to kick off right away once the URL is loaded. You could also create your own interactive web page that could load different scripts and have the shortcut on the mobile devices load the main page.ElEscalador wrote:That's an interesting idea. Would take a little more work/doing on my part....I really like how hot button handles it - does the ssh handshake, enters the command to run a program, and actually returns results to me.
Re: MyPi - New iOS App for Home Automation projects
Interestingly, came across this just now: http://www.instructables.com/id/Simple- ... ur-Raspbe/
The piece on installing and configuring the web server might be just what you need.
The piece on installing and configuring the web server might be just what you need.
Re: MyPi - New iOS App for Home Automation projects
Great looking app, thanks for taking the time to make and share.
I am using my Raspberry Pi to open my communal apartment door. I have worked out the hardware side and wiring and wonder if this app can be used remotely so I can open the door (or trigger other relays) over the internet when I am not home?
I am using my Raspberry Pi to open my communal apartment door. I have worked out the hardware side and wiring and wonder if this app can be used remotely so I can open the door (or trigger other relays) over the internet when I am not home?
Re: MyPi - New iOS App for Home Automation projects
Hi, you can do this.
Create a DNS account and where you insert your IP in the app you should use 'yourdnsname.dnsprovider.'.
Create a DNS account and where you insert your IP in the app you should use 'yourdnsname.dnsprovider.'.
Re: MyPi - New iOS App for Home Automation projects
I'm trying to use MyPi on a Model B Rev 2 Raspberry Pi.
I'm getting an error running MyPi server "ValueError: The channel sent is invalid on a Raspberry Pi", which I believe is saying that this Model doesn't have as many GPIO pins as the script is written for. Any advice on how I can get this working?
Thanks,
Cameron
I'm getting an error running MyPi server "ValueError: The channel sent is invalid on a Raspberry Pi", which I believe is saying that this Model doesn't have as many GPIO pins as the script is written for. Any advice on how I can get this working?
Thanks,
Cameron
Re: MyPi - New iOS App for Home Automation projects
Had the same problem as kiwi_cam. Mine is an older Pi 1 Model B. Was working fine on my newer Pi 3
Error as follow:
pi@raspberrypi:~/mypi $ python3 mypi_server.pyc
MyPi TCP Server v1.5
Loading configuration file: /home/pi/mypi/mypi.cfg
Init GPIO Output pins
Init GPIO Input pins
Traceback (most recent call last):
File "mypi_server.py", line 77, in <module>
ValueError: The channel sent is invalid on a Raspberry Pi
Is it possible to share the mypi_server.py script so that we can do our own fix? Thanks
Error as follow:
pi@raspberrypi:~/mypi $ python3 mypi_server.pyc
MyPi TCP Server v1.5
Loading configuration file: /home/pi/mypi/mypi.cfg
Init GPIO Output pins
Init GPIO Input pins
Traceback (most recent call last):
File "mypi_server.py", line 77, in <module>
ValueError: The channel sent is invalid on a Raspberry Pi
Is it possible to share the mypi_server.py script so that we can do our own fix? Thanks
Re: MyPi - New iOS App for Home Automation projects
Received a reply from KobiSnir, the author of this great tool. I replicate his reply below to benefit Kiwi and others...
> Hi,
> You are getting this error since model 1 uses other pinout, you should
> edit mypi.cfg and replace the pin numbers to avaliable one...
For me, I got it working on my old RPi by remapping the input pins as follow in the mypi.cfg:
IN 1 -> pin 3
IN 2 -> pin 5
IN 3 -> pin 8
IN 4 -> pin 10
IN 5 -> pin 12
IN 6 -> pin 22
Works like a charm.
> Hi,
> You are getting this error since model 1 uses other pinout, you should
> edit mypi.cfg and replace the pin numbers to avaliable one...
For me, I got it working on my old RPi by remapping the input pins as follow in the mypi.cfg:
IN 1 -> pin 3
IN 2 -> pin 5
IN 3 -> pin 8
IN 4 -> pin 10
IN 5 -> pin 12
IN 6 -> pin 22
Works like a charm.