XPD: open-source keywin e-bike lab replacement

Get all your technical information about electric bikes here.
User avatar
Arlo1   100 GW

100 GW
Posts: 8356
Joined: Apr 26 2009 10:36pm
Location: Nanaimo
Contact:

Re: XPD: open-source keywin e-bike lab replacement

Post by Arlo1 » Jun 03 2011 9:11am

SO I got this all working.
I was wondering can we up the regen limit??? And how hard would it be to change some options? As well can we have 24fets and 36 fets as options?
Very cool on the Current limits :mrgreen:
Thanks very much for doing this!
Does your project need a high performance motor drive, battery charger or other power electronics developed? Let's talk!
www.powerdesigns.ca
Leaf motor controller build. http://endless-sphere.com/forums/viewto ... 27#p963227
YSR build http://www.youtube.com/watch?v=BRo8r5g4NBg
Never above 4.2v never below 2.7v EVER!!!
Support me on Patreon. https://www.patreon.com/user/posts?u=6842045
http://www.undergroundelectrics.ca/

User avatar
Floont   1 kW

1 kW
Posts: 439
Joined: Jul 20 2010 1:15pm
Location: Tampa, Florida

Re: XPD: open-source keywin e-bike lab replacement

Post by Floont » Jun 03 2011 10:03pm

anpaza wrote:...
Floont wrote: I'm looking forward to giving this a try. However, right now I'm running 132V to a Lyen 24FET controller, so I'm unsure what values to use in your program in its current state.

Is this a stock controller, or self-made?
This controller I purchased from Lyen, a well respected member our Endless-Sphere family.
anpaza wrote:What program are you using to program it?
I use a Lyen version of Keywin which I hacked with a hex editor to get the values I needed into the controller. It works OK, but it is a hacked binary file and has its limitations.
anpaza wrote: If it is a widespread model, you can give me a link to the modified "E-Bike Lab", I will reverse-engineer the formulas like I did for EB206-218.
24 FET 10000Watts Muscular High Current LYEN Controller $299
anpaza wrote:However, if it is self-made from any stock controller by just adding extra FETs and modifying some resistor values (including the shunt), you may tweak the file xpdm/infineon.py and add your own controller. For example, let's suppose you modified an EB212 by adding 12 extra FETs and chopping down the battery voltage measuring resistor twice. In this case you would copy the section starting with <<"Name" : "EB212",>> and copy it to the end of the ControllerTypeDesc array, like this:

Code: Select all

    {
        "Name"             : "EB224-floont",
        "PhaseCurrent2Raw" : lambda I: I * 0.625 - 7,
        "Raw2PhaseCurrent" : lambda V: 11.2 + (1.6 * V),
        "BattCurrent2Raw"  : lambda I: I * 0.624 - 1.5,
        "Raw2BattCurrent"  : lambda V: 2.404 + (1.603 * V),
        "Voltage2Raw"      : lambda U: U * 3.283,
        "Raw2Voltage"      : lambda V: V / 3.283,
    },
As an engineer, I got into programming decades ago, but times have changed rapidly and I have not kept up. So right now, although I can read your code, performing a modification and recompiling is currently beyond my skill level.
anpaza wrote:...Perhaps, I can add support for a user config file (in "C:\Documents and Settings\%User%\My Documents\xpd") that adds additional controller types. With it you may easily upgrade XPD without having to modify its source code every time.
Now, that is a GREAT idea! We could have a folder containing our custom config.

We are so impressed that you have done us this service to create this open source program and are listening and responding to our requests and comments. How can we repay you?

FA[/size]
Build 2: (present build): Rear x5304 on full suspension Mongoose, 127v 30s3p 10aH Turnigy Lipo, Lyen 24FET 100amp controller, CA2.2, 26" Hookworm front, 26" Crazy Bob rear, 203mm disc brakes, Airzound horn, twin Blaze 2 watt front lights - BURNED
All my posts on this site are licensed under the Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 License

User avatar
NeilP   10 GW

10 GW
Posts: 4968
Joined: Nov 27 2010 3:18pm
Location: 49.17303, -2.05354 Jersey, Europe
Contact:

