DreamPi Software (DC <> Pi)

Discussion in 'Sega Dreamcast Development and Research' started by kazade, Sep 2, 2015.

  1. Jon

    Jon No longer active

    Joined:
    Nov 5, 2015
    Messages:
    50
    Likes Received:
    24
    @kazade -- no worries, I have 3 kids myself, so I tinker when I have time.
    I ordered another modem, to see if that eliminates my problem. I'm also pretty bad with the soldering iron, so I can try to make another phone line -- when I hook an old school handset up to my voltage-induced line, I hear some faint pops occasionally on the line underneath the dial tone. Line quality might explain connection problems...except that when I do get connected, it works great. Had a rousing session of Quake the other day, and my speed and ping were good.

    I will also collect and post logs for your inspection.

    On another note, I've been trying to find a way to reduce the number of wires and power sources involved.

    Today, I tried powering the Pi with the Maple Bus (controller port). Someone posted a photo of a Pi being powered via a keyboard adapter then a USB to PS2 adapter. I can report that this does not work -- at least not with a Pi2. Rather than use an adapter, I spliced a micro-USB wire to a controller extension cable directly. On a test, a clean 5Vs came off the maple bus, but the Pi wasn't happy. It would get part of the way through its boot cycle, then reboot. The Pi website says it needs 5v as 1.2amps, so perhaps not enough amps on the bus?

    (Update: in case you were wondering, the 5v from the Maple Bus is also insufficient for line voltage induction on the phone line)

    I then looked into all the other pin-outs on the Dreamcast, still with the intent of getting rid of at least one wire. The serial and expansion ports have only 5v power, seems safe to assume they're also insufficient for the Pi. The video-out port has a pin for 12v power, which seems like enough to do line-voltage induction. However, I can't think of a way to get it off the Dreamcast short of soldering it onto the DC itself -- which obviously would not be portable -- since in every cable I have, the 12v Pin is not present.*

    http://gamesx.com/wiki/lib/exe/fetch.php?media=schematics:dreamcast_connectors.pdf

    If there were a video extension cable ever made for the Dreamcast (male on one end, female on the other) it would be trivial to tap the 12v and ground wires, then have a removable, portable solution for line power -- particularly with some kind of snap-on connector. But I have been unable to find such a cable...

    *my vga box has this pin, but does nothing with it. I could tap that, but the VGA box is also bigger than a USB power supply, so does nothing to reduce complexity or size, so I abandoned this approach.
     
    Last edited: Nov 8, 2015
    Anthony817 likes this.
  2. Anthony817

    Anthony817 Familiar Face

    Joined:
    May 12, 2010
    Messages:
    1,078
    Likes Received:
    535
    @Jon Those were some valiant tries for powering it. If I end up getting a Pi I have a nice spare laptop AC adapter I guess I could try using to power the Pi and maybe even the line inducer. How are you powering the Pi atm?
     
  3. Jon

    Jon No longer active

    Joined:
    Nov 5, 2015
    Messages:
    50
    Likes Received:
    24
    Micro USB power with a Kindle Fire wall adapter (5v 1amp), and the 9V battery hanging off the phone line for line voltage. I was trying to figure out how to use one power adapter (like this) to power both, but I've reached the end of my electronics skills :) More of a software guy!
    I can follow instructions, though, so if you figure it out, post how!
     
    Anthony817 likes this.
  4. Jon

    Jon No longer active

    Joined:
    Nov 5, 2015
    Messages:
    50
    Likes Received:
    24
    @kazade here is a link to my syslog with a successful connection, then later an unsuccessful connection:
    https://dl.dropboxusercontent.com/u/1313988/DreamPiLog.txt

    Note that I let it try to connect until the Dreamcast timed out, but dreampi.py was still hung (trying?), so I had to hit Ctrl+C to cat the log -- not sure if that pollutes the log at all.
     
  5. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    3,034
    Likes Received:
    891
    @Jon, I like your avatar! But you should try to avoid double-posting. Use the edit function instead.

    I wonder if it'd be feasible to power the dreamcast, the pi and phone line all together using a picoPSU and a DC-DC boost for the phone line. This would be nice :).
     
    Anthony817 and Jon like this.
  6. Jon

    Jon No longer active

    Joined:
    Nov 5, 2015
    Messages:
    50
    Likes Received:
    24
    Quick update: you are not going to believe this (I don't myself) but, at line 239, you'd commented out send_command(modem, "AT+VLS=1") # Go online
    Well, I uncommented it, just to see what it did, and now my connection is 100% (5 out of 5 -- I'll do more tests if I can find the time.)
    Since that command returns an "ERROR" it seems likely this was just a timing issue. I'll leave that line uncommented, but I'll bet any command in there that added another second or two to the answering process would do the trick!
    Update to update: this was too good to be true, connection is inconsistent again after updating to 0.93 and making all the same changes...

    @-=FamilyGuy=- Got it, and thanks :)

    @kazade the DNS server on 0.93 doesn't seem to be working. Can you provide any information on how you configured it? For example, it looks like you're using DNSMasq (good choice) but in /etc/hosts there are no nameservers defined, as I would have expected, and attempting to restart DNSMasq returned an error.
    Additionally, after more spelunking, I found that PPPD was assigning a DNS server of 192.168.1.100 to any dial-up clients... I don't have a DNS server at that address, so that couldn't possibly work for me. Which would explain why Quake only works when I manually set its DNS to 8.8.8.8 (Google's) in the game -- and why nothing else worked. When I changed the PPPD options to use 8.8.8.8, Quake works with an auto-assigned DNS server... and 4x4 Evolution works for the first time ever!
    Any guidance on how you implemented DNS?

    Update: Dug some more, and I see that you've configured DNSMasq to look at /etc/resolv.dreampi.conf to add additional nameservers. Bypassing this allows games that don't need nameserver help (patched Quake 3, and 4x4 Evo) to work. If I leave the settings as you've configured, and moved my DreamPi to 192.168.1.100 on my internal network, it TRIES to work, but you end up with a DNS server race condition...

    For example, my patched Quake ends up getting directed to the Silverant Servers for DNS resolution, instead of the DCTalk Quake servers. Also it looks like you hard-coded the IP for DCTalk, which won't work for long -- even if that server wins the race. Here's the logs...

    https://dl.dropboxusercontent.com/u/1313988/DreamPIDNSLog.txt

    If you were to add some lines to /etc/resolv.dreampi.conf like this, it would allow Google to take DNS queries for servers that don't need custom DNS servers...

    server=/master.id-q3a.games.sega.net/8.8.8.8
    server=/dctalk1.servequake.com/8.8.8.8
    server=/authorize.quake3arena.com/8.8.8.8
    server=/motd.id-q3a.games.sega.net/8.8.8.8

    server=/master1.4x4evolution.com/8.8.8.8
    server=/master2.4x4evolution.com/8.8.8.8
    server=/master3.4x4evolution.com/8.8.8.8
    server=/master4.4x4evolution.com/8.8.8.8
    server=/master5.4x4evolutionc.om/8.8.8.8


    Or at least it should, but DNSMasq still seems to prioritize the other DNS servers... Gotta give up for the night...

    http://www.linuxsysadmintutorials.c...-different-nameservers-for-different-domains/

     
    Last edited: Nov 8, 2015
    -=FamilyGuy=- likes this.
  7. kazade

    kazade Spirited Member

    Joined:
    Jul 22, 2015
    Messages:
    155
    Likes Received:
    164
    So what should happen is the DNS lookup should try each of the name servers in turn until it finds one that can provide an address. I set the configuration in dnsmasq to respect the ordering. I guess this isn't working then? Just to clarify, do NOT set the Pi's IP to 192.168.1.100. When PPP connects that is the address given to the ppp0 interface, 192.168.1.101 is the IP of the Dreamcast. If you set the IP manually to either of those addresses you are going to have problems! :(
     
    Last edited: Nov 9, 2015
  8. Jon

    Jon No longer active

    Joined:
    Nov 5, 2015
    Messages:
    50
    Likes Received:
    24
    I agree that's what should happen, but it looks like what actually happens is that the Sylverant and Sonic Nameservers respond to any NSLookup and provide the same IP for every request. For example, if I query the Sonic server (192.185.5.9) directly:

    nslookup dctalk1.servequake.com 192.185.5.9

    the response is
    Server: 192.185.4.64

    Which is not a valid Quake server. If I ask it for any another domain, it gives the same response:

    nslookup www.google.com 192.185.5.9
    the response is also
    Server: 192.185.4.64

    Since those servers come first in the priority list, and since they return a result that appears to be valid, it doesn't move on to ask a server that can provide a real (usable) response...


    Update:
    Quake remains the only game I can reliably connect on (4x4 evo worked once). I re-arranged the priority of the DNS servers to make sure patched Quake gets a real DNS response. I can't try the other games cause they won't connect. I'll await a new modem (or 2) and try again. Until then, I'll just throw one more log out there.

    This log shows a good session with Quake, from dial-up through lobby (including working DNS) to intentional hang-up.
    Next it shows a bad session from 4x4 where the modem successfully connects, but the game rage quits the connection before getting to the lobby. It looks like there are send instructions, but no responses, so it hangs up.

    https://dl.dropboxusercontent.com/u/1313988/DreamPiSessionsLog.txt

    Update: I've been testing with an old PowerBook, since it has a modem and runs OSX. I've validated that the DNS server order is, in fact, a problem. I've been able to work around for Quake, Sonic, PlanetWeb, 4x4 Evolution (which still has another problem other than DNS) and Maximum Pool, by changing the order and adding some explicit servers (instead of nameservers), but Silverant and Starlancer are still problems...
     
    Last edited: Nov 11, 2015
  9. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    Well the DNS for dreampipe is just standard hostgator DNS. I parked the domains and redirected them on cpanel. So I don't see pinging the dc-t q3 masterlist working anyway


    Assuming the gateway IP of the pi is 192.168.1.1, couldn't you just setup a localdns server, and do all the domain parking and redirecting there? So instead of designing a DNS to query a certain external DNS when a certain address is pinged, just have an all in one DNS server hosted locally on the pi. And set the DC's dns to the pi's local IP. This could be more effective than an external DNS because the request could be redirected before it reaches the outside internet. For example the DNS redirection works for Sonic but not for dreamcast.planetweb.com. I still haven't figured out how to redirect that one properly

    I have never gotten starlancer to connect with netopia, I think the server itself works when it wants to. Or the guys at OC need to configure things differently


    Edit: If you do that, setup an SMTP server while you're at it. Modern SMTP servers for sending mail don't seem to work anymore likely because of new/high encryption SSL or different ports. I have a couple ideas to get creative with for dreampipe using the e-mail client. Along with another feature restored
     
    Last edited: Nov 15, 2015
  10. kazade

    kazade Spirited Member

    Joined:
    Jul 22, 2015
    Messages:
    155
    Likes Received:
    164
    Just a heads up that I am still fighting to find a spare hour to fix up the DNS issues that came in the last release - real life is not being kind to me ATM :/

    I also managed to determine that Quake 3 PAL uses TCP ports 1025-1027 for Dream Arena authentication - I have a partial implementation of a basic socket server and once that works I'll be able to begin reverse engineering the Dream Arena authentication. I don't suppose anyone knows of a REALLY cheap VPS host which allows opening specific ports? I can code this to run on the Pi itself but I thought it might be cool if there was a central replacement Dream Arena server then in future we could see who's online, with which games etc.
     
  11. kazade

    kazade Spirited Member

    Joined:
    Jul 22, 2015
    Messages:
    155
    Likes Received:
    164
    @TerdFerguson so the problem seems to be that your DNS server will always return something for any hostname. The idea *was* that if I just listed a load of upstream DNS servers then if one server didn't have an address, it would try the next one (e.g. it would try the slyverant DNS server, then the quake DNS server, then your one and finally fallback to Google's DNS).

    The problem is, your server seems to return an IP regardless (at the moment for me it's returning 192.185.5.88). Do you know if that IP is static? If so I can just manually add the DNS entries and remove your upstream DNS server. Also, do you have a list of the hostnames you support (I think it's just dreampipe.net, sonic.games.dreamcast.com and sega-europe.com if you added that one)?
     
    Jon likes this.
  12. Bad_Ad84

    Bad_Ad84 The Tick

    Joined:
    May 26, 2011
    Messages:
    8,566
    Likes Received:
    1,311
    Rather than doing a DNS lookup, why not host a text file on a website with the current IP(s), then just replace the hosts file on the pi at boot up with this?

    Means you dont need to host a VPS, dont need to open ports on said VPS or depend on a DNS server list (I assume someones ISP redirects non existant domains to their own landing page)?
     
  13. kazade

    kazade Spirited Member

    Joined:
    Jul 22, 2015
    Messages:
    155
    Likes Received:
    164
    To clarify, the VPS question was for hosting a custom authentication service - this is separate from the DNS issue. I think I've fixed things, I'll make a new image when I can.
     
  14. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    The IP hasn't changed so i'm guessing its static. The only redirection that really works is sonic.games.dreamcast.com. I added sega-europe.com for you if you want to test that. But I couldn't get the homepage redirection right for dreamcast.planetweb.com
     
  15. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
     
  16. Jon

    Jon No longer active

    Joined:
    Nov 5, 2015
    Messages:
    50
    Likes Received:
    24
    Sorry to go dark, I was at a conference all week. While I was gone two new conexant-based modems arrived. I tried them both, hoping to resolve my intermittent connection probs: One did not work at all (the python script wouldn't even start) and the other had a roughly the same success rate than my first modem (1 out of 4, instead of 1 out of 3)

    I'll move on to reconstructing my line voltage inducer, but it does seem to behave like a software issue. The script just hangs after ATA, and has to be control-C'ed, even after the remote device gives up and hangs up the line.

    On the name resolution issue, I'd be up for helping to establish a more permanent DNS solution that is community-managed, if we think that would help keep Dreamcast Online longer!
     
  17. kazade

    kazade Spirited Member

    Joined:
    Jul 22, 2015
    Messages:
    155
    Likes Received:
    164
    Here's an update! Hopefully this will fix some of the DNS and connection issues!
     
  18. kazade

    kazade Spirited Member

    Joined:
    Jul 22, 2015
    Messages:
    155
    Likes Received:
    164
    OK, that last release doesn't fix the DNS like I hoped. I've updated my configuration locally but I need to get a copy of Starlancer or something to test...
     
  19. Jon

    Jon No longer active

    Joined:
    Nov 5, 2015
    Messages:
    50
    Likes Received:
    24
    Alright, so I did a fresh re-image of my Pi SD card with the 0.94 image, built a brand new line voltage inducer -- with some of the best soldering I've ever done (which isn't saying much, but I'm pretty sure its as close to perfect as I'll ever get) -- and I've tried 3 different modems. Still get intermittent connection. At this point, I think I may give up on DreamPI and just spring for a BBA, then work out a local-network DNS solution to get all the games working.

    I've ended up building a pretty complex debugging station, so I can both see and hear what's happening on both the client and server sides, using an old phone, and a PowerBook with a modem to simulate the Dreamcast's behavior. Like the Dreamcast, it works about 1 out of 3 times, and when it does work, I can surf the web and everything from the old gal. I'll update this post with some videos, showing everything that happens, as well as post new syslog records in the new 0.94 format.

    @kazade if you're willing to take a look, I'd be willing to ship you all my kit, and let you try to reproduce by testing each of the parts I'm using against your working solution. I'd be happy to also ship a retail copy of Starlancer along with it, if you don't want to just grab the CDI from the usual suspects. Its a game worth having in your collection.

    Update:
    Here's a video of a bad connection attempt
    Here's a video of a good connection attempt
    Here's the log of both.

    You'll see that aside from the dialing device eventually giving up -- and me subsequently hitting ctrl+c on the Pi, there's nothing in the video or log that indicates what's going wrong. It just fails.

    Update Update:
    Tried all this without the dial tone being transmitted -- success! It works!!

    I get almost a regular 4/5 successful connections without the dial tone -- blind dialing from the Mac. Of course that doesn't help me, cause most games won't blind dial, but it does seem to isolate the problem!
     
    Last edited: Nov 24, 2015
  20. kazade

    kazade Spirited Member

    Joined:
    Jul 22, 2015
    Messages:
    155
    Likes Received:
    164
    OK so it seems there are still issues with no properly resetting the modem after sending the dial tone. Apparently what I have works fine with my modem, but not others. I'll take a look.

    As for the DNS stuff - I've asked someone to test various things for me and now I believe there is another problem with Starlancer and 4x4 Evolution. I think these games require the "default-asyncmap" setting which I removed because it apparently isn't necessary on PSO and DreamKey, but actually breaks Quake 3.

    @Jon If you fancy testing one final thing for me, could you add "default-asyncmap" to /etc/ppp/options and then try Starlancer? Also could you tell me the models of the USB modems that you've tried?

    As for sending me your stuff, I can't possibly expect you to do that! Don't give up on this yet, I'll get it working... it'll just take some time.

    And on that note, if anyone wants to help me financially so that I can get this stuff working better and faster, I've set myself up on Patreon. I'd appreciate any help, even if it's just a dollar or two!
     
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page