By the way, I have started hacking on the server side of the network protocol for this. I'll update the wiki page with this.
https://github.com/asokoloski/tacserv
It uses a Sqlite3 database to store the permissions. I don't know how our global member info is stored, but I assume it doesn't matter whether someone is a member or not when giving them access to a tool.
If I'm on completely the wrong track, can someone let me know? All I've done so far is "Get card permissions", "Add card", and "Check db sync".
Aaron
--
Gah, I knew as soon as I put up code, someone else would. Here's my python version, currently lacking the DB part.Incidentally, I've also heard of someone working on a PHP version and another Python one, but nobody else has actually put their code anywhere.
On Wednesday, January 16, 2013 10:04:44 AM UTC, Mark Steward wrote:Gah, I knew as soon as I put up code, someone else would. Here's my python version, currently lacking the DB part.Incidentally, I've also heard of someone working on a PHP version and another Python one, but nobody else has actually put their code anywhere.
Well, I was first :P
But we can use your code, as it seems more complete -- unless you feel like learning Go. The only thing I would recommend is using Sqlite -- I think it'll be much easier than trying to manually manage a json database file. Or is there another reason to use json?
--
That's what I was afraid someone would say, which is why I haven't got involved previously. It would have saved me some effort if you'd sent your email 10 days ago.
I don't mind what language it's in, as long as you're not the only person who speaks it. The database is transferred as json because it's transparent and easily parsed in any modern language. You can store it locally in any format you like (I was planning to use sqlite, too).
On Wed, Jan 16, 2013 at 10:30 AM, Mark Steward <marks...@gmail.com> wrote:
That's what I was afraid someone would say, which is why I haven't got involved previously. It would have saved me some effort if you'd sent your email 10 days ago.
My apologies for that. I had intended to get a more complete implementation before sending something out, but finally decided to just go for it. At least now nobody else will start another implementation.
I don't mind what language it's in, as long as you're not the only person who speaks it. The database is transferred as json because it's transparent and easily parsed in any modern language. You can store it locally in any format you like (I was planning to use sqlite, too).
I don't know how well known Go is amongst london hackspacers, so I'm inclined to just join you in your python implementation.
So when you say the DB is "transferred to json", and that can be stored locally, what do you mean? Why two copies? Forgive me if I'm ignorant of any existing hackspace software system conventions -- I've only been a member for about 2 weeks now.
The membership database is stored on turing.hackspace.org.uk, which is the VM we use for the website and has restricted access. The current plan is for the ACNode server to run in the space, allowing it to be fully functional even if the website's down. The "API" for getting access to membership data is currently to download the list of members, cards and permissions as a JSON object over HTTPS. We could in theory make a cut-down sqlite database available instead, but that moves the work to the server and makes it awkward if we want to use a different back-end on either side.
On Wed, Jan 16, 2013 at 11:20 AM, Mark Steward <marks...@gmail.com> wrote:
The membership database is stored on turing.hackspace.org.uk, which is the VM we use for the website and has restricted access. The current plan is for the ACNode server to run in the space, allowing it to be fully functional even if the website's down. The "API" for getting access to membership data is currently to download the list of members, cards and permissions as a JSON object over HTTPS. We could in theory make a cut-down sqlite database available instead, but that moves the work to the server and makes it awkward if we want to use a different back-end on either side.Ah, ok. That's the bit I was missing. So I'm going to explain the system as I understand it, and you tell me whether I'm right or not.
We have three separate types of databases. There is the main, canonical member database, which runs on turing. There is the ACNode server, which has a local database (sqlite), and periodically syncs with the main database on turing (using json). Then, each node has its own local database, which is really no more than a cache.
And I'm guessing the reason for not running ACNode on turing is just security? Although, if you say that the permissions are stored on turing as well, then it makes sense for the interface for updating those permissions to be on turing too. How do all the interfaces work?
If we have a pi terminal in each room anyway, for camera/speakers/mic and thin clients, does that then make the bulk of the ACNode system? A card reader can be added to each terminal, and a whole GUI can be designed to allow members to unlock the tools they want and haver permission to access. Logging, in a fashion similar to the laser cutter now, can occur on these terminals, and rather than just a hardware "borked" button, the member can state what the problem is, and whether it just needs to be maintained (calibration off), or taken out of action (live wire touching handle.)Forgive my electrical ignorance, but connections to any tool in the room, is simply a matter of running a pair of wires (heck, even just one and use the building's ground) down to a mains relay. That's <£5 for every additional tool.
And I'm guessing the reason for not running ACNode on turing is just security? Although, if you say that the permissions are stored on turing as well, then it makes sense for the interface for updating those permissions to be on turing too. How do all the interfaces work?
Mostly because we don't want everything to stop working if the internet connection or server are down. The interfaces for updating permissions and checking an individual card haven't been written yet, but they're pretty noddy - I was planning to knock them out this evening or tomorrow. Code for the website is currently here:
If we have a pi terminal in each room anyway, for camera/speakers/mic and thin clients, does that then make the bulk of the ACNode system? A card reader can be added to each terminal, and a whole GUI can be designed to allow members to unlock the tools they want and haver permission to access. Logging, in a fashion similar to the laser cutter now, can occur on these terminals, and rather than just a hardware "borked" button, the member can state what the problem is, and whether it just needs to be maintained (calibration off), or taken out of action (live wire touching handle.)Forgive my electrical ignorance, but connections to any tool in the room, is simply a matter of running a pair of wires (heck, even just one and use the building's ground) down to a mains relay. That's <£5 for every additional tool.
--
Ciarán
--
--
If we have a pi terminal in each room anyway, for camera/speakers/mic and thin clients, does that then make the bulk of the ACNode system? A card reader can be added to each terminal, and a whole GUI can be designed to allow members to unlock the tools they want and haver permission to access. Logging, in a fashion similar to the laser cutter now, can occur on these terminals, and rather than just a hardware "borked" button, the member can state what the problem is, and whether it just needs to be maintained (calibration off), or taken out of action (live wire touching handle.)Forgive my electrical ignorance, but connections to any tool in the room, is simply a matter of running a pair of wires (heck, even just one and use the building's ground) down to a mains relay. That's <£5 for every additional tool.
--
--
--
I think the duplication of effort is stemming out of insufficient communication/documentation on what's been done/needs to be done on the server-side.
Looking on the page for the project there is a summary of requirements here.
The client side is very well documented though Sol's proposal that's linked of the main page, and the physical acnode prototype is ready AFAIK
There is absolutely nothing about what's being done on the "server" side and I think this is leading to the confusion.
Eager to get the ACnode project going I've offered to help out, but I and1 started writing the backend (CodeIgniter PHP) as per Sol's spec I was informed that Ms7821 has already wrote a substantial part.
(On my user-page) revision as of 01:11, 30 November 2012:
Status: On hold pending Ms7821's solution that he has already started working on
Access Control Server codename: ACServer the Tool Access Control project.
Ms7821 can you please document what you have done, what needs to be done, and what people interested can help with. Not everyone knows Python and documentation should really be code agnostic to explain how the units in the proposed system interact!
--
I agree we need some evidence of testing before we can claim it's finished, but why is the load relevant? Surely the worst that can happen is it triggers the relay repeatedly (as might happen with a loose connection), at which point the power should be turned off.
Should there be some kind of debounce or protection on the relay?
Mark
--
Could be solved by a Solid state relay ?
--