EventGhost 0.4.0 beta test

Do you have questions about writing plugins or scripts in Python? Meet the coders here.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: EventGhost 0.4.0 beta test

Post by krambriw » Wed Dec 23, 2009 2:25 pm

Hello again,
I have now used jEdit and saved the page with UTF-8 encoding. The error is different this time
It seems the web server tries to use ascii codec
If I open the page in the browser, page properties says it is UTF-8
Maybe I got spoiled with previous eg 0.3.7 because there it worked :)
Attached is also my html.page for reference where I have specified the character encoding to UTF-8

(r1307 on XP)

Best regards, Walter

Code: Select all

15:18:23   ----------------------------------------
15:18:23   Exception happened during processing of request from ('192.168.10.3', 52268)
15:18:23   Traceback (most recent call last):
15:18:23     File "SocketServer.pyc", line 558, in process_request_thread
15:18:23     File "SocketServer.pyc", line 320, in finish_request
15:18:23     File "SocketServer.pyc", line 615, in __init__
15:18:23     File "BaseHTTPServer.pyc", line 329, in handle
15:18:23     File "BaseHTTPServer.pyc", line 323, in handle_one_request
15:18:23     File "C:\Program\EventGhost\plugins\Webserver\__init__.py", line 281, in do_GET
15:18:23     File "C:\Program\EventGhost\plugins\Webserver\__init__.py", line 215, in SendContent
15:18:24     File "socket.pyc", line 292, in write
15:18:24   UnicodeEncodeError: 'ascii' codec can't encode character u'\xc5' in position 910: ordinal not in range(128)
15:18:24   ----------------------------------------
EgCtrl.zip
(886 Bytes) Downloaded 286 times

User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: EventGhost 0.4.0 beta test

Post by Bitmonster » Wed Dec 23, 2009 7:11 pm

=> r1309
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!

krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: EventGhost 0.4.0 beta test

Post by krambriw » Wed Dec 23, 2009 7:34 pm

Great, it works now, thank you ;)
And Merry Xmas,
Best regards, Walter

User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: EventGhost 0.4.0 beta test

Post by Bitmonster » Sun Dec 27, 2009 5:26 pm

r1316 has a method to restart itself. I remember this has been requested sometimes. Just call "eg.app.Restart()" in a PythonScript/PythonCommand/PythonShell.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!

Bartman
Plugin Developer
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Re: EventGhost 0.4.0 beta test

Post by Bartman » Mon Dec 28, 2009 10:46 am

I guess the 0.4.xxx versions are built from the plugin-install branch!?
When making changing to existing plugins should this be done in the trunk? Any schedule when you plan reintegrating the branch into the trunk?

User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: EventGhost 0.4.0 beta test

Post by Bitmonster » Mon Dec 28, 2009 5:05 pm

Bartman wrote:I guess the 0.4.xxx versions are built from the plugin-install branch!?
Yes.
Bartman wrote:When making changing to existing plugins should this be done in the trunk?
Yes. I re-integrate the plugin changes time to time to the 0.4 branch.
Bartman wrote:Any schedule when you plan reintegrating the branch into the trunk?
No. Firstly 0.4 has to prove to be stable. And then the core trunk will be switched to 0.4
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!

User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: EventGhost 0.4.0 beta test

Post by Pako » Thu Dec 31, 2009 7:30 pm

Version 4.0.4.r1329
When installing WinUsb, I now get this error message (UnicodeEncodeError):

Code: Select all

20:11:47   Error starting plugin: Deal Extreme USB PC Remote
20:11:47   Driver not found!
20:11:47   Plugin: Deal Extreme USB PC Remote
20:11:49      Error starting plugin: Deal Extreme USB PC Remote
20:11:49      Driver not found!
20:11:59   GetUncPathOf Error: 1200 Zadaný název za\u0159ízení není platný.
20:12:00   Exception in thread Thread-10:
20:12:00   Traceback (most recent call last):
20:12:00     File "threading.pyc", line 525, in __bootstrap_inner
20:12:00     File "threading.pyc", line 477, in run
20:12:00     File "D:\Programs\E\EventGhost\eg\Classes\WinUsb.py", line 365, in InstallDriver
20:12:00       '"%s" /f /lm' % join(INSTALLATION_ROOT, "dpinst.exe"),
20:12:00     File "D:\Programs\E\EventGhost\eg\WinApi\PipedProcess.py", line 214, in ExecAs
20:12:00       raise Exception("Child process raised an exception\n" + data)
20:12:00   Exception: Child process raised an exception
20:12:00   Child process traceback (most recent call last)
20:12:00     File "D:\Programs\E\EventGhost\eg\WinApi\PipedProcessClient.py", line 177, in Main
20:12:00       result = func(*args, **kwargs)
20:12:00     File "subprocess.pyc", line 470, in call
20:12:00     File "subprocess.pyc", line 621, in __init__
20:12:00     File "subprocess.pyc", line 830, in _execute_child
20:12:00   UnicodeEncodeError: 'ascii' codec can't encode character u'\xed' in position 49: ordinal not in range(128)
20:12:00   
Pako