Re: XPD: open-source keywin e-bike lab replacement

Post by NeilP » Jun 04 2011 2:26am

Doctorbass wrote:I am browsing it right now... and again... THIS IS AN EXCELELNT WORK!!

Something you could add is the version that would make it perfect is displaying the version.. ex: V1.0 with the date and also the possibility for those who modified the R12 to select a factor or directly the resistor they modded so that the EBS HV and LVC value to allow higher selectable value would be automaticaly rescaled!! and the value selectable would be coresponding to the right active value!

ex. while the max EBS limit voltage is 77.7V with the OEM resistor value of around 1200ohms , we could be able to select or enter a new resistor value... or scale factor that correspond to the R12 mod so when we select the EBS, LVC or otehr affected parameters, they would be displayed with the true value! :D


Doc

I agree too, excellent work, and also second what DoctorBass says about the R12 mod scalability.
anpaza wrote:
Floont wrote:
I hope this is not very complex to understand for the average user that does controller mods, thus I don't have to write a user interface for all this stuff :D

Perhaps, I can add support for a user config file (in "C:\Documents and Settings\%User%\My Documents\xpd") that adds additional controller types. With it you may easily upgrade XPD without having to modify its source code every time.
It is not that it is so complicated to understand the changing of the formulas, and the logic behind that, it is the thought if adjusting the actual program code, compiling and all that stuff to adjust the program that would put me off, and the fear of screwing something else up...tinkering with stuff we do not really fully understand, etc.
So a user interface would be nice, but changing a config file for each controller type would be do able. OK, still the chance of putting in the wrong config settings, but at least the basic app would not be screwed with

I did read somewhere in the original documentation that one reason for this project was to make it possible to run the software from a portable device ( phone? ) for on the go re programming.
I see from your comments above that this is not yet possible. Any thoughts on what devices would be needed to run this as a mobile application ? Any ideas on what would be the most suitable platform? Win Mobile? Android? iPhone?
:) Only Irish coffee provides in a glass all four essential food groups: alcohol, caffeine, sugar, and fat :)

User avatar
anpaza   10 W

10 W
Posts: 69
Joined: Dec 07 2010 5:24pm

Re: XPD: open-source keywin e-bike lab replacement

Post by anpaza » Jun 04 2011 3:27am

Floont wrote:
anpaza wrote:Is this a stock controller, or self-made?
This controller I purchased from Lyen, a well respected member our Endless-Sphere family.
Heh, you tell me! Mine is from Lyen as well :) I just wasn't aware he sells 24-FET and 36-FET controllers.
Floont wrote:
anpaza wrote:What program are you using to program it?
I use a Lyen version of Keywin which I hacked with a hex editor to get the values I needed into the controller. It works OK, but it is a hacked binary file and has its limitations.
Okay, if you can't share the program, can you at least tell me what's the shunt value on the 24-FET (and would be cool if somebody tells about the 36-FET too) compared to some known controller?

I guess it would be better if I will post a simple form which one may fill to get a new Infineon-based controller into XPD.
  • Controller model name (e.g. "EB212", "EB212/144V" etc).
  • Controller shunt resistance, as compared to some model already in XPD (e.g. "the shunt is twice smaller than in EB212").
  • Maximum voltage value controller can measure (e.g. for LVC or regen - 77.7V standard value).
This data is basically enough to write a new controller description in XPD.
Floont wrote: As an engineer, I got into programming decades ago, but times have changed rapidly and I have not kept up. So right now, although I can read your code, performing a modification and recompiling is currently beyond my skill level.
The joy of Python is that you don't have to recompile anything! Just change the text file (the source code), save it, and run the program - the changes will take effect immediately. The Python interpreter reads all source files at startup, then just interprets them.

User avatar
NeilP   10 GW

10 GW
Posts: 4968
Joined: Nov 27 2010 3:18pm
Location: 49.17303, -2.05354 Jersey, Europe
Contact:

Re: XPD: open-source keywin e-bike lab replacement

Post by NeilP » Jun 04 2011 3:37am

