ADICON Support Forum Applied Digital, Inc.
Page 1 of 2 12>
Topic Options
#22047 - 08/21/10 07:13 PM Python
bvnoldguy Offline
journeyman


Registered: 07/20/10
Posts: 50
I am converting my 2002 VB-6 Hyena project to Python.
---
I would like to start a Python forum thread that is platform agnostic.
- I test on Windows and Linux (CentOS and Fedora) and would like to add OS-X, but I have no MAC platform.
---
It is my intention to use Google Docs and Google Code as a publishing mechanism.
---
Any thoughts?

Top
#22048 - 08/21/10 10:32 PM Re: Python [Re: bvnoldguy]
bvnoldguy Offline
journeyman


Registered: 07/20/10
Posts: 50
I've started a open Python project home page on Google sites by the name "bvnpantherproject". Yes, it is very rough edged - I'm still learning.
Top
#22054 - 08/24/10 01:31 AM Re: Python [Re: bvnoldguy]
bvnoldguy Offline
journeyman


Registered: 07/20/10
Posts: 50
I have a python version of XALIB, that does the same things the XALIB "C" version does, that I can contribute. I am using it in my pxa_server project which supports 8 concurrent users with less than 7% of a single ATOM 1.6 gHz processor. Incredibly faster than VB and less than 10% of the latency.
---
I am working on my Panther project now - the client side, replacing the VB-6 WinLeopard. Allows full access to wxGlade and wxPython design capabilities.

Top
#22063 - 08/25/10 07:37 PM Re: Python [Re: bvnoldguy]
wesmo Offline
newbie


Registered: 08/17/10
Posts: 10
Loc: Down Under
Can you post a direct link to your project and check that public read only permissions are enabled on the repository. I can't seem to find the project using the name given
Top
#22072 - 08/28/10 06:31 PM Re: Python [Re: wesmo]
bvnoldguy Offline
journeyman


Registered: 07/20/10
Posts: 50
I'm still trying to hook up subversion to Google code so that I can maintain a public code base for my own project. :-(
---
I am hoping to start something broader of this forum.
---
Meanwhile, I can put the code into a compressed tarball and Email it to you.
---
My Acer AR1600 Ocelot/IP server ($170 US) is now working. I may go back to the Foxconn ($250 US). Depends on other things.
---
I am in the process of figuring out how to auto-logon a second user as a VNC server. If I can figure that out, I can access the client GUI from an Android platform running the VNC app. And, presto, a pocket form of the ADI Leopard.
---
I already have a client with a CentOS server and Windows client machines, running what appears to be a Windows applet; but, in fact is a VNC image of a CentOS userid (using a reduced screen size, of course).

Top
#22073 - 08/28/10 06:50 PM Re: Python [Re: bvnoldguy]
bvnoldguy Offline
journeyman


Registered: 07/20/10
Posts: 50
If you could clue me in as to the basics, I'll get to it a lot faster. All the tutorials, that I have, focus on setting up a local repo. Do you know of one targeted to Google code, I can read that.
---
I can put the project documents up on Google docs. Got that working this week, but haven't done the whole job.
---
PS the compressed tarball is <50kB - no instructions. The module cpuxa.py is the equivalent to cpuxa.c, but has no Inet support - just serial and Ocelot support. pxa_cpuxa.py is a "long running task" thread wrapper for it, and pxa_inetserver.py is long running task for the internet support (they are asychronous). pxa_wx.py and pxa_gui.py are the the GUI thread. And pxa_main.py runs the whole thing. pxa_wx.py is generated by wxGlade, and I have included the wxGlade xml source and the icon library.

Top
#22074 - 08/28/10 07:40 PM Re: Python [Re: bvnoldguy]
bvnoldguy Offline
journeyman


Registered: 07/20/10
Posts: 50
Errk. I am using my grandson's google code and mucking it up :-(
"https://carlsgame.googlecode.com/svn/trunk/panther is cpuxa.py"
---
Eventually I'll catch on

Top
#22076 - 08/28/10 08:11 PM Re: Python [Re: bvnoldguy]
bvnoldguy Offline
journeyman


Registered: 07/20/10
Posts: 50
"svn checkout http://carlsgame.googlecode.com/svn/trunk carlsgame-read-only" seems to work - caution! it is accompanied with a lot of test clutter. I'll do better when I get the hang of this.
Top
#22077 - 08/28/10 10:30 PM Re: Python [Re: bvnoldguy]
bvnoldguy Offline
journeyman


Registered: 07/20/10
Posts: 50
Changed main folder name. - changed "trunk" to "trunc" try
"svn checkout http://carlsgame.googlecode.com/svn/trunc carlsgame-read-only"
it works on my wife's machine.
---
I just dumped all the source and documents out there - higgledy piggledy
---
Oh well! A job poorly done, is a job half done. - or is that just half baked?


