Jump to content
ants

Wifi Extension Development Thread

Recommended Posts

icon.png.d5ee5c24798cd731ffc389d6fcc69b67.png Building a Wifi Extension for 68k Macs

 

I've previously posted a few hardware hacking projects where I retrofitted a Vonets VM300 Wifi card into a SE/30 and a Colour Classic. They work pretty well, but configuration has always been a pain as you need to do it from a Modern Mac or PC using a web browser.

 

To solve this, I want to build a native Mac extension to connect to wifi networks - Ideally just like you would on a modern Mac. @hfrazier has already done a lot of groundwork on figuring out how to communicate with the VM300 using HTTP requests, and I've made a start on writing the extension.

 

It's on GitHub here: https://github.com/antscode/MacWifi, and a compiled version is attached to this post if you want to test it out.

 

So far the extension doesn't do much except look pretty:

 

wifi-1.png.6bafccd70064f2040a4eab0a43c51b33.png wifi-2.png.f871b983b513980e9564510a07c7da54.png

 

I'm hoping to incorporate the work that @hfrazier has done to actually make this functional.

MacWifi.sit

Share this post


Link to post
Share on other sites

This is awesome! Some of that C code looks very foreign to me as I do plenty of C for the PIC but not a 68K running System 7!

 

..I was going to try to whip up a page you could open in Netscape 4 but I would definitely much rather prefer the system extension route!...

https://web.archive.org/web/19971015221942fw_/http://developer.netscape.com:80/one/javascript/index.html

 

I'll see what more I can get done after work today (and try to import your sln into Visual Studio.)

Share this post


Link to post
Share on other sites

@hfrazier the C code is fairly foreign to me too. I've been learning Mac programming in my spare time over the last year, so I'm only just getting the hang of it. I will port the code to C++, which is a lot closer to C# (i'm a .NET dev).

 

If you're keen to try compiling the code using Visual Studio and Retro68 that'd be great - but if you want to keep going down the Javascript route to figure out the HTTP requests and responses then that would also be very helpful.

 

There's some instructions on compiling Retro68 in the readme. It's a bit painful, but once it's compiled you're off and running.

Share this post


Link to post
Share on other sites
Quote

I will port the code to C++, which is a lot closer to C# (i'm a .NET dev).

Works for me!

 

I code in C, C++ and C# ASP.Net Core 2 MVC for my job right now (various pieces of hardware, 16-Bit PIC, ESP32, Intel of course, all for an IoT Platform) so I'm right there with ya! Mostly 'grew up' on asp.net and java. Most of my C experience though is on the PIC in MPLabX so my knowledge may be limited...

 

Quote

but if you want to keep going down the Javascript route

I would say we shouldn't waste our time.. But then again... since I am, comparatively, way less familiar with the System 7 API (or whatever) then it may be more efficient for me to strip the it all down to the basics and implement it in Javascript 1.2 so that you can study it and re-implement it. We'll see how it goes. Nevertheless, this is exciting.

 

Tomorrow (or by early next week) I will try to get VS working with Retro68!

 

Edit: I also have a problem:

Until now I have been connecting my SE/30 with a MacCon just via ethernet.. I expected the Vonets to work, but even with setting it to 10MBps/HalfDuplex it does not.... I also have a 'Mystic' Color Classic with a Farallon NIC so I'll try it with that.

Edited by hfrazier

Share this post


Link to post
Share on other sites

Compiling Retro68 can take hours, so ensure you've installed all of the dependencies in Cygwin. To help, I've attached a screenshot of all the packages I have installed - there's nothing more frustrating that sitting through 2 hours of compilation for it to crash out and you have to start over again. Also ensure you've got at least 9GB free on your drive - it's huge.

 

With your Vonets issue, are you a getting a solid link light on your ethernet card? If it's flashing, it'll be a connection issue between the card and the wifi module (which is usually fixed with 10MBs/half duplex).

 

If you've got a solid link light, then it'll be a TCP/IP issue. In Open Transport are you requesting an IP address via DHCP, or are you using a static IP? On both my macs I just use DHCP.

 

I also have a Farallon card in my Colour Classic, so if need be I can screenshot all of my settings on both the Mac and the wifi module...

cygwin.PNG

Share this post


Link to post
Share on other sites

Ok, thanks for the tips!

 

Also, yes the link light seems to go off and then back on at a consistent rate... Even with manually setting it to 10M/Half Duplex makes it blink off and on... Looking like a link/connection re-try would behave.

 

I have the Asante MacCon for the SE/30. Which NIC do you have?

