Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Problem with Config-file

If you have a question or need help, this is the place to be.
bongolf
Experienced User
Posts: 58
Joined: Tue Jan 19, 2010 12:37 pm

Problem with Config-file

Post by bongolf »

Hi!

All of a sudden i get a lot of errors when I am opening my latest EG-config-file (the xml-file), but I dont understand where to start looking for the problem.
21:56:48 Unhandled exception in WorkerThread <EventThread>:
21:56:48 Callers stack:
21:56:48 File "wx\_core.pyc", line 8010, in MainLoop
21:56:48 File "wx\_core.pyc", line 7306, in MainLoop
21:56:48 File "C:\Program Files\EventGhost\eg\Classes\MainFrame\__init__.py", line 345, in FuncWrapper
21:56:48 func()
21:56:48 File "C:\Program Files\EventGhost\eg\Classes\MainFrame\__init__.py", line 828, in OnCmdOpen
21:56:48 self.document.Open()
21:56:48 File "C:\Program Files\EventGhost\eg\Classes\Document.py", line 353, in Open
21:56:48 self.StartSession(filePath)
21:56:48 File "C:\Program Files\EventGhost\eg\Classes\Document.py", line 158, in StartSession
21:56:48 eg.eventThread.Call(eg.eventThread.StartSession, filePath)
21:56:48 Traceback (most recent call last) (1710):
21:56:48 File "C:\Program Files\EventGhost\eg\Classes\ThreadWorker.py", line 326, in __DoOneEvent
21:56:48 self.HandleAction(action)
21:56:48 File "C:\Program Files\EventGhost\eg\Classes\ThreadWorker.py", line 289, in HandleAction
21:56:48 action()
21:56:48 File "C:\Program Files\EventGhost\eg\Classes\ThreadWorker.py", line 62, in __call__
21:56:48 self.returnValue = self.func(*self.args, **self.kwargs)
21:56:48 File "C:\Program Files\EventGhost\eg\Classes\EventThread.py", line 142, in StartSession
21:56:48 actionThread.Func(actionThread.StartSession, 120)(filename)
21:56:48 File "C:\Program Files\EventGhost\eg\Classes\ThreadWorker.py", line 62, in __call__
21:56:48 self.returnValue = self.func(*self.args, **self.kwargs)
21:56:48 File "C:\Program Files\EventGhost\eg\Classes\ActionThread.py", line 39, in StartSession
21:56:48 eg.document.Load(filename)
21:56:48 File "C:\Program Files\EventGhost\eg\Classes\Document.py", line 143, in Load
21:56:48 xmlTree = ElementTree.parse(filePath)
21:56:48 File "<string>", line 45, in parse
21:56:48 File "<string>", line 32, in parse
21:56:48 SyntaxError: not well-formed (invalid token): line 355, column 34


Can anyone understand what the problem might be?

If I restart EG and open it with an older config-file the errors doesn't occur, so I am pretty sure the problem is related to something in my config...
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Problem with Config-file

Post by kgschlosser »

your saved eg is corrupted,

if you attach it a lot of times i can fix it. but sometimes not. have to see the extent of the damage.
If you like the work I have been doing then feel free to Image
bongolf
Experienced User
Posts: 58
Joined: Tue Jan 19, 2010 12:37 pm

Re: Problem with Config-file

Post by bongolf »

Here it is, thanks for having a look!
Attachments
eg_config_161028.xml
(140.3 KiB) Downloaded 122 times
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Problem with Config-file

Post by kgschlosser »

OK it should be all fixed. there was a NULL byte(0x0 invisible character) on line 355 at position 35. if you actually open the xml file up in a text editor and go to that line and position. you will notice when you try to move the cursor over the position it hangs for one movement. that's because the NULL byte is actually using one of the movements. you just can't see it there.

let me know if it works properly. It should. you may consider doing a HDD scan.This kind of thing usually stems from a bad sector on a HDD and also run an sfc /scannow from a command prompt run as administrator. do this before going to bed. could take a while to complete.

the latter just checks all windows operating system files. and if there is erroneous data it will try to rebuild the goofed up file for ya.

when it's done run this command from a command prompt as well. it will create a file called sfcdetails.txt on your desktop. in that file (text file) will be the details of the scan and what it fixed if anything. or if it couldn't fix something

Code: Select all

findstr /c:"[SR]" %windir%\logs\cbs\cbs.log >%userprofile%\Desktop\sfcdetails.txt

also back this Bad Larry up. it always sucks to lose a tree, had it happen to me with over 2000 items. BAH! that was a really bad day. LOL
If you like the work I have been doing then feel free to Image
bongolf
Experienced User
Posts: 58
Joined: Tue Jan 19, 2010 12:37 pm

Re: Problem with Config-file

Post by bongolf »

Thanks for your help!