Well if you got a controller from him, check your paperwork /e-mails/PM's from him, and you may find a link to the Lyen.exe software that he had modified..if not PM him and he may send you a link, since you already have a controller from him. Especially if he is aware of what you are trying to achieve, he may even be able to give more help ??
Last edited by NeilP on Jun 04 2011 3:44am, edited 1 time in total.
:) Only Irish coffee provides in a glass all four essential food groups: alcohol, caffeine, sugar, and fat :)

User avatar
anpaza   10 W

10 W
Posts: 69
Joined: Dec 07 2010 5:24pm

Re: XPD: open-source keywin e-bike lab replacement

Post by anpaza » Jun 04 2011 3:42am

NeilP wrote: I did read somewhere in the original documentation that one reason for this project was to make it possible to run the software from a portable device ( phone? ) for on the go re programming.
I see from your comments above that this is not yet possible. Any thoughts on what devices would be needed to run this as a mobile application ? Any ideas on what would be the most suitable platform? Win Mobile? Android? iPhone?
The easiest mobile platform to port XPD to would be Maemo/Meego (and perhaps HP/Palm WebOS), because these are full-featured Linux-based platforms (only a few tweaks to user interface would be required, to better fit the small device screen). But since this is not a widespread platform (it runs mostly on Nokia N800, N810, N900 and the upcoming N950, also (Meego) on some netbooks), I'm not pushing this project very hard, since perhaps I'm one of the few people in the world that owns a Maemo and Infineon device at the same time :)

The next platform I'm keeping an eye on is Android, which is Linux-based as well, but since Android uses a non-standard graphics subsystem, the GUI of the XPD will have to be completely rewritten (unless some kind soul ports PyGTK to Android). So this project would require a substantial effort, I'm leaving it for later.
NeilP wrote:Well if you got a controller from him, check your paperwork /e-mails from him, and you may find a link to the Lyen.exe software that he had modified..
Oh my, indeed I have it. I did not observed he has EB224/236 models in the list. Usually I'm using the "stock" "e-bike lab", because the Lyen version for some reason doesn't load the settings file which were saved seconds ago in the same program :)

Ok, now I have everything needed to add EB224/236.

User avatar
Philistine   1 MW

1 MW
Posts: 1732
Joined: Aug 15 2010 7:33am

Re: XPD: open-source keywin e-bike lab replacement

Post by Philistine » Jun 04 2011 3:52am

Thanks for all the work on the program BTW, great contribution to make.
Okay, if you can't share the program, can you at least tell me what's the shunt value on the 24-FET (and would be cool if somebody tells about the 36-FET too) compared to some known controller?
Lyen told me to program the shunt value for my CA for my Lyen 24 Fet as 1mohm, and it seems accurate for me.

Like others, I would love it if we could program the regen limit to a higher voltage (to save me having to R12 mod), but I understand this is limited not as an aribtrary programming thing, but rather due to a function of the R12 divider, so it can't be programmed around?

\

User avatar
NeilP   10 GW

10 GW
Posts: 4968
Joined: Nov 27 2010 3:18pm
Location: 49.17303, -2.05354 Jersey, Europe
Contact:

Re: XPD: open-source keywin e-bike lab replacement

Post by NeilP » Jun 04 2011 3:55am

Well, the Lyen version does work, but you need to be very particular with the settings when sending the data.

I seem to remember it only works with speed switch in position 2, and you often find that you have to do a complete PC reboot and fire up just the software to get it to work

Also I seem to remember that you have to press the cable transmit button, after the send button has been clicked on the software...or is it the other way round...cant remember..either way...try both ways, and hold the button down on the cable for a good second or two.

When it completes sucessfully, you get " ?? "symbol flash up and not the "OK" that you would very expcet
Last edited by NeilP on Jul 23 2011 8:12am, edited 1 time in total.
:) Only Irish coffee provides in a glass all four essential food groups: alcohol, caffeine, sugar, and fat :)

User avatar
anpaza   10 W

10 W
Posts: 69
Joined: Dec 07 2010 5:24pm

Re: XPD: open-source keywin e-bike lab replacement

Post by anpaza » Jun 05 2011 9:55am

