Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Page 1 of 3 1 2 3 >
Topic Options
#65767 - 02/02/2002 08:52 Hybrid8's Hosts File Idea (rubbing the lamp)
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31596
Loc: Seattle, WA
Over in another forum, Hybrid8 had a great idea. I don't have the time to invest in creating this piece of software, but I'd like to see if anyone else wants to tackle it. For me, it would need to be a Windows implementation, I'm not sure whether Hybrid8 would need it under Windows or under Linux.

The idea:

Some of us plug our empegs into DHCP networks. In many cases, dynamic DNS is not supported. In fact, both of the networks I plug into are DHCP but without dynamic DNS. So my empeg does not resolve to a name.

Since the player's IP address changes on every boot, and we can't resolve it to a host name, we can't easily run certain third-party ethernet utilities. For example, if we want to connect to Mark Lord's HTTP interface with our web browser, we first need to run Emplode and transcribe the IP address shown in the discovery dialog box.

Bruno's simple idea was as follows:

For me, a simple solution would be a small app that would find out what the empeg's assigned IP is, and toss it into my HOSTS file along with an alias.

This can be done!

There's already some open-source code for discovering players on the network with a broadcast. It's part of the Emptool and Jemplode sources. You could run this broadcast without displaying a user interface, and simply grab the IP of the first player you found that matches your criteria (more below). Throw that into the hosts file with a predetermined name.

One thing, though: You would have to spec what the player's configured name was. Reason: There might be more than one player on the network. For instance, on my home network, Jemplode finds both the Jupiter and the Empeg, and you can never be sure which one shows up in the discovery dialog first. So I would have to be able to spec that this program only grabs the IP for a player named "Tony's Mark 2".

The other thing you'd have to spec to this program is what you want the player's ethernet hostname to be. For instance "empeg.mynetwork.com".

But those are the only two inputs the program would need, and then it could append/replace that data in the hosts file. By the way, it should handle a large hosts file... mine is huge because I'm doing the trick where you fill your hosts file with known ad-server names and resolve them to 127.0.0.1 (works great by the way).

Then I could put this program in my startup group or on my desktop, and after it runs, I should be able to connect to my empeg by name.

So, anyone want to tackle this?
_________________________
Tony Fabris

Top
#65768 - 02/02/2002 10:03 Re: Hybrid8's Hosts File Idea (rubbing the lamp) [Re: tfabris]
hybrid8
carpal tunnel

Registered: 12/11/2001
Posts: 7738
Loc: Toronto, CANADA
First, let me start at the end...

Tony, mind passing me the bulk of the AD server host names from your HOSTS file? This is an awesome idea and I don't know why I didn't think of it. My hosts file had only one item in it: a remaping of an NNTP server.

Other than checking on player name to distinguish players, it would (I suspect) also be possible to identify individual players based on their hardware address. During setup of this small app, it would be nice for it to display this, allowing you to configure the mapping. Right now it's available (along with the fixed or assigned IP address) on the Player's About menu screen - it scrolls by too fast for me

I'd also need this little program for Windows. Ideally, once configured, I'd like to be able to just launch it with a double-click or from a toolbar. It should do its business and end itself transparently. Not popping up any dialogs. For configuration, it might be able to support a command line switch to cause a dialog to come up identifying the players and letting you fill out the needed information. Or we could just put that information manually into a config text file next to the executable.

I'd probably prefer it to use a small text file for its config, not the registry, and hopefully it won't have any dependencies on any dlls or other files.

Lastly, thanks for bringing this up in here.

Bruno
_________________________
Bruno
Twisted Melon : Fine Mac OS Software

Top
#65769 - 02/02/2002 10:31 Re: Hybrid8's Hosts File Idea (rubbing the lamp) [Re: tfabris]
Yang
addict

