Page 1 of 1

Possible New Cross Platform Client

Posted: Fri Jul 11, 2008 8:50 pm
by AlienTesticle
the following information is to see if something like this is needed by enough people. I know there is a windows client under dotnet and a c++ using QT that's cross platform, but that one didn't not work well for me. If I make this for just me... it would not be very USER friendly, so I would need lots of input on the look and feel during development.

Since I have been learning python/wxpython while converting some projects from perl and c. And with a need for a fast client to mess with zoneminder settings on a more global scale when setting up a server. Adjusting 24 cameras with the web gui can get tedious.

I started messing around and found I could do some stuff pretty easy in python. And if I am careful it should be able to be cross platform.


What I personally need to be able to:
  • Add cameras and change all settings
    backup camera settings
    archive captures to dvd
    activate local actions on events (alarms/lights/led marque)
    all the normal monitoring options of other similar programs (need to figure out which options are important)
How should I do it?:
  • my testing has used ssh to tunnel to the server to directly access the mysql and directories data. (kinda working)
    but should we use some kind of perl/php agents to hide physical structure to allow future changes to less likely break things. (totally future idea)

------

If this is of interest, what features would you want. I have not worked with any other non zoneminder clients so there may be many features I am sure I am clueless about.

should this be something on the wiki, like a list of cool client features and which clients support it so client developers can know what people would like. Maybe a feature rating for prioritizing

The order of development would be windows first then linux. I do not have access to a OSX box so no testing would be done there. I am using python 2.5 with wxWidgets 2.8 and C if needed to speed anything up. There is no code at the moment that would be usable to anybody until I stabilize which libs I want to use.

Thanks in advance for any input you might have

Posted: Fri Jul 11, 2008 9:28 pm
by Lee Sharp
I would be using the Linux client now if it supported authentication. That is kind of a deal breaker. :)

Posted: Fri Jul 11, 2008 10:49 pm
by AlienTesticle
Lee Sharp wrote:I would be using the Linux client now if it supported authentication. That is kind of a deal breaker. :)
Well. It wouldn't be hard for it to check the sqldb to validate a person and give them the same permissions as the webgui.

But the way I have it setup now, Beyond just streaming, it will need access to the raw sql data and directory structure of the stored images which I do from a windows box through ssh to the linux server. I may not be testing the client run from server since all my zoneminder boxes have no gui.

coding goes fast then slow then fast depending on issues. So when I get some testing code with authentication, maybe you can test that aspect and give input.

Posted: Sat Jul 12, 2008 6:50 pm
by Lee Sharp
More than willing. PM me when you have something.

Posted: Mon Sep 22, 2008 7:23 pm
by ahagadorn
I'm working on a Java Swing client with full 2-way communication. It posts HTTP requests to the ZM server which acts on the requests and returns XML data.

It supports (actually, requires) authentication which goes through the HTTP post and authenticates against the database. All of the transactions on the server side check to see if the client is logged in every time they are accessed. State is maintained via PHP sessions, similar to many other PHP applications that require authentication.

I should have it ready for anyone to download and test in a week or so. It requires two additional PHP scripts on the server side.

It has a lot of other features, including the ability to view and delete events and near real-time (~15 seconds) notification of new events. Lots of other stuff too.

Andy

Posted: Mon Sep 22, 2008 8:05 pm
by timcraig
ahagadorn wrote:It posts HTTP requests to the ZM server which acts on the requests and returns XML data.
ahagadorn, it sounds like you built a "webservice" (forgive me using a hyped buzzword) on top of Zoneminder. That alone would be a great contribution to Zoneminder. Being able to access the ZM database through a webservice will be very helpful for people who are developing front-end clients. Instead of having to scrape the HTML from the webui or accessing the database directly, a front-end developer just needs to communicate webservice.

Posted: Mon Sep 22, 2008 8:32 pm
by ahagadorn
timcraig wrote:
ahagadorn wrote:It posts HTTP requests to the ZM server which acts on the requests and returns XML data.
ahagadorn, it sounds like you built a "webservice" (forgive me using a hyped buzzword) on top of Zoneminder. That alone would be a great contribution to Zoneminder. Being able to access the ZM database through a webservice will be very helpful for people who are developing front-end clients. Instead of having to scrape the HTML from the webui or accessing the database directly, a front-end developer just needs to communicate webservice.
Yes, it is essentially a web service. There is a "transaction" method on the Java side that creates HTML POST requests to the server service, and processes the XML replies into Java objects which are used by the client. Status is always returned, and if the user session on the server side is not valid, a "Not logged in" status is returned which causes the client to prompt for login. You always have to send the "login" transaction first, along with the user's username and password to establish a session, otherwise nothing gets returned except "Not logged in".

The transaction method must send an "action" with each request to determine what kind of processing is required on the server side. For example, the get_data action returns the list of monitors and a bunch of information from the database about each monitor.

The server side is language independent since it accepts standard POSTs and returns standard XML, but I am currently only using the Java version of the client side transaction interface. At a minimum, all one would have to do is be able to send HTML POST requests, and to process XML responses into usable objects. I have done this in both PHP and PERL for other projects - both have some nice modules for accomplishing these tasks.

I am deliberately avoiding the ability to process arbitrary SQL statements for security reasons which should be obvious, so each transaction will always have a specific action associated with it that returns specific data.

Anyway, I will have more info soon. I'd give out the URL for the service so people could play with it, but I'd have to give valid username/password and I feel funny about giving the public access to viewing monitors, primarily because my wife would strangle me.

Andy

Posted: Fri Sep 26, 2008 10:05 am
by zoneminder
You might want to have a look at the 1.24.0 preview version. The web gui has a lot more ajaxy type stuff in so a lot of requests are supported natively now (look in the ajax subdir). Currently the results are returned in json format rather than xml but if you need to add further requests or actions that would be the place to put them.