PDA

View Full Version : Crash on sending IP



Mastiff
May 22nd, 2005, 03:34 PM
I'm trying to send simple commands to a Girder 3.3 computer, and I'm getting nowhere, ecxept for crash city. Of course I have no idea why... I have tried executing the Start the Internet Event Server 2.0 multi-group first, but that doesn't help. This is the code:



function ClientCB(str, socket, operation,ip)

print("ClientCB: "..str);


gip.Close(socket);

end

gip.Open('192.168.0.1',1024, girder, nil)
gip.Send(socket, 'test\n')

I have also tried with only the two last lines, but that changes nothing. I assume the code is wrong, but still it shouldn't crash Girder.

And this is the crash:

date/time : 2005-05-22, 22:30:33, 281ms
computer name : KINOPROSJEKT
user name : Yeah right
operating system : Windows XP Service Pack 2 build 2600
system language : Norwegian (Bokmål)
system up time : 11 hours 50 minutes
program up time : 2 minutes 19 seconds
processor : Intel(R) Pentium(R) 4 CPU 3.20GHz
physical memory : 321/511 MB (free/total)
free disk space : (C:) 3.15 GB
display mode : 1152x864, 32 bit
process id : $56c
allocated memory : 17.60 MB
executable : girder.exe
exec. date/time : 2005-05-21 12:46
version : 4.0.0.196
madExcept version : 2.7g
exception class : EAccessViolation
exception message : Access violation at address 02FF97F6 in module 'genericip.dll'. Read of address 00000000.

thread $450:
02ff97f6 genericip.dll
10002119 lua5.dll lua_pcall
0197c1d7 girder.dll luahndl 1254 RunScript
01972135 girder.dll GirAction 521 l_girNumParser
01972c1b girder.dll GirAction 847 ExecuteGirAction
01979749 girder.dll proc 57 l_TriggerNodeB
01979816 girder.dll proc 106 l_TriggerNode
01979901 girder.dll proc 200 TriggerNode
01983cf4 girder.dll queue 732 l_ProcessingFunctions
01983e91 girder.dll queue 797 IncomingEvent
019841c1 girder.dll girder 64 l_MsgFilter
019844cc girder.dll girder 235 l_CoreThread
0042f8df girder.exe madExcept ThreadExceptFrame
>> created by main thread ($410) at:
01984650 girder.dll girder 340 CoreStart
[...]

Rob H
May 22nd, 2005, 04:00 PM
gip.Open('192.168.0.1',1024, girder, nil)

Shouldn't girder be in quotes? You're probably getting an AV because you're passing in nil as the password.