Share this post


Link to post
Share on other sites

I have a DaynaPort card. I also have an Excelan card but I haven't tried it out yet.

 

Can I just confirm that you are connecting the wifi module to your NIC via the supplied USB cable and not the RJ45 port on the wifi card? (I made that mistake at first)

 

From the Vonets datasheet:

 

vonets-connection.PNG.0e68889f9e375329a0f2f933793f1a05.PNG

 

Failing that, perhaps the Asante card is actually full duplex? Have you tried all duplex settings in the Vonets config to see if the link light comes on solid?

Share this post


Link to post
Share on other sites

Small update: I had a play with issuing HTTP commands directly from a Mac application (using a HTTP client I've written in the past). The good news is that I was able to communicate with the module via http://vonets.cfg - I was worried that the DNS resolution wouldn't work on the mac, but it did.

 

However I hit a weird issue that's doing my head in - the web server on the Vonets card always returns a HTTP 404 not found for any page that I access via my Mac. For example, if I try a GET request to the login page: http://vonets.cfg/a.asp I get a 404 - but if I hit it from my laptop it works fine.

 

I traced the HTTP requests coming from the Mac using Wireshark and Fiddler - and from what I can see, they are identical to the requests from my PC.

 

I'll sleep on it for a few days and hopefully the solution will come to me...

Share this post


Link to post
Share on other sites

Strange. Also sorry I've been MIA.. Been quite busy the past few weekends. It seems that it still won't work even set to full duplex... It even freezes my TCP/IP control panel for some reason. I'll keep messing with it.

 

One thing I noticed is that it will block out another machine if you've logged in from another and not logged out. If you had already logged in from your laptop it may be blocking it. Although I see no reason why it would be a 404 in stead of a 200 and an error message in the page so maybe that doesn't make sense.

Share this post


Link to post
Share on other sites

Also, just thinking... there are a few other options out there. If the Vonets proves to be too difficult maybe there is a better solution. The Menu extension can continue to be developed as we search for other adapters.. or even make the extension compatible with several different adapters. I'd definitely be willing to order and test one of these.

 

https://www.amazon.com/IOGEAR-Universal-Ethernet-Adapter-GWU627/dp/B004UAKCS6/

https://www.amazon.com/IOGEAR-Ethernet-2-WiFi-Universal-Wireless-GWU637/

https://www.amazon.com/TP-Link-Wireless-Travel-Extender-TL-WR802N/dp/B00TQEX8BO

 

 

Share this post


Link to post
Share on other sites

That's a real shame that 10mb/full duplex didn't resolve the issue for you. Are you able to connect to other devices via ethernet on your SE/30?

 

I also discovered the same issue with logging in via multiple devices - at first I thought that was the issue, but the response code is 200 and not 404. My current thought is that it could be something more low-level, like TCP packet size or something - I'll keep playing. Weirdly, if I hit http://vonets.cfg/b.html I get a 200 response - it seems to only be the .asp pages - I don't know what to make of that?!

 

I agree that the extension should be able to work with multiple adapters - although I think that we might be hard-pressed to find another adapter that allows us to manually set the Speed & Duplex. The modern "autonegotiate" standard didn't come out until '95. Before buying anything, perhaps see if you can find a PDF user manual or something that describes the available settings.

Share this post


Link to post
Share on other sites

Is it possible to use something more standard like a Raspberry Pi as a bridge? They're high quality, cheap, and likely to be supported for a long time. They could also convert HTTPS traffic to HTTP, or do web rendering with static images to make the web browsable on old systems (https://virtuallyfun.com/wordpress/2014/03/11/web-rendering-proxy-update/). OpenWRT exists for the pi as well: https://wiki.openwrt.org/toh/raspberry_pi_foundation/raspberry_pi

 

Not sure if it supports correct speed/duplex for old 10bt cards though.

 

As a broader point, there's a lot of one-off hardware to manage the variety of connectivity needs for old Macs, and it makes me wonder if there's a more general purpose way to go about solving these problems. RPi's have USB, BT, Wifi, and GPIO and are extremely well supported on the software side.

Edited by nickpunt

Share this post


Link to post
Share on other sites

@nickpunt thanks for your input - it's definitely worth considering a Raspberry Pi, or maybe an Arduino board. A while back I thought these boards would be overkill - i.e when is a vintage Mac no longer a vintage Mac? But the idea of also having a HTTPS proxy inbuilt would be really cool.

 

I've also had a crazy idea of using a Rasberry Pi as a "poor man's accelerator" - i.e. install BasiliskII on it to run code - but I digress...

 

Finally, if there was a way to interface the Mac to a Raspberry Pi without the need for an Ethernet card, that would be awesome - as some cards are rare as hen's teeth... Although I'm not a hardware engineer by any means.

 

But for now, in an attempt to get something working, I'll keep on slogging away at the Vonets card.

Share this post


Link to post
Share on other sites

Sounds like a reasonabla plan, I've been watching your progress with great interest. I hope to get my toy from Vonets up and running one day.

 

The Pi angle is great food for thought though. Mac emulation would probably be beyond the pale, but co-processing just about anything should be fair game. Think of Pi as an interactive DSP with Swiss Army I/O resources?

Share this post


Link to post
Share on other sites
14 hours ago, ants said:

Actually, if we were to look for a replacement card - we could try one that supports OpenWRT (https://openwrt.org/). I've never used it, but I'm pretty certain OpenWRT lets you set the speed & duplex.

 

e.g. the TP-Link TL-WR703N can apparently be re-imaged to use Open WRT: https://www.nemik.net/blog/2011/12/arduino-openwrt-art/

 

Ohhh, this looks promising. I had looked at openWRT as an option. Good idea to look through their website.

 

And yeah, my Netgear ProSafe switch will automatically connect to the MacCon without a hitch. It will even automatically go to 10Mbps

Share this post


Link to post
Share on other sites

I like OpenWRT because you can write your own scripting to run on it to catch commands from the Mac extension your writing, or use a built-in API. 

 

That way the extension could periodically scan for non-associated APs and its signal strength and list them in the dropdown. Just like modern macs. 

 

As far as hooking up a Pi to the bus without the ethernet, this has been an idea I have been logging around for a very very long time. I want to do this so I can use it as a co-pro for accelerating Javascript, etc so you can browse the modern internet on an older mac with some "decent" speed. 

 

But unlike you guys, I am only adept in one type of programming language and that was VB6, which luckily there were newer dev environments I have migrated to that kept a similar syntax. 

 

C, etc over my head. :-(

 

As far as hardware engineering thats the easy part. The programming that links the two, Not so much... 

 

For bus access, there were a couple different ideas that I had. One is just using simple hardware decoding and memory mapped I/O, sharing memory space on the address bus that the Pi can see, and vice/versa, with a program running on the Pi to catch read/writes to that address block. 

 

The other idea which is more slick is the Pi itself attached to the bus as a Co processor in such that you can send F Line instructions and the Pi would catch and execute these. 

 

In this case you could have a program running on the Pi that has a plethora of custom F-Line instructions that the ARM could execute when the 68K issues them to the CoPro address space. I think I recall when reading the 68K manual you can have more than 1 co processor. So you could map the Pi as a 2nd co processor in a machine that doesnt have one. 

 

Otherwise, you could emulate the regular 68K copro on the Pi, as well as having an additional instruction set to make things more powerful. 

Edited by techknight

Share this post


Link to post
Share on other sites

Dunno if it's any help, but the 68030 MMU is a less powerful subset of the discrete MMU used in the Mac II. ISTR reading something along the lines of implementing the full blown MMU for use with the 68030. Could that be a wedge point for Pi?

Edited by Trash80toHP_Mini

Share this post


Link to post
Share on other sites

@hfrazier I figured out my 404 issue - turns out a GET request should not include the host in the path unless it's through a proxy, i.e:

 

Wrong:

GET http://vonets.cfg/a.asp HTTP/1.1
Host: vonets.cfg

 

Right:

GET /a.asp HTTP/1.1
Host: vonets.cfg

 

The reason I didn't pick it up is because Fiddler was lying to me! Fiddler actually manipulates the GET request and appends the host to the path - even in Raw view. I just happened to pick it up in Wireshark when comparing the raw TCP data between my Mac and my PC. I've never had a server deny the first request before, but it seems the Vonets module is particularly fussy.

 

Anyways, good news is that I have actual communication between a native Mac app and the Vonets module - so the rest should be a walk in the park hahaha...

 

As for OpenWRT I'm happy to give it a go - the good thing is that if we adopt that standard, then maybe any compatible device will work with our extension. That'd be cool.

Share this post


Link to post
Share on other sites

@techknight and @Trash80toHP_Mini, what you are suggesting is exciting and scary - perhaps we need a new thread for Raspberry Pi acceleration! What's most exciting in my opinion is that it would allow many people to speed up their old macs, as cards like Daystar Turbo's are near impossible to find these days.

 

But i'm going to take baby steps and try and get a working Wifi connection first.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×