I have released a new version of XPD, 0.2.0.

This new release introduces support for Lyen variants of the Infineon controller. Do not use the "generic" controller models with Lyen controllers, as they use different shunt values, thus you will get different current limits (phase and battery).

Also in this release error handling has been improved, also support for older PySerial version 2.3 has been added, because Ubuntu and Debian distributions still ship with the old library.
  • Added the "Copy" profile button
  • Added Lyen controller modifications: 6, 9, 12, 15, 18, 24 and 36-FET versions.
  • Better error handling (will report errors rather than hanging)
  • Older PySerial 2.3 is now supported (Debian & Ubuntu)
The files, as always, can be downloaded from BerliOS project homepage.

The protocol description has been updated to include the new formulas I have deduced for Lyen controllers.

User avatar
Floont   1 kW

1 kW
Posts: 439
Joined: Jul 20 2010 1:15pm
Location: Tampa, Florida

Re: XPD: open-source keywin e-bike lab replacement

Post by Floont » Jun 06 2011 9:11pm

NeilP wrote:...I seem to remember it only works with speed switch in position 2...
My hacked Lyen version does work with all three speed switch positions. The "secret" is to change the parameter "3 Speed Mode" to "0:Button Mode" which is entirely counter-intuitive. And also change "Indicate Mode" to "1:Comm GND". Both of these settings are not in the "sample" config files that come with the Lyen version I bought the controller. I agree that the program is frustrating with its idiosyncrasies, but it always eventually works with some persistance.

anpaza: Yes, the R12 shunt value is 1 megohm. I attached my hacked version of Lyen's Keywin program after I corrected the spelling and got those bizarre characters blanked out. Also included are the drivers and my current config file and some notes I took to get the thing to work.
I just might try your python program. I didn't realize it was that easy to use Python and change the program. I have to investigate it more. I assume I have to buy Python. I have to find out if will run on a Windows 7 laptop and such.

FA
Attachments
LYEN_Keywin_bob's_hack.zip
Lyen's Keywin program after I corrected the spelling and got those bizarre characters blanked out.
(2.84 MiB) Downloaded 221 times
Build 2: (present build): Rear x5304 on full suspension Mongoose, 127v 30s3p 10aH Turnigy Lipo, Lyen 24FET 100amp controller, CA2.2, 26" Hookworm front, 26" Crazy Bob rear, 203mm disc brakes, Airzound horn, twin Blaze 2 watt front lights - BURNED
All my posts on this site are licensed under the Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 License

User avatar
NeilP   10 GW

10 GW
Posts: 4968
Joined: Nov 27 2010 3:18pm
Location: 49.17303, -2.05354 Jersey, Europe
Contact:

Re: XPD: open-source keywin e-bike lab replacement

Post by NeilP » Jun 06 2011 11:57pm

Floont wrote:
NeilP wrote:...I seem to remember it only works with speed switch in position 2...
My hacked Lyen version does work with all three speed switch positions.



Sorry I put it badly and you misunderstood.

Yes, i can get it programmed to work with all three speed positions working with the Lyen edition, and yes as you say Button Mode, not switch mode.

What i was getting at was that if I remembered correctly the software would only program the controller correctly, when the physicaly handle bar switch was set in the position two position..IE both sides of the switch open...neither pin on the switch connected to the centre contact
:) Only Irish coffee provides in a glass all four essential food groups: alcohol, caffeine, sugar, and fat :)

User avatar
NeilP   10 GW

10 GW
Posts: 4968
Joined: Nov 27 2010 3:18pm
Location: 49.17303, -2.05354 Jersey, Europe
Contact:

Re: XPD: open-source keywin e-bike lab replacement

Post by NeilP » Jun 07 2011 12:06am

Just reading the "Read Me" file you posted in the hacked version above
3 SPEED MODE - This controls the behavior of the ESC's speed switch
* 0: Switch mode - allows you to change speed on the fly using a 3-speed switch (Low, Medium, High)
1: Cycle mode - latches the value at power on. (3spd switch will not work with a 1).
Not exactly true...if set to the wrong setting and a three speed switch is used...speed changes do happen, but do seem sort of random. Worth pointing this out, as I had this problem initially and did not suspect the software.