User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: EventGhost 0.4.0 beta test

Post by Bitmonster » Fri Jan 01, 2010 7:37 pm

=> r1330
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!

User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: EventGhost 0.4.0 beta test

Post by Bitmonster » Sun Jan 17, 2010 10:49 pm

It seems many people didn't get the meaning of the "WinUsb" stuff right. So I try to resume what it is for:

Many remotes that can be bought these days are "HID" remotes. They register as a keyboard and/or mouse in the system and therefore work without any driver just after you plug them in. But this gives issues for a user that actually wants to assign something else to a button on his remote. He might use the keyboard plugin or Bartman's HID plugin to deal with them, but the first often will also make the real keyboard unusable (for example if you reassign the enter key) and the later will not prevent the keypresses to reach the application also. And many remotes just can't be used that easily (if at all) with the HID plugin.

So the solution to this problem is the WinUSB stuff. WinUSB.sys is a driver from Microsoft that can be assigned to a particular device instead of the generic HID driver. It will simply disable this generic handling of the device as a keyboard or mouse and also gives the developer a way to get the buttons of the remote directly. And since the WinUSB.sys driver is signed by Microsoft, this will also work under the heavily restricted signing policies of Vista/Win7. Even under the even more restricted 64bit OS versions.

But to assign WinUSB.sys to a device, the developer has to write an INF file and create a driver package. Quite complex if you want to do it right.

So here comes eg.WinUsb into play. With eg.WinUsb the plugin developer simply has to find out the Vendor ID and Product ID of the device (that easily can be found in the device manager). Then his plugin registers this PID/VID and EG will take care of creating the needed INF file on the fly, eventually downloads DLLs that the driver needs, starts the driver installation with elevated rights and guide the user through the installation of this alternative driver. The plugin developer only has to write three lines of code to get this done.

After this the plugin developer has to write some code to convert the raw data received from the remote into some usable events. Most remotes just deliver a small chain of bytes for every button, so the developer just has to say "if you receive (2, 0, 43, 65) then TriggerEvent('Play')". Some remotes are a bit more complicated but most of them can be "hacked" even by a beginner. I have implemented more than half a dozen remotes this way till now and most of the plugins I have done in an hour.

So if a WinUSB plugin is written for a particular remote, this remote will work perfectly in the EG world. No side effects and complete control.

Every remote that shows up in Bartman's HID plugin is a good candidate to write a WinUSB plugin for it. And using a custom WinUSB plugin for a device is superior to handle it with the HID or keyboard plugin.

Therefore I would say eg.WinUsb is one of the greatest features in EG. It opens EG for many new remotes. But it only works in 0.4.0 so easily, so it is important we get this branch tested.

Now a little foresight:
The next step is to publish these PID/VIDs of the plugin to the EG website. So in the future EG will enumerate all HID devices, look-up their PID/VID values on the EG website and inform the user that a special plugin for his device exists. Then the user can simply download/install this plugin and he is ready to get his remote working with just a few clicks. But this automatic plugin discovery is currently not implemented. It is just on the ToDo list.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!

Bartman
Plugin Developer
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Re: EventGhost 0.4.0 beta test

Post by Bartman » Sun Jan 17, 2010 11:05 pm

My Logitech Keyboard shows three different HID devices with the same VID and PID. Can this be handled in anyway?

Another question.
Do I have to upgrade one of the libraries I use to run EG from source and develop in pydev?
Does it also still work to install the 0.4.0 beta, delete everything apart from lib folder and EventGhost.exe and check out the svn folder?

User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: EventGhost 0.4.0 beta test

Post by Bitmonster » Sun Jan 17, 2010 11:18 pm

Bartman wrote:My Logitech Keyboard shows three different HID devices with the same VID and PID. Can this be handled in anyway?
Actually the driver doesn't register to "HID device" entries. It registers for the "USB Input device" entry in the device manager. Some devices register multiple entries but they differ in the "MI" field. So you might have for example:
USB\VID_05A4&PID_9881&MI_01 and USB\VID_05A4&PID_9881&MI_02
Both refer to the same VID/PID but different sub-instances. If so, you have to create a eg.WinUsb.AddDevice call for every sub-instance.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!

User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: EventGhost 0.4.0 beta test

Post by Bitmonster » Sun Jan 17, 2010 11:24 pm

Bartman wrote:Another question.
Do I have to upgrade one of the libraries I use to run EG from source and develop in pydev?
0.4.0 might demand some more and newer libaries. But if 0.4.0 runs in the environment, then 0.3.7 should be able to run in the same.
Bartman wrote:Does it also still work to install the 0.4.0 beta, delete everything apart from lib folder and EventGhost.exe and check out the svn folder?
Yep.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!

Bartman
Plugin Developer
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Re: EventGhost 0.4.0 beta test

Post by Bartman » Tue Jan 19, 2010 11:10 pm

I get the following error when starting with the debug parameter
When running from my pydev environment EG does not go on after this error, while the installed and updated version continues after the error and crashes when actually open the about dialog.
Is there a reason the log file is explicitly opened with notepad.exe instead of the default application?