But now I get an other error message:
19:36:51 File "C:\Program Files\EventGhost\eg\Utils.py", line 222, in SetDefault
19:36:51 SetDefault(targetDict[defaultKey], defaultValue)
19:36:51 File "C:\Program Files\EventGhost\eg\Utils.py", line 222, in SetDefault
19:36:51 SetDefault(targetDict[defaultKey], defaultValue)
19:36:51 File "C:\Program Files\EventGhost\eg\Utils.py", line 222, in SetDefault
19:36:51 SetDefault(targetDict[defaultKey], defaultValue)
19:36:51 File "C:\Program Files\EventGhost\eg\Utils.py", line 222, in SetDefault
19:36:51 SetDefault(targetDict[defaultKey], defaultValue)
19:36:51 File "C:\Program Files\EventGhost\eg\Utils.py", line 222, in SetDefault
19:36:51 SetDefault(targetDict[defaultKey], defaultValue)
19:36:51 File "C:\Program Files\EventGhost\eg\Utils.py", line 222, in SetDefault
19:36:51 SetDefault(targetDict[defaultKey], defaultValue)
I have a old config file from February this year, so everything isn't lost, but quit a few changes have been made since then...
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Problem with Config-file

Post by kgschlosser »

send over the working xml file also. and i will need the rest of that error message as well. it's missing the bits that tell me where it originated from. but you may have more problems then just the config file. and possibly the old config isn't starting the code that is causing the error but the newer one is. so if we can narrow down to what is making the call we can take a look and see if there is an error in the xml still that is causing the issue.


I have attached a copy of the xml file that has the macro removed that had the error in it. there could possibly be a problem in it that i am not seeing. there are actually 2 macros that look really odd. i am not sure because it is for the serial port plugin and it could be the data it's receiving is supposed to be this way. but it doesn't look normal.

Code: Select all

<Macro Name="Serial Port: Write Data: PWR ON\r" Expanded="True">
            <Event Name="Serial.:::ERR" />
            <Event Name="Serial.::ERR" />
            <Event Name="Serial.:ERR" />
            <Event Name="Serial.ERR" />
            <Action>
                Serial.Write(u'PWR ON\\r')
            </Action>
            <Action>
                EventGhost.PythonScript(u'tid=eg.Utils.time.strftime("%H:%M:%S")\ndate=eg.Utils.time.strftime("%Y-%m-%d")\neg.globals.Proj="On"\neg.globals.Proj_time=tid\nc = \'socket_\' + "Proj" + \'|\' +eg.globals.Proj+ \'|\' + date + \'|\' + tid\nprint c\neg.plugins.Webserver.BroadcastMessage(c, False)\neg.plugins.Webserver.SetPersistentValue(u\'p_Proj\', u\'{eg.globals.Proj}\', False, False)\neg.plugins.Webserver.SetPersistentValue(u\'p_Proj_time\', u\'{eg.globals.Proj_time}\', False, False) \n')
            </Action>
        </Macro>
        <Macro Name="Serial Port: Write Data: PWR OFF\r" Expanded="True">
            <Event Name="Serial.:::SOURCE=30" />
            <Event Name="Serial.::SOURCE=30" />
            <Event Name="Serial.:SOURCE=30" />
            <Event Name="Serial.SOURCE=30" />
            <Event Name="Serial.:: SOURCE=30" />
            <Event Name="Serial.::::::SOURCE=30" />
            <Action>
                Serial.Write(u'PWR OFF\\r')
            </Action>
            <Action>
                EventGhost.PythonScript(u'tid=eg.Utils.time.strftime("%H:%M:%S")\ndate=eg.Utils.time.strftime("%Y-%m-%d")\neg.globals.Proj="Off"\neg.globals.Proj_time=tid\nc = \'socket_\' + "Proj" + \'|\' +eg.globals.Proj+ \'|\' + date + \'|\' + tid\nprint c\neg.plugins.Webserver.BroadcastMessage(c, False)\neg.plugins.Webserver.SetPersistentValue(u\'p_Proj\', u\'{eg.globals.Proj}\', False, False)\neg.plugins.Webserver.SetPersistentValue(u\'p_Proj_time\', u\'{eg.globals.Proj_time}\', False, False) \n')
            </Action>
        </Macro>

it's the event names that look off, and why there are so many of them for each macro. and coming from what appears to be an AVR the data should be a constant. i will scan the file and see if i can find anything more like that. but if it's not supposed to be that way let me know and i can manually edit the thing and change it to what it is supposed to be
If you like the work I have been doing then feel free to Image
bongolf
Experienced User
Posts: 58
Joined: Tue Jan 19, 2010 12:37 pm

Re: Problem with Config-file

Post by bongolf »

Thanks, I have attached the old working file.