I suspected I had wired my three speed switch incorrectly..since it was 'doing something' ...just not what I expected
Last edited by NeilP on Jul 23 2011 8:13am, edited 2 times in total.
:) Only Irish coffee provides in a glass all four essential food groups: alcohol, caffeine, sugar, and fat :)

User avatar
Arlo1   100 GW

100 GW
Posts: 8356
Joined: Apr 26 2009 10:36pm
Location: Nanaimo
Contact:

Re: XPD: open-source keywin e-bike lab replacement

Post by Arlo1 » Jun 07 2011 12:38am

The cycle mode of the switch meens that you are supose to cycle the switch on and off to make it change settings. So it will seem weird till you under stand it.
Does your project need a high performance motor drive, battery charger or other power electronics developed? Let's talk!
www.powerdesigns.ca
Leaf motor controller build. http://endless-sphere.com/forums/viewto ... 27#p963227
YSR build http://www.youtube.com/watch?v=BRo8r5g4NBg
Never above 4.2v never below 2.7v EVER!!!
Support me on Patreon. https://www.patreon.com/user/posts?u=6842045
http://www.undergroundelectrics.ca/

User avatar
NeilP   10 GW

10 GW
Posts: 4968
Joined: Nov 27 2010 3:18pm
Location: 49.17303, -2.05354 Jersey, Europe
Contact:

Re: XPD: open-source keywin e-bike lab replacement

Post by NeilP » Jun 07 2011 1:05am

It is even more weird when you have a three position switch connected...It is designed for a momentary switch as far as I understand

Hold the switch on while powering on ...this sets the high speed ( or what ever you have set) mode

Power off and back on with the switch not pressed and the Overall Speed Limit setting is enabled
Last edited by NeilP on Jul 23 2011 8:14am, edited 1 time in total.
:) Only Irish coffee provides in a glass all four essential food groups: alcohol, caffeine, sugar, and fat :)

User avatar
anpaza   10 W

10 W
Posts: 69
Joined: Dec 07 2010 5:24pm

Re: XPD: open-source keywin e-bike lab replacement

Post by anpaza » Jun 07 2011 1:28am

Floont wrote:I just might try your python program. I didn't realize it was that easy to use Python and change the program. I have to investigate it more. I assume I have to buy Python. I have to find out if will run on a Windows 7 laptop and such.
You don't have to buy anything, Python is already installed on your computer as part of XPD installation (in windows-prereq.zip file). It is free software, freely available from python.org.

If you have a stock (unmodified shunt & LVC) Lyen EB224 controller, you may just install the new XPD version, it is supported now.

User avatar
anpaza   10 W

10 W
Posts: 69
Joined: Dec 07 2010 5:24pm

Re: XPD: open-source keywin e-bike lab replacement

Post by anpaza » Jun 07 2011 1:38am

NeilP wrote:Power off and back on with the switch not pressed and the Overall Speed Limit setting is enabled
Hmm, are you sure this can be done only at power-on? I was not aware of it. By reading various docs I was under the impression that you can toggle the speed setting at any time by just pushing the momentary switch. The three-position-switch, if I understand correctly, can be switched at any time?

Sorry for seemingly dumb questions, I don't have neither the switch or the button, but I'm trying to get the most correct option description in XPD.

User avatar
NeilP   10 GW

10 GW
Posts: 4968
Joined: Nov 27 2010 3:18pm
Location: 49.17303, -2.05354 Jersey, Europe
Contact:

Re: XPD: open-source keywin e-bike lab replacement

Post by NeilP » Jun 07 2011 5:21am

Well yes it does seem to do stuff with power on, but it all seemed a bit random.

but I did have a three way switch connected, so cant really comment about how it would perform if connected correctly :D
:) Only Irish coffee provides in a glass all four essential food groups: alcohol, caffeine, sugar, and fat :)

kZs0lt   100 W

100 W
Posts: 149
Joined: Dec 05 2008 9:33am
Location: Cluj Napoca, Romania

Re: XPD: open-source keywin e-bike lab replacement