Code: Select all

00:07:27: 0 MainThread: ----------------------------------------
00:07:27: 0 MainThread:         EventGhost started
00:07:27: 0 MainThread: ----------------------------------------
00:07:27: 0 MainThread: Version: 0.4.0.dev
00:07:27: 0 MainThread: missing guid in plugin: C:\Program Files (x86)\EventGhost\plugins\GameVoice
00:07:27: 0 MainThread: missing guid in plugin: C:\Program Files (x86)\EventGhost\plugins\IgorPlugUDP
00:07:27: 0 MainThread: missing guid in plugin: C:\Program Files (x86)\EventGhost\plugins\JvcDlaSerial
00:07:27: 0 MainThread: PluginManager.ScanAllPlugins :0.12358641145949109
00:07:27: 0 MainThread: SendKeysParser.__init__()
00:07:27: 0 MessageReceiver: MessageReceiver.__MainLoop()
00:07:27: 0 MessageReceiver: MessageReceiver.Setup()
00:07:27: 0 MainThread: Document.ShowFrame()
00:07:27: 0 MainThread: Log.GetData()
00:07:27: 0 MainThread: Document.ShowFrame => None
00:07:27: 0 ActionThread: ActionThread.__MainLoop()
00:07:27: 0 EventThread: EventThread.__MainLoop()
Traceback (most recent call last) (0):
  File "EventGhost.pyw", line 49, in <module>
    eg.Main()
  File "C:\Program Files (x86)\EventGhost\eg\__init__.py", line 79, in Main
    eg.Init.ImportAll()
  File "C:\Program Files (x86)\EventGhost\eg\Init.py", line 165, in ImportAll
    Traverse(join(eg.mainDir, "eg"), "eg")
  File "C:\Program Files (x86)\EventGhost\eg\Init.py", line 149, in Traverse
    Traverse(path, moduleName)
  File "C:\Program Files (x86)\EventGhost\eg\Init.py", line 163, in Traverse
    __import__(moduleName)
  File "C:\Program Files (x86)\EventGhost\eg\Classes\AboutDialog.py", line 65, in <module>
    ("Plugin Developers:", 2, GetPluginAuthors()),
  File "C:\Program Files (x86)\EventGhost\eg\Classes\AboutDialog.py", line 59, in GetPluginAuthors
    pluginNames.sort(key=unicode.lower)
TypeError: descriptor 'lower' requires a 'unicode' object but received a 'str'
00:07:27: 0 EventThread: EventThread.StartSession(filename=u'C:\\Users\\PatkIllA\\Documents\\EventGhost\\MyConfig.xml')
00:07:27: 0 ActionThread: ActionThread.StartSession(filename=u'C:\\Users\\PatkIllA\\Documents\\EventGhost\\MyConfig.xml')
00:07:27: 0 ActionThread: Document.Load(filePath=u'C:\\Users\\PatkIllA\\Documents\\EventGhost\\MyConfig.xml')
00:07:27: 0 MouseThread: MouseThread.run()
00:07:27: 0 MainThread: OSDFrame.__init__(parent=None)
00:07:27: 0 ActionThread: StartLoad(cls=<class 'eg.Classes.TreeLink.TreeLink'>)
00:07:27: 0 SchedulerThread: SessionChangeNotifier.Register()
00:07:27: 0 ActionThread: Document.SetExpandState(expanded=set([0, 1, 2, 115, 4, 5, 7, 9, 10, 87, 142, 15, 201, 28, 29, 30, 31, 32, 33, 34, 35, 36, 95, 39, 168, 41, 42, 43, 428, 176, 50, 51, 180, 317, 310, 55, 57, 314, 415, 60, 61, 319, 160, 66, 487, 198, 329, 499, 162, 210, 163, 471, 164, 338, 479, 315, 485, 486, 359, 488, 489, 491, 492, 493, 494, 495, 112, 498, 83, 501, 121, 122, 508, 126]))
00:07:27: 0 ActionThread: XML loaded in 0.311333 seconds.
00:07:28: 0 SerialReceiveThreadProc: SerialThread.CallbackThreadProc()
00:07:28: 0 Thread-4: SerialThread.ReceiveThreadProc()
00:07:28: 0 ActionThread: JvcDlaSerial.__start__(port=4)
00:07:28: 0 SerialReceiveThreadProc: SerialThread.CallbackThreadProc()
00:07:28: 0 Thread-5: SerialThread.ReceiveThreadProc()
00:07:28: 0 ActionThread: ActionThread.StartSession => None

User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: EventGhost 0.4.0 beta test

Post by Bitmonster » Wed Jan 20, 2010 6:07 am

@Bartman
The cause has most likely something to do with a custom plugin of yours that is not part of the installer. So please try to remove every self-made plugin and try it again. If you then get no error try to place them back one after one to find the odd one and post its source here.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!

Bartman
Plugin Developer
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Re: EventGhost 0.4.0 beta test

Post by Bartman » Wed Jan 20, 2010 3:41 pm

All of the plugins I use are from svn. But I can try to find the plugin responsible.

Post Reply