The error messages floods the "log-window" so fast so I haven't been able to capture the start (yet).
But the end looks like this:
22:14:28 File "C:\Program Files\EventGhost\eg\Utils.py", line 222, in SetDefault
22:14:28 SetDefault(targetDict[defaultKey], defaultValue)
22:14:28 File "C:\Program Files\EventGhost\eg\Utils.py", line 222, in SetDefault
22:14:28 SetDefault(targetDict[defaultKey], defaultValue)
22:14:28 File "C:\Program Files\EventGhost\eg\Utils.py", line 221, in SetDefault
22:14:28 elif type(defaultValue) in USER_CLASSES:
22:14:28 RuntimeError: maximum recursion depth exceeded while calling a Python object
Regarding the serial port and the events: It┬┤s an Epson projector that is connected via the serial port. And the events coming in acctually differs from time to time. That part of the config hasn't been changed for ages...
Attachments
eg_config.xml
(133.65 KiB) Downloaded 109 times
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Problem with Config-file

Post by kgschlosser »

here is yet another crack at it. but if it does the same thing please do me a favor.

run eventghost from a command prompt with the -debug switch


navigate to you c:\users\USERNAME\appdata\roaming\eventghost directory and there should be a log.txt file in there. attach that to a post for me. that will show the whole error. i need what is calling eg.utils.SetDefault()


and it's a good thing you are running build 1710 (v0.4) of EG because the -debug has been removed in 1722 (v0.5)

that's awesome you are using the SystemDatabase plugin. that was the first plugin i ever wrote. when i just started learning python I should rewrite it. well actually i have kinda sorta. it's just built into a modified version of eg i have been working on. i still use it today and it holds over 10 thousand different items. i find it very useful for storing my menu system data and all of the different settings for things. i actually use it to store code and then run the code with exec if a specific action happens.

thanks for using it. makes me feel good that it is by someone else other than me.

what i did was move everything that has changed from the newer file to the older one. hoping that maybe the error might be produced by some problem in the actual file that might not have gotten moved over. but if it does still happen we narrowed it down to about 1/8 of the amount of xml data to look through because we know it's located in one of the things that are different between the 2 files. having that coupled with the debug printout i should be able to pinpoint it exactly.
If you like the work I have been doing then feel free to Image
bongolf
Experienced User
Posts: 58
Joined: Tue Jan 19, 2010 12:37 pm

Re: Problem with Config-file

Post by bongolf »

Still no luck, but I hope that the attached log-file can help!
Attachments
Log.txt
(131.3 KiB) Downloaded 111 times
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Problem with Config-file

Post by kgschlosser »

there seems to be 2 issues.

one is with the TellStick Duo plugin its self.

I do not know how the plugin functions. you might get an answer in the support thread for the plugin

here is the error related to the plugin.

Code: Select all

Traceback (most recent call last) (1710):
  File "_ctypes/callbacks.c", line 295, in 'calling callback function'
  File "C:\Program Files\EventGhost\plugins\TellStickDuo\__init__.py", line 308, in sensorEventCallback
    if self.bDeviceEvents:
AttributeError: 'TellStickDuo' object has no attribute 'bDeviceEvents'
the last is caused by the language bits of eventghost. and it's really funny because a discussion about how the translator works is going on here

viewtopic.php?f=13&t=8218&p=43406#p43406

and it was just pointed out that the cause of it could be the SystemDatabase plugin. so today I am going to be tasked with rewriting it. I am going to make it function a little differently but still maintain backwards compatibility.

I should be able to finish it up in a day. so i will post and let you know
If you like the work I have been doing then feel free to Image
bongolf
Experienced User
Posts: 58
Joined: Tue Jan 19, 2010 12:37 pm

Re: Problem with Config-file

Post by bongolf »

Ok, thank you!

Would it be possible to get a copy of the config with the SystemDatabase and the TellStick Duo plugins disabled (or removed), that I can test?
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Problem with Config-file

Post by kgschlosser »

hmmm i do think i may know what the problem is. i have to go and have a look see at the tellstick duo plugin
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Problem with Config-file

Post by kgschlosser »

ok here is what i want you to do. remove the tellstickduo plugin folder. well move it to your desktop. but get it out of the EG plugins folder. then run EG.

now run a copy of the xml file that you don't care about writing over
You will get a bunch of errors related to missing plugins and actions not having a plugin. but don't worry about those. i am interested in the other errors. so what you want to do is after it is done complaining. save EG and exit. then run it from the commandline with the -debug and see if it runs and send me a copy of that log file.
If you like the work I have been doing then feel free to Image
bongolf
Experienced User
Posts: 58
Joined: Tue Jan 19, 2010 12:37 pm

Re: Problem with Config-file

Post by bongolf »

Ok,here is the new log-file.
Attachments
Log.txt
(270.55 KiB) Downloaded 112 times
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Problem with Config-file

Post by kgschlosser »

ok we need you to close EG. delete the log.txt file...

then open eg with the -debug

take note if you see any errors.

then close eg.

and then attach the log.txt.

it doesn't create a new load file each time. it appends to it. and i want a ful open a close of eg to be in the log file. and only the newest information to be in there..


but from what i am seeing is that the error is gone. i just want to confirm that 100%. and then i will give instruction from there
If you like the work I have been doing then feel free to Image
Post Reply