Post by kZs0lt » Jun 07 2011 11:03am

This is really great work, that extends the capabilities of the original program.
This is useful for setting custom LVC(I think original version had no values between 42.5v to 50v).
I'd like to see if it can set speed less than 30%. And regen braking stronger than level 2.
BMC v1 250w (nylon geared)
12 FET programmable Infineon controller with 4110s (running on 20A)
18s2p Konion 26650s (66v, 4.4Ah)
Max. speed 54km/h(34mph) no assist on flat

User avatar
anpaza   10 W

10 W
Posts: 69
Joined: Dec 07 2010 5:24pm

Re: XPD: open-source keywin e-bike lab replacement

Post by anpaza » Jun 07 2011 3:02pm

I think setting speed less than 30% should work, although I haven't tested it. The limit of 30% in the original Parameter Designer seems completely artificial.

And about braking - unfortunately, values other than 0, 4 and 8 were tested and they don't lead to any stronger braking than existing settings :( So it seems that this is a limitation of the regen algorithm in microcontroller firmware. A guy on our Russian e-bike forum made his own controller and he managed to implement a really strong regeneration by connecting motor phases in reverse order (e.g. as for reverse direction rotation), so stronger braking is theoretically possible.
BMC v1 250w (nylon geared)
12 FET programmable Infineon controller with 4110s (running on 20A)
18s2p Konion 26650s (66v, 4.4Ah)
Max. speed 54km/h(34mph) no assist on flat
Wow, you've overclocked your 250W to >1KW. Don't you feel worried about the health of the nylon gears? :twisted:

User avatar
anpaza   10 W

10 W
Posts: 69
Joined: Dec 07 2010 5:24pm

Re: XPD: open-source keywin e-bike lab replacement

Post by anpaza » Jun 07 2011 4:39pm

I would like to beg anybody who uses XPD for the first time to keep an eye on the real current (with Cycle Analyst, or with a wattmeter), after setting the desired current limits with XPD.
I did limited testing of settings only for EB212/Lyen and EB206/Lyen controllers, the rest are untested, thus the real curent limits may happen to be larger than set.
As far as I'm aware, XPD closely mimics the behavior of Parameter Designer and will output same settings for same currents.
However, I may have forgot something somewhere, who knows.
I would feel guilty if XPD would cause someone's controller FETs to blow out due to real limits being higher than desired.
Also it would be good if those who already tested XPD with certain controller types would post a note here, something minimal like "18-FET controller limits works fine with the EB218/Lyen model" etc. Only battery current really matters, since it is computed from phase current (so, if phase current limit is way off, battery current will be incorrect as well). Of course, don't expect 100% precision, in the end, an e-bike controller is not a precision multimeter (and CycleAnalyst is not one as well). Something in the +/- 15% limits should be fine.

User avatar
bigmoose   100 MW

100 MW
Posts: 2675
Joined: Aug 06 2009 3:05pm
Location: North coast USA
Contact:

Re: XPD: open-source keywin e-bike lab replacement

Post by bigmoose » Jun 07 2011 6:03pm

Ratttts... I had hoped this would load on my XP Pro build. Python is there and I can launch it from the DOS window... but when I double click on xpd.pyw I only get a python flash through windsows task manager and nothing stays open... and python disappears from the task manager...

Likely a build issue on my laptop... Rattts. I need to search for the Python fix.

See page 14 of this thread for the solution.
Last edited by bigmoose on Aug 07 2011 7:01pm, edited 2 times in total.
"Live simply. Love generously. Care deeply. Speak kindly. Leave the rest to God..." all the best, Dave

User avatar
Hyena   100 GW

100 GW
Posts: 5628
Joined: Aug 13 2008 9:10am
Location: Sydney, Australia
Contact:

Re: XPD: open-source keywin e-bike lab replacement

Post by Hyena » Jun 07 2011 6:36pm