Registered: 14/01/2002
Posts: 443
Loc: Raleigh, NC
I made an attempt to compile the emptool under cygwin (latest as of yesterday) and ran into lots of imcompatibilities. Perhaps I have BUILD or ARCH defined wrong, but I'm getting lots of compile errors, and my C++ skills aren't as sharp as they used to be. I was thinking of trying to decypher what the discovery code was doing and somehow port this to annother language that would be cross-platform compatible (as this C++ aparently isn't under my environment)..

Top
#65770 - 02/02/2002 11:29 empeg protocol [Re: Yang]
Jazzwire
addict

Registered: 09/06/1999
Posts: 483
Loc: Guernsey
Has anyone produced a description of the empeg protocol?
I've spent countless hours looking at the source to emptool and Jemplode, but I don't read Java or C++ very well, so haven't got very far.

I tried to compile emptool so I could work through the connection stuff, but it won't compile for me in windows either... (Well, that's not quite true, it compiles, but doesn't do anything when run)

So, what I'm requesting is a high level description of the empeg ethernet protocol (I send X on port A, and expect Y on port B kind of stuff...)

Anyone got anything I can use?
_________________________
Jazz (List 112, Mk2 42 gig #40. Mk1 4 gig #30. Mk3 1.6 16v)

Top
#65771 - 02/02/2002 12:19 Re: Hybrid8's Hosts File Idea (rubbing the lamp) [Re: hybrid8]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31596
Loc: Seattle, WA
Tony, mind passing me the bulk of the AD server host names from your HOSTS file? This is an awesome idea and I don't know why I didn't think of it.

Did you by any chance try clicking on the highlighted word "TRICK" in the message I just posted?
_________________________
Tony Fabris

Top
#65772 - 02/02/2002 12:21 Re: Hybrid8's Hosts File Idea (rubbing the lamp) [Re: tfabris]
hybrid8
carpal tunnel

Registered: 12/11/2001
Posts: 7738
Loc: Toronto, CANADA
Damn you.

Bruno
_________________________
Bruno
Twisted Melon : Fine Mac OS Software

Top
#65773 - 02/02/2002 12:25 Re: empeg protocol [Re: Jazzwire]
mcomb
pooh-bah

Registered: 31/08/1999
Posts: 1649
Loc: San Carlos, CA
So, what I'm requesting is a high level description of the empeg ethernet protocol

As far as I know nobody has done that, but I may be able to point you in the right direction in the JEmplode sources. Take a look at org/jempeg/empeg/protocol/NetworkEmpegDiscoverer.java it sends a broadcast UDP packet containing "?" to the network on port 8300. Any empegs on the network send a packet back that includes a name and id (I assume you can select an empeg based on one of those values).

Actually I may have some perl code floating around that does this as well (trying to find out why an older version of jemplode would not find my player) if anybody wants it.

-Mike
_________________________
EmpMenuX - ext3 filesystem - Empeg iTunes integration

Top
#65774 - 02/02/2002 12:40 Re: empeg protocol [Re: mcomb]
Jazzwire
addict

Registered: 09/06/1999
Posts: 483
Loc: Guernsey
If you've got something in perl, that would be great... =)

I got as far as broadcasting "?" over udp to port 8300, but so far I'm not getting any reply (at least none I can see). I was confused in the java code that it started using the PROTOCOL_TCP_PORT constant (also 8300) to open a new socket connection. Am I supposed to open a TCP server on 8300 for the empeg to reply to, or is that constant used for something else?
_________________________
Jazz (List 112, Mk2 42 gig #40. Mk1 4 gig #30. Mk3 1.6 16v)

Top
#65775 - 02/02/2002 14:59 Re: empeg protocol [Re: mcomb]
Yang
addict

Registered: 14/01/2002
Posts: 443
Loc: Raleigh, NC
Sadly, I'm a better perl programmer than I am C or C++.. So some perl source would be awesome.. I also never have to worry about cross-compilation.. Heck, I couldn't even get the cross-compiler to work in Mandrake 8.1..

Top
#65776 - 02/02/2002 15:44 Re: empeg protocol [Re: Jazzwire]
mcomb
pooh-bah

Registered: 31/08/1999
Posts: 1649
Loc: San Carlos, CA
If you've got something in perl, that would be great... =)

OK, attached is a bit of perl to get you started. I am not a very good perl programmer so it is ugly. This sends a UDP packet to a given IP and dumps the response out. Set the variables $local_host and $remote_host near the top to your computers IP and your empegs IP address and you will get back the empegs name and ID. You are on your own getting broadcast to work since I am not sure how to do that in perl.

-Mike


Attachments
64296-test.pl.txt (172 downloads)

_________________________
EmpMenuX - ext3 filesystem - Empeg iTunes integration

Top
#65777 - 02/02/2002 15:54 Re: empeg protocol [Re: mcomb]
Jazzwire
addict

Registered: 09/06/1999
Posts: 483
Loc: Guernsey
Thanks, I'll give that a go.
_________________________
Jazz (List 112, Mk2 42 gig #40. Mk1 4 gig #30. Mk3 1.6 16v)

Top
#65778 - 02/02/2002 16:02 Re: Hybrid8's Hosts File Idea (rubbing the lamp) [Re: tfabris]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
Anybody got the Cygwin libraries? I've written a small program that should do what you want but I need somebody to test it.

There's a bug in it that sometimes it doesn't find the player. I'm not sure if it's just my weird network configuration or what.

- Trevor

Top
#65779 - 02/02/2002 16:13 Re: Hybrid8's Hosts File Idea (rubbing the lamp) [Re: tman]
hybrid8
carpal tunnel

Registered: 12/11/2001
Posts: 7738
Loc: Toronto, CANADA
I've got cygwin installed. Along with gcc (working at least for basic stuff). Fire away and I'll try out your program.

Bruno
_________________________
Bruno
Twisted Melon : Fine Mac OS Software

Top
#65780 - 02/02/2002 16:26 Re: Hybrid8's Hosts File Idea (rubbing the lamp) *DELETED* [Re: hybrid8]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
Post deleted by tman

Top
#65781 - 02/02/2002 16:38 Re: Hybrid8's Hosts File Idea (rubbing the lamp) [Re: tman]
hybrid8
carpal tunnel

Registered: 12/11/2001
Posts: 7738
Loc: Toronto, CANADA
Seems to be working for me. I had my empeg on a static address, so I'm reconfiguring it for dynamic. For some reason the disk integrity is being checked while syncing (even though I have Hijack set to disable that). This is going to be a while.

Bruno
_________________________
Bruno
Twisted Melon : Fine Mac OS Software

Top
#65782 - 02/02/2002 16:43 Re: Hybrid8's Hosts File Idea (rubbing the lamp) [Re: hybrid8]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
I think it's just XP as per usual. My network configuration is really flakey in XP and I've also got troubles with dialup not disabling the interface when I've disconnected so it screws up my ethernet.

I've tested it again and it works properly now. I'll add the hosts bit now.

- Trevor

Top
#65783 - 02/02/2002 17:04 Re: Hybrid8's Hosts File Idea (rubbing the lamp) [Re: tman]
bonzi
pooh-bah

Registered: 13/09/1999
Posts: 2401
Loc: Croatia
Works here!
_________________________
Dragi "Bonzi" Raos Q#5196 MkII #080000376, 18GB green MkIIa #040103247, 60GB blue

Top
#65784 - 02/02/2002 17:31 Re: Hybrid8's Hosts File Idea (rubbing the lamp) [Re: tman]
hybrid8
carpal tunnel

Registered: 12/11/2001
Posts: 7738
Loc: Toronto, CANADA
Holy crap. After a 45 minute (at least! I was also encoding mp3s in the background...) config check with emplode I was finally able to power cycle my player. Seems to be working fine with dynamic IP. First shot's the charm each time.

I'm looking forward to seeing the next version when you have the HOSTS writing done. Are you going to go with an intermediate step and just support a single player? If you keep the program completely command-line driven it can still work well. A simple command like to spec multiple players and any additional players that are found could (should) be be nound with a default name.

Then it's just a matter of making a shortcut to your program with the needed command line options and putting it somewhere convenenient (for me, that's next to my dialing button in one of my tool bars )

BTW, how do you find out what your broadcast IP would be on a corporate LAN?

Bruno
_________________________
Bruno
Twisted Melon : Fine Mac OS Software

Top
#65785 - 02/02/2002 17:32 Re: Hybrid8's Hosts File Idea (rubbing the lamp) [Re: tman]
number6
old hand

Registered: 30/04/2001
Posts: 745
Loc: In The Village or sometimes: A...
Works fine on my XP system, but only reports the first empeg that answers - is this the way it works?
[If I run it multiple times then the other empeg on my lan answers sometimes].

Top
#65786 - 02/02/2002 17:51 Re: Hybrid8's Hosts File Idea (rubbing the lamp) [Re: number6]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
Yeah. That's the way it works. If you want it to listen until it times out then give it the -s argument with an invalid serial number. I haven't tested this bit since I've only got 1 empeg but it should work.

There should be help in the program

- Trevor

Top
#65787 - 02/02/2002 17:54 Re: Hybrid8's Hosts File Idea (rubbing the lamp) [Re: hybrid8]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
I think I'll keep it that it only does 1 empeg at a time. Specifying the arguments could get quite complicated otherwise. I may change this later on though if you really want it.

You should be able to work out what the broadcast address is by typing ipconfig.

Anyway, I'm nearly done. Just tidying up a little and testing at the moment.

- Trevor

Top
#65788 - 02/02/2002 18:02 Re: Hybrid8's Hosts File Idea (rubbing the lamp) [Re: tman]
hybrid8
carpal tunnel

Registered: 12/11/2001
Posts: 7738
Loc: Toronto, CANADA
One unit is fine for me. My brother also has one, but it's never been on the network at the same time as mine yet. I was mostly thinking of others who have a whole collection of empegs connected at once.

Bruno
_________________________
Bruno
Twisted Melon : Fine Mac OS Software

Top
#65789 - 02/02/2002 18:31 Re: Hybrid8's Hosts File Idea (rubbing the lamp) [Re: hybrid8]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
Okay. I've finished now and it seems to work for me.
Before using it PLEASE backup your hosts file first!

This is what you should run:

findempeg -s40103318 -hc:\windows\system32\drivers\etc\hosts -nempeg

findempeg -? should give you the options it takes

Please tell me if it works!

- Trevor


Attachments
64348-findempeg.exe (79 downloads)


Top
#65790 - 02/02/2002 19:24 Re: Hybrid8's Hosts File Idea (rubbing the lamp) [Re: tman]
TheAmigo
enthusiast

Registered: 14/09/2000
Posts: 363
Error Starting Program
"A required .DLL file, CYGWIN1.DLL, was not found."
_________________________
--The Amigo

Top
#65791 - 02/02/2002 19:28 Re: Hybrid8's Hosts File Idea (rubbing the lamp) [Re: TheAmigo]
hybrid8
carpal tunnel

Registered: 12/11/2001
Posts: 7738
Loc: Toronto, CANADA
That might explain why Trevor wrote:
    Anybody got the Cygwin libraries? I've written a small program that should do what you want but I need somebody to test it.


You'll need the cygwin dll (perhaps more than one) or the source code to recompile for windows.

Bruno
_________________________
Bruno
Twisted Melon : Fine Mac OS Software

Top
#65792 - 02/02/2002 19:28 Re: Hybrid8's Hosts File Idea (rubbing the lamp) [Re: TheAmigo]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
You need the Cygwin dll to run it. It's here

- Trevor

Top
#65793 - 02/02/2002 19:43 Re: Hybrid8's Hosts File Idea (rubbing the lamp) [Re: tman]
hybrid8
carpal tunnel

Registered: 12/11/2001
Posts: 7738
Loc: Toronto, CANADA
Seems to be working quite well for me with the one player.

Will running it with only the broadcast address now id all players on the network? Even though it only supports command line options for one player, it would be nice to be able to just get back the id info for all.

The only problems I've had are with a HUGE (200k+) hosts file. When activating a change, the whole file seems to get reparsed by windows and this causes a major slow-down of my entire machine. While the file is being processed by windows your program obviously can't get a lock on it to make its modifications.

I'll see how it all works out after a reboot as this will more closely mimic my normal operation.

Bruno
_________________________
Bruno
Twisted Melon : Fine Mac OS Software

Top
#65794 - 02/02/2002 19:51 Re: Hybrid8's Hosts File Idea (rubbing the lamp) [Re: hybrid8]
tman
carpal tunnel

Registered: 24/12/2001
Posts: 5528
Well. It IDs them until it can't find anymore or it finds the one it's looking for. It's easy enough to make it continue to display them though. I'll make a v1.1 later on with it.

I'll have a look at any way of getting around that problem about large files. At the moment it just creates a new file and then moves it over.

How long does this slow down last BTW?

- Trevor

Top
#65795 - 02/02/2002 19:57 Re: empeg protocol [Re: mcomb]
TheAmigo
enthusiast

Registered: 14/09/2000
Posts: 363
Here's mod mods to the perl version.

This version doesn't need to know the IP of your empeg or the local host. To make up for not knowing the empeg's IP before you start, it prints the IP that it gets the response from.

Disclaimer: I've never programed for sockets before so while I know the theory, I don't know the implimentation details and found the snippets that I added on the web.... they may be wrong, but seem to work for me.

Bugs: I get the following error:
Use of uninitialized value at /usr/lib/perl5/5.00503/i386-linux/Socket.pm line 298.

Not sure why, maybe someone else can point out the problem.

Still needed: a timer. Have it quit waiting after a few seconds.

Untested: I only have one empeg... does it work as expected with multiple?


Attachments
64371-empegfinder.pl (207 downloads)

_________________________
--The Amigo

Top
#65796 - 02/02/2002 20:09 Re: Hybrid8's Hosts File Idea (rubbing the lamp) [Re: tman]
hybrid8
carpal tunnel

Registered: 12/11/2001
Posts: 7738
Loc: Toronto, CANADA
I think with the partial add-blocking list I got from the URL Tony posted, it takes a few minutes to process.

I've trimmed down my hosts file to pretty much nothing to do some testing. I've made a shortcut and it pops up a window for only a split second. Excellent.

After I reboot I'll put back the large hosts file and check out the impact. The moving/recreation of the hosts file is what may be causing it to re-initialize the entire list. That may be a limitation of the way the whole thing works though. I'll test it by adding one line with a text editor and see if the whole thing slows down again.

Bruno
_________________________
Bruno
Twisted Melon : Fine Mac OS Software

Top
Page 1 of 3 1 2 3 >