Edited by bvnoldguy (08/28/10 10:34 PM)

Top
#22080 - 08/29/10 05:37 AM Re: Python [Re: bvnoldguy]
bvnoldguy Offline
journeyman


Registered: 07/20/10
Posts: 50
Have found a number of bugs in my code. Haven't figured out how to put the code under configuration management. Thus, I can't commit my changes to the repository. Best I can do for the moment is blast out a whole new baseline.
Top
#22083 - 08/29/10 10:17 AM Re: Python [Re: bvnoldguy]
bvnoldguy Offline
journeyman


Registered: 07/20/10
Posts: 50
I'm going to have to RTFM for a while. I think the bulk of the problem is not with SVN per se' but with how my "working copy" is organized. I share the code between 3 hosts (with platforms of: Windows, Fedora, and CentOS).
---
The bugs were in pxa_main, pxa_gui, pxa_cpuxa, and pxa_inetserver. Not in cpuxa, which seems quite stable. If anybody wants to extend cpuxa to a XALIB / cpuxad style of application, then there should be a non-threaded "gbl" for it. That means that it should become an independent project and provide the community with both threaded and non-threaded "gbl".
---
I find that Python (on Windows) easier to use than VB. It also has better community support, both tech and libraries.
---
If anybody is interested in how to set up a Python development environment on Windows, let me know. I'll document how it's done and where to get the software (it's open as in OSF) to support the Ocelot and Leopard.
---
Any thoughts?

Top
#22088 - 08/30/10 07:29 PM Re: Python [Re: bvnoldguy]
wesmo Offline
newbie


Registered: 08/17/10
Posts: 10
Loc: Down Under
I'll be following your project but I'm stuck with a spot of leopard interface design and a home theatre installation atm, I'll definately get back to you when I get a chance to look at the code.
Top
#22089 - 08/31/10 12:25 AM Re: Python [Re: wesmo]
bvnoldguy Offline
journeyman


Registered: 07/20/10
Posts: 50
Roger that. Am starting a new thread "contractor's toolbox" that you might be interested in. Still RTFM for subversion with Google Code.
---
FYI: my HT, HVAC, Water Feature management, lighting, and security automations have been running for 8 years on a single Ocelot. No software errors, 65 revisions to the functionality.
--- TTFN


Edited by bvnoldguy (08/31/10 01:29 AM)
Edit Reason: added relevent info

Top
#22125 - 09/13/10 06:07 PM Re: Python [Re: bvnoldguy]
bvnoldguy Offline
journeyman


Registered: 07/20/10
Posts: 50
I still would like to help start a more collaborative project for Python.
---
My code is at http://adicon-panther.googlecode.com
---
go to source | browse | trunk and it's sub-directories
---
It's working. All docs in OpenOffice format: http://www.openoffice.org
---
to download use:
- "cd" to an empty working directory
- svn checkout http://adicon-panther.googlecode.com/svn/trunk/adicon-panther-read-only
---
The PDF's of these files are on //docs.google.com under my name "brucevannorman"


Edited by bvnoldguy (09/13/10 11:53 PM)
Edit Reason: uploaded PDF's

Top
#22126 - 09/14/10 12:09 AM Re: Python [Re: bvnoldguy]
bvnoldguy Offline
journeyman


Registered: 07/20/10
Posts: 50
Windows users can get a free svn client from either //www.silksvn.com or //www.collab.net
Top
#22127 - 09/20/10 05:54 PM Re: Python [Re: bvnoldguy]
bvnoldguy Offline
journeyman


Registered: 07/20/10
Posts: 50
Just updated Google code repository.
---
Found bug in pxa_server, when client goes into suspend mode (power state S3), the socket code doesn't simply timeout, it gets "host not found". Problem is fixed.
---
The Python server uses about 10% of VB resources and delivers significantly more responsive service. Glad I junked VB.
---
Added time stamp to server log. Typically have 4 days in log. Nice to know when the "burp" occurred.
---
pxa_client finished for now. I find that doing the GUI's with wxGlade, I have more, but smaller, screens. Mostly due to radio buttons and check_boxes. Also using color. Most client screens are < 20 lines of code (mostly comments) the hairiest (HVAC) is < 50 lines and mostly comments. Boy are these easy to knock out.
---
Time to get back to work on C++Max (No VB here :-)

Top
#22128 - 09/25/10 05:34 PM Re: Python [Re: bvnoldguy]
bvnoldguy Offline
journeyman


Registered: 07/20/10
Posts: 50
FYI pxa means Python XAlib. The Python implementation of the venerable XALIB.
---
Something weird is going on with pxa_server. It takes about 200 hours to show up. The number of allocated threads is not realistic (in excess of 20). Have added an "info" button to trigger a dump-to-log of the internal state for all defined INET threads. Hope this shines some light on the topic.
---
pxa_client is really making progress. Have lots and lots of much smaller screens. 320 x 240 is really too big to sit on the screen for long periods of time. Radio and check boxes (instead of buttons) reduce the clutter significantly.
---
I can generate the wxPython code from the wxGlade xml file with a bit of help. I should be able to fully automate application screen development with the extra symbol scope data that the C++Max macro assembler generates. The contractor's toolbox is looking more and more real.
---
I'll update the Google Code stuff when I figure the pxa_server behavior out. It doesn't crash; but it might after a few years of continuous operation.
---
I have a mean-time-to-failure target of several years without a re-boot - it's running on Red Hat Enterprise Linux 5.
---
The house server is a ~$140 headless Foxconn SFF-4 with an APC UPS. On battery power: 30 minutes + 5 min for shutdown. Note: It's running more than just the pxa_server app. (Samba, NFS, NTP, Torrent, & FTP). I've added a bit over 4tB of Seagate SATA-2 HDD.

Top
#22130 - 09/27/10 12:49 PM Re: Python [Re: bvnoldguy]
bvnoldguy Offline
journeyman


Registered: 07/20/10
Posts: 50
Think I found the pxa_server problem, but too early to be sure. I think it is a design problem - which I have fixed. It falls out of the full-duplex nature of the CPUXA/IP protocol. If nothing changes, then no data should be sent; but, what happens if a host suspends? I have added a new transaction (pxa_server originated) that is sent, when no change has happened in the last 5 min. pxa_client returns the transaction (if it is awake proof-of-life). If not received by the server with 10 sec. the client is presumed dead.
---
On the other hand, if pxa_client has not heard something from pxa_server for the past 6 min, then pxa_server is presumed dead.
---
Also, the pxa_client folder is becoming impossible to navigate, too many screens. Have created a sub-folder named "screens" to hold them (86 files at the present moment).


Edited by bvnoldguy (09/27/10 04:41 PM)
Edit Reason: restored a word

Top
#22131 - 09/27/10 04:25 PM Re: Python [Re: bvnoldguy]
bvnoldguy Offline
journeyman


Registered: 07/20/10
Posts: 50
I've fully depreciated all my VB code :-)
pxa_client is now the default on all my hosts - Linux and Windows platforms alike.
---
Figuring out a button that doubles as an indicator is a major breakthrough. I used a dark blue, bold, foreground that matches the washed-out blue background used for all user input widgets. The background colors are my standard True / False indicator colors. It's not the esthetically, most pleasing choice, but the intent is visibly obvious.
---
Even though I haven't created the automation tools, I spend a lot more time in wxGlade than in the Python application code. This is a very good sign.
---
Also the amount of display real estate used by pxa_client screens is shrinking. The primary contributors are color, the active & passive radio-boxes, and the button/indicator widget. I chose to use a toggle concept for the button/indicator and it is quite natural. My wife was trying the latest pxa_client out (she hates new technical things) and that is what she thought they were - so I changed the code to match :-)
---
The VB "WinLeopard" is positively wasteful of screen real estate. Who would have thunk that I, the old propellor head, would actually build something that was pleasing to the eye and natural to use?