anpaza wrote:I would like to beg anybody who uses XPD for the first time to keep an eye on the real current (with Cycle Analyst, or with a wattmeter), after setting the desired current limits with XPD.
I did limited testing of settings only for EB212/Lyen and EB206/Lyen controllers, the rest are untested, thus the real curent limits may happen to be larger than set.
Don't worry, this is standard with the old software too.
I suspect it's largely due to the block time parameter allowing a programmed period of current overshoot. It you managed to set it to 0 it may well be closer to what you program but I always set mine to a few seconds anyway.

On one of my controllers set to 57a on the old software I see peaks of 85a on my turnigy watt meter and 100a on my CA (with a supposedly correctly calibrated shunt)

anpaza, how are you with android programming ? This software run off a $100 7" android tablet would be BADASS :twisted:
www.HyenaElectricBikes.com
Aussie high powered e-bike kits and custom performance ebikes
New FUTR and Hyena special edition Beta frames now available!
My build and HD video thread____. My youtube channel____ Hyena Facebook page
My bike is writing cheques my body can't cash...

User avatar
anpaza   10 W

10 W
Posts: 69
Joined: Dec 07 2010 5:24pm

Re: XPD: open-source keywin e-bike lab replacement

Post by anpaza » Jun 08 2011 1:29am

bigmoose wrote:Ratttts... I had hoped this would load on my XP Pro build. Python is there and I can launch it from the DOS window... but when I double click on xpd.pyw I only get a python flash through windsows task manager and nothing stays open... and python disappears from the task manager...

Likely a build issue on my laptop... Rattts. I need to search for the Python fix.
Try the following:
  • Open the command-line window (you call it DOS window)
  • Change the directory to where xpd is installed, e.g.

    Code: Select all

    cd "C:\Program Files\xpd-0.2.0"
    (note the quotes)
  • Run XPD like this:

    Code: Select all

    python xpd.pyw
Most likely it can't find one of the required libraries. In this case the above command will tell you something like "This program requires PyGTK to run". In this case you'll have to install the missing library (see the first message in thread).

User avatar
bigmoose   100 MW

100 MW
Posts: 2675
Joined: Aug 06 2009 3:05pm
Location: North coast USA
Contact:

Re: XPD: open-source keywin e-bike lab replacement

Post by bigmoose » Jun 08 2011 9:06am

Thanks for the tips anpaza. I am obviously not a Python guy! I found that one of the IBM service packs installed Python 2.2 on my machine a few years ago. Was able to snag this from an error file:

PYTHONCASEOK=1
PYTHONPATH=C:\IBMTOOLS\utils\support;C:\IBMTOOLS\utils\logger

Now I installed your install files to the default: C:\Python27 but the path in the laptop stayed as shown above. I cannot find the uninstall for python22 or how to change that path statement. When I tried your recommend fix from the command line, I had the same failed behavior.

Your install of Python27 had the "extras" needed to run your code, and I am thinking my machine is going to the Python22 load without the "extras." Am I on the right track?

Again apologies for the troubleshooting of the basic Python install.

Edit: Found how to change Windows environmental variables. Will reload Python27 and extras tonight and change the PYTHONPATH and see what happens!

See page 14 of this thread for the solution.
Last edited by bigmoose on Aug 07 2011 7:01pm, edited 2 times in total.
"Live simply. Love generously. Care deeply. Speak kindly. Leave the rest to God..." all the best, Dave

User avatar
anpaza   10 W

10 W
Posts: 69
Joined: Dec 07 2010 5:24pm

Re: XPD: open-source keywin e-bike lab replacement

Post by anpaza » Jun 09 2011 2:39am

It looks like it's using the wrong version of Python and/or the libraries. You may just create a shortcut that points directly to the right version of Python. For this:
  • Create a shortcut to XPD.PYW (right-click on the file -> Create shortcut)
  • Open the properties of the shortcut you just created, and in the "Object" field prepend the following: "C:\Python27\pythonw.exe -E". The whole field will look now somewhat like this:
    C:\Python27\pythonw.exe -E "C:\Program Files\xpd-0.2.0\xpd.pyw"
  • Change the icon to xpd.ico for better appearance :)
  • Move the shortcut to desktop or wherever you like it
The "-E" switch tells Python to ignore any environment variables like PYTHONPATH. With the above method you don't have to touch the environment variables at all.

Post Reply