0

My project is a home security system. Until now everything is embedded on one device. But I would like to use multiple Pi's, for example RFID reader on different spots without the need of cables.

The current project uses SQLite to store variables like if the system is armed, user's passcode (hashed) etc.

So for example Im using a RPi A model with the RFID reader set, is checking my tag ID and holds my ID variable. Now the system needs to authenticate that.

1 way is to somehow use netSQLite, SQLiteServer or even using SMB to mount the database on the Pi to do the authentication. If the authentication pass, then the "Armed" value on the database will be False. In the meanwhile the central unit/RPi, has to keep looping and checking if the "Armed" value has been changes so it can disable the sensors. But keep looping for something will may happen once a while I think is a waste of resources, right?

Another way which is easy on words but, a hell to implement it is to somehow call the python functions that are located on the central unit from the remote Pi. For example theres is an "Armed(Passcode):" function with input the passcode, the functions makes the authentication, and if the system is armed will disarmed it and vice versa. No looping is required here, but how is this concept going to be implemented?

So what do you think, Im still on the Research & Design of this project, so any suggestions will be great.

0

Look into either Pyro for Python: http://pythonhosted.org//Pyro4/

Which lets you execute function and python code remotely from other PIs running pyro.

Also there is Websocket WAMP Autobahn Python: http://autobahn.ws/python/wamp/programming.html

Which is similar to Pyro but uses websocket protocol.

Cheers

0

Calling remote functions is not hard;

ssh remoteHost remoteCommand

There are many other options but that's the most secure and simple

  • So, Im calling the python file using ssh and I just passing my arguments.. For example, SSH -> pythonfile.py myFunction(Passcode) and the rest will follow up on the central unit, right? – Bobys May 3 '15 at 20:31
  • Close you don't call the function directly but use python args , so 'ssh 192.168.0.111 /my/file.py -p PASS -o OPTION' – user1133275 May 3 '15 at 20:35
  • Sounds pretty easy and it seems its going to do the job. Would be better to have the ssh session active forever and just call my functions? Instead of opening and closing the session? What Im thinking heres is will probably take some time to open the session right? Do python support something like that? Cause everything will happen inside a python script. – Bobys May 3 '15 at 20:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.