Edited by bvnoldguy (09/27/10 04:37 PM)
Edit Reason: punctuation

Top
#22133 - 09/28/10 08:25 AM Re: Python [Re: bvnoldguy]
bvnoldguy Offline
journeyman


Registered: 07/20/10
Posts: 50
"The primary cause of new problems is previous repairs"
---
Fixes working fine - well sort of. When a pxa_client wakes from suspend (ACPI S3 --> S0), it does an INET restart. The problem is that network services have not been fully restored. Thus "no connection to service" and the client issues an internal "Halt". Have added a 30 second delay for the INET restart. Hope that works.
---
Also have added a guard to the CPUXA thread logic to not ask for module/point, X-10, and timer status when there are no "active" threads running at the moment (they are all waiting for connection to a pxa_client). Not sure why. Just a bit over sensitive to the limits of nvram.
---
Some silliness: based on current statistics, baring unforeseen situations, pxa_server can run for 200 years without a re-start. Don't think I can test this condition :-)

Top
Page 1 of 2 12>


Moderator:  Dan Smith, Monte G, ADI Tech Support, Guy Lavoie 
Hop to:
Who's Online
0 registered and 50 anonymous users online.
Recent Posts
am pm
by edr
05/05/17 05:25 PM
Shout Box

Newest Members
brigiel, vevevie, zhutree, 416, saiqul
3003 Registered Users
Forum Stats
3003 Members
19 Forums
3999 Topics
23425 Posts

Max Online: 132 @ 11/13/16 10:07 AM
May
Su M Tu W Th F Sa
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31