Mastiff
May 23rd, 2005, 01:42 AM
Well, that helps. It doesn't crash anymore. But I'm still not able to send anything that the other Grider can receive. I'm pretty sure it's the password handling, since I get the same reaction when I send without a password. It's driving me nuts! This is the only thing missing to get this up and running, I think. After a weekend filled with Lua I'm stuck on something that should be easy... The only way I can send anything now is to use the old Internet Event Client from Girder 3.3! :-? :( :cry:

Rob H
May 23rd, 2005, 01:57 AM
You could try using the new Communication Server instead. See the help.

Mastiff
May 23rd, 2005, 07:11 AM
There's one emoticon missing here: Me banging my head against a brick wall!!!! :cry:

I think there's something I just don't get here. In the communication server I try this line:


con,err = comserv.NewConnection( '192.168.0.1', 1024, 'test\n', girder);

I have tried it with quotes around girder, but almost nothing happens. I know that both the port and the IP are placed correctly, since there is an incoming connection registered on the computer I'm sending to (with Girder 3.3 on it). And I feel totally hopeless... Help!

birty
May 23rd, 2005, 07:40 AM
try this,

con = comserv.NewConnection( [host], [port], [password], [Callback])
Sequence, Error = con:SendEvent([event],[device],[eventmod], [[payloads],...])
val, error = con:Close()

the documentation explains all the available functions

Mastiff
May 23rd, 2005, 07:46 AM
Still nothing. I think you guys credit me with more than one brain cell... I have read the documentation, but didn't understand it. In my case:


con = comserv.NewConnection( [192.168.0.1], [1024], [girder], [Callback])
Sequence, Error = con:SendEvent([test],[device],[eventmod], [[payloads],...])
val, error = con:Close()

I don't understand what callback means, I don't know what device to choose when sending to Girder 3.3, I have no idea what an eventmod is...

And it doesn't even compile. I think the documentation needs a very simple example for each thing, with everything written out in plain languague. I can't be the only moron out here, all though I'm probably the first moron trying his hand at G4. :oops:

Rob H
May 23rd, 2005, 07:59 AM
There's one emoticon missing here: Me banging my head against a brick wall!!!! :cry:

I think there's something I just don't get here. In the communication server I try this line:


con,err = comserv.NewConnection( '192.168.0.1', 1024, 'test\n', girder);

Okay, first of all you need to establish the connection

con,err = comserv.NewConnection( '192.168.0.1', 1024, 'girder')
Next we want to send an event


if con then
con:SendEvent('test', 18, 0) -- we're not sending any payload for this event
con:Close()
end

Let me know if that does or doesn't work

Mastiff
May 23rd, 2005, 08:04 AM
Nope. Same result as before. I think I read something about Girder 3 needing a /n (line feed) as part of the message, but that didn't change anything either. I'm 100 % sure about the IP, the port and the password that the server uses. And the firewall is not the issue either.

Edit: Sending the same thing from a Girder 3.3 client works.

Rob H
May 23rd, 2005, 08:07 AM
Let's see what code you have now.

Mastiff
May 23rd, 2005, 08:07 AM
con,err = comserv.NewConnection( '192.168.0.1', 1024, 'girder')
if con then
con:SendEvent('test', 18, 0) -- we're not sending any payload for this event \
con:Close()
end

Line feed (both with \n and /n) changes nothing.

Rob H
May 23rd, 2005, 08:58 AM
I see what you mean - I can't get it to work either. One end or the other is closing the connection almost immediately.

Ron??

Mastiff
May 23rd, 2005, 08:59 AM
Phew. Maybe I'm not as stupid as I feared! :D

Ron
May 23rd, 2005, 01:25 PM
The comserver will not work with Girder 3.3.

I haven't tested gip with G3.3 in ages. I'll see what I can do.

Mastiff
May 23rd, 2005, 02:37 PM
OK, thanks. In my system I will have to use the Internet Event Client app from 3.3 for now, then, since I won't be using G 4 on the most critical computers yet.

Ron
May 23rd, 2005, 04:20 PM
Okay I tested here and it seems to work. Use the attached script.

Make sure "Load the Internet Event Code and Start the server" has been run (should be automatic).

Then edit "Send Internet Event" and run it. That is it!

Mastiff
May 23rd, 2005, 04:33 PM
Yeesir! The client/sending works perfectly! Thank you very much! If I could only get the server side going... I have changed only one thing in "Server and client code", the password. But unfortunately nothing happens when I try to send to it. The firewall is off, and i have double checked that I'm sending the correct password and event from Girder 3.3.

Ron
May 23rd, 2005, 04:35 PM
If you are running on the same pc make sure you change the port number on either g3 or g4.

Mastiff
May 23rd, 2005, 04:37 PM
No, they are on two different pc's. Nothing else is using port 1024 on the G 4 computer, as far as I know. I have sendt commands from NetRemote to it, and that works.

Ron
May 23rd, 2005, 04:38 PM
I just verified here, it works.

Mastiff
May 23rd, 2005, 04:43 PM
I think it's the event device. On your Simple OSD test it says EventDevice 100, but that's not in the dropdown list. Also using that "bada" doesn't work. What device should this be using?

Ron
May 23rd, 2005, 04:49 PM
This event will not show up in the dropdown list unless the event comes in when the eventdialog is open. (This device does not exist in a standard way).

Really you should not be building on the IES anymore. Try upgrading to the comserver when you move to G4.

Mastiff
May 23rd, 2005, 04:53 PM
The thing is that my setup is dependant on a large degree of back and forth between different computers. Like waking everybody in the house up, that involves both the server and the HTPC, with different tasks. And I would like to try changing to G4 first on the HTPC, while the server could stay G3.3. Is there a way I could use to teach the HTPC to receive those events? Please. Pretty please. Pretty please with suger, honey and a twinkie on it! :roll: :P

Ron
May 23rd, 2005, 04:55 PM
yeah, just have the event dialog open while the event comes in.

Mastiff
May 23rd, 2005, 05:07 PM
Wanna hear something weird? When trying to add a new event, I get the problem with those buttons and the locked window again! I have it on some events, and it's not there on other events. I have it on some scripts and it's not there on other scripts. "AllowFloating" in DockLayout/6 is set back to 0, and if I set it to 1, start Girder, close it and then restart it, everything's back to where it should be. Then, a few dialog boxes later, the problem is back. Is that strange, or what?

And what position do I use to learn? I have tried "Predefined Events (all remotes)" and nothing seems to come in. Clicking "Learn" doesn't even make it look "clicked", is it supposed to stay down?

Mastiff
May 23rd, 2005, 05:17 PM
I'm off to bed here. But I will go back to an image taken before I even installed Girder 4 and install it from scratch, with version 18. Maybe that fixes some of my problems. You'll hear from me tomorrow (don't look so sad, when these few problems are solved I'll leave you in peace for a while!).

Mastiff
May 24th, 2005, 03:41 AM
OK, the full re-install is done. The UI problem is in it's own thread. But I still can't receive events from the Girder 3 instance. :cry: Did you try it with both on the same computer or with two different computers?

Ron
May 24th, 2005, 09:41 AM
I was using the same computer. ARe you sure you are using the correct password? Set in the scripting action.

Mastiff
May 24th, 2005, 10:59 AM
Yes, I changed the password from 'test' to 'girder' in one of the first lines of the script. There aren't more places it needs to be done?

Ron
May 24th, 2005, 11:08 AM
I've just tested it on two networked machines here and it works. However after a script reset it doesn't work anymore... So on a fresh Girder start things work.

Mastiff
May 24th, 2005, 11:20 AM
Then I'm very close to giving up... You think I should trust my server to G 4 yet? :wink: So far everything I have found of problems have been related not to running, but building the GML. And can G 3.3 and G4 live happily together on the same computer, with different GMLs?

Ron
May 24th, 2005, 11:22 AM
Don't give up just yet ;-) Wait a little.

G4 and G3 can live on the same pc just fine as long as you follow these guidelines ;-)

1. Don't use the same GML
2. Don't run them at the same time as they use the same hardware.

Mastiff
May 24th, 2005, 11:28 AM
By "don't give up" do you mean that you think you will make something that can talk reliably from G3 to G4, or just that I shouldn't contemplating giving up everything and becoming a cave dweller far into the norwegian wilderness?

Ron
May 24th, 2005, 11:31 AM
By "don't give up" do you mean that you think you will make something that can talk reliably from G3 to G4, or just that I shouldn't contemplating giving up everything and becoming a cave dweller far into the norwegian wilderness?

*grin* both.

Mastiff
May 24th, 2005, 11:33 AM
OK, then I'll wait...impatiently. Patience ain't my bag, dude... :wink: Any ETA at all?

Ron
May 24th, 2005, 11:40 AM
eta: now.

This stuff works for me both ways.

The default password is set to girder.
The default port is set to 1025.

Mastiff
May 24th, 2005, 12:44 PM
Perfect! Thank you very much! I will do more torturelike testing tomorrow (bouncing back and forth for an hour or so), but so far it looks flawless! Finally I can teach events as well! :D :D

Mastiff
May 25th, 2005, 08:10 AM
OK, the torture test turned out to be torture for G4... :wink: I created at test with a multigroup/macro where it first throws up a Popup OSD on G3 and Simple OSD on G4 and then sends the event string to the "conversation partner". So it's an infinite loop, or should be. It seems to work if I put in a 1 second wait between OSD and send action on both partners. Putting it on one of them isn't enough. After a while (from only a few seconds and up to a couple of minutes) it fails with this message:


WSAAsyncSelect failed: : Socket operation on non-socket (10038)
WSAAsyncSelect failed: : Socket operation on non-socket (10038)
Connection Closed: 192.168.0.1

And sometimes, instead of the regular "Listening to port" message, I see only "-3" in the console. What's that? If I change to port 1024 it will only show me that, and on that port it doesn't work at all.

Edit: No, it stops with one second as well, it just takes a little longer. Gonna try with two seconds.

Edit 2: Stops at 2 seconds as well, only waits longer. And when I tried to reset the Lua, it gave me this:

closed Listen Socket
Closed sockets
Error (Close): [string "GenericIP Code:\Internet Event Server\Load ..."]:113: attempt to index global `Connection' (a nil value)
Welcome to Girder!
-3


Edit 3: After a full restart of Girder 4 it has ran for 10 minutes without failing with a 2 second wait. Maybe it was "polluted" by the former crash?

Edit 4: OK, that failed after around 15 minutes. I think this has been enough edits for one day. :roll: Ron?

Ron
May 25th, 2005, 04:25 PM
Just move to the Communication Server. ;-)

Mastiff
May 25th, 2005, 04:30 PM
In bed, from PPC: You have a very evil streak. Do you know that? :cry:

Ron
May 25th, 2005, 04:34 PM
Sorry, I think people forget what a large project Girder actually is. (Just look at the scope of what it can do). I can't do it all :(

Mastiff
May 25th, 2005, 04:39 PM
Talk about shattered illusions ! For some years I have believed that you are all-powerful! :roll: :lol:

Ron
May 25th, 2005, 04:42 PM
Darn I lost my last follower. I guess the Church of Ron has finally met it's end. No more sunday services.

Mastiff
May 25th, 2005, 04:46 PM
Lucky for you I have a short attention span. Tomorrow I will forget this silly admission of yours and think you're omnipotent again! The bad news is that I'll probably have another problem by then... Good night, master! Sleepy time here.

Ron
May 25th, 2005, 04:50 PM
'night

Mastiff
May 26th, 2005, 07:01 AM
And good morning! I have now had the same "table tennis" between G3 and G4 going for more than three hours, this time with a 2 sec wait at the G4 end and 5 sec at the G3 end. So the problem has to do with the speed, not the amount of messages going back and forth. That's OK for now, until I can get on the comserver on both. You're back on the demigod list! :P

Edit: 3 1/2 hours, and it stopped. But since that means around 1500 messages back and forth, and I have around 15-20 every day, maybe 100 on days I use the home theater, a reboot of the computer every night around five would solve it.