Showing posts with label PPPd. Show all posts
Showing posts with label PPPd. Show all posts

Friday, December 14, 2018

ESP32 internet modem with PPPD and secure Contiki webbrowser

I have been working on a internet modem for the ESP32 that can be used with a wide variety of computers, some more retro than others. Here are some expected use cases:

  • Apple II without TCP/IP connects with a VT52 or VT100 terminal.
  • Old Macintosh with TCP/IP stack, but no ethernet card, connects with PPP.

Basically, since the ESP32 is so cheap, it is much more affordable than a dedicated Raspberry Pi + interface card. One of the big issues is connecting to the modern web with SSL and complicated web pages. Although connecting to a computer running Lynx is certainly feasible, I was looking for something more lightweight. So, here is a sample of some of the applications:

Webbrowser

AT+WEB=<URL>

Above is a screen shot of Virtual ][ (an Apple II emulator) running DCOM 3.3 (a VT100 terminal emulator) connected the esp32 contiki webbrowser. This setup can be used to connect an Apple II to the internet.


And this is the same browser running in the Mac terminal. In the lower right, you can see the Mac has a terminal window that is connected to the ESP32 and showing a https secure web page. The HTML is parsed by the Contiki webbrowser, which I modified to use the ESP32 web client that includes SSL encryption. The ANSI/VT100 colors are added by my Contiki console i/o module that detects the VT terminal type.

PPPd

AT+PPPD

For computers with TCP/IP stacks, but no ethernet card, use the PPPD command, making a serial TCP/IP connection, so all your existing internet programs will work:

Telnet

AT+CIPSTART=<IP Address>

Of course, since it uses the standard ESP32 AT commands, you can do all the normal connections to telnet-based BBSs.

Some of the code is on my GitHub page, with more to come!

Tuesday, April 24, 2018

PPP server on ESP32

I spent some time working on my Wimos Lolin ESP32 this weekend. I recently wrote up a simple how-to about the ESP32 device on my other blog. Since I am pretty familiar with lwIP and PPP based on my work on the Macintosh 128k webserver, I also previously contributed a small amount of code to enable the PPP server in the lwip network stack that the ESP32 uses. But, without an interface to access the PPP server code, it was useless. So, I decided to integrate access to the PPP server into the ESP32's standard AT command interpreter. With a small amount of code, I think I have it working! My MacBook can connect to itself using PPP now. I need to get one of my classic macs set up to further test the connection. I should get code posted in the next few days.

Update!

Source and instructions are now on github!

Saturday, January 17, 2015

ElWhip Diet

I have been working on getting my ElWhip web server running in 128K, but I'm not there yet. It is crashing on a 128K Mini vMac right after it negotiates the IP addresses. So close!
The main cause is PPP, which takes up about half of the memory. I tried replacing PPP with SLIP today, but I can't get slattach (SLIP server) to work on Mac OS X 10.4, and it isn't included in newer versions of OSX. So, it's not a good solution. Click for the gory details...

Wednesday, January 14, 2015

Mac 512K on the Internet

I fixed a couple bugs this evening, including the netmask problem I was having. I just needed to set the ppp interface as the default interface ( netif_set_default()) and lwip routes all the packets through the ppp interface, even if its router/ppp server is outside the netmask network.

I enabled ip forwarding on Mac OS X to give public access to my Mac: sudo sysctl -w net.inet.ip.forwarding=1, and set up port forwarding on my router.

And so, here it is, on the internet for the first time: my Macintosh 512K Web Server Running System 2.0 and Finder 1.1g (http://72.220.233.84:8080). It is just using the default webpage right now - I need to set up a better one. It seems to work from my iPhone. It is 30 years behind on security updates, so please be kind to the old thing!

Leave a comment if it works for you. I'll try to get a video up this weekend with more details.

Saturday, January 3, 2015

Web Serving! - barely

I can serve a web page from the Macintosh SE! There was a problem where lwIP does not seem to be detecting the first CRLF (Character Return + Line Feed) required by the HTTP spec. So, when I used Telnet, I had to hit return 3 times before the HTML appeared. Web browsers will only send 2 CRLFs, then wait. I ended up deleting one of the checks for a CRLF from the code, and it worked! However, that doesn't explain why it isn't detecting the first CRLF. I think it could losing the last character of the buffer (LF) or something.

The process of dealing with this made me realize I can't keep overlooking a few problems I have seen:

  • Getting PPP to connect is too timing-sensitive and flakey
  • I can't always get the web browser to connect
  • PPP is a memory hog
  • I need to actually fix all of the "FIX ME"s I have been inserting into the code
  • I need a better logging / debugging system
Some of these problems are related. I need a good debugging system system before I can fix any of them. Enabling debugging currently causes a bunch of modal dialog boxes to appear. This causes further timing problems and does not allow logging for analysis.

Once I get some of these issues sorted out, I will test it out in 128K and make a download available.

Saturday, June 21, 2014

Spending Spree, part 2

Earlier this year, I took a chance on buying one of these poorly documented Chinese BOLUTEK RS232 / Bluetooth modules. I followed these instructions, and to my surprise, it worked great for a basic wireless serial terminal between my G4 (with USB Bluetooth adapter) and Mac SE. Hopefully, I can use it to establish a wireless PPP link to my Macintosh 128k. First, I need to re-solder my broken RS422 to RS232 adapter, though. Wireless internet, here I come!

Oh, and the Fanny Mac arrived already. It fits and works great!

Saturday, February 1, 2014

RC2014WW Wrap-up

ElWhip on 512K Macintosh running System 2.0 and Finder 1.1g
ElWhip on 512K Macintosh running System 2.0 and Finder 1.1g
ElWhip application and basic instructions are available for download!  Unfortunately, I didn't have enough time to add any really useful functionality.  A web server would be relatively easy to add and would give the application some real purpose.  All it does is respond to pings and run a telnet echo server.  Also, I'm not totally sure it will run on a real Macintosh 128K, since I found out that I don't have one.  I included a really stripped-down version that will probably run in less than 96K of available memory.
This was a fun exercise, and it is my very first classic Macintosh application.  If anyone gets it running or needs some tips, leave a comment!
I will try to take some time tomorrow to get a final video posted.  Until then, take some time  to check out the other RetroChallenge entries.

Monday, January 20, 2014

Too Big!

Sorry, a system error occurred. (Restart) (-Resume-)

Uh, oh. I wanted to make sure my lwIP application would work on a real 128K Macintosh (I discovered mine was upgraded to 512K), and none of my old Macs have just 128K RAM. So, I recompiled Mini vMac to be a 128K Macintosh, rather than the default Macintosh Plus. After it starts PPP, it gives a system error ID=15. This is a segment loader error, which probably means it is out of RAM trying to load the lwIP core.
In better news, I eliminated most of the debug messages so I don't have to hit the enter key so many times to dismiss the debug dialog boxes.

Saturday, January 18, 2014

Success and Video Update



Got it! Hitting the enter key rather than clicking the mouse on the dialog boxes makes the connection. That's either a timing or mouse port serial interrupt issue. Oddly, the return key doesn't do anything. I have TCP/IP networking on my original (modified) Macintosh! I think the memory use is low enough, it should work on a real 128K Macintosh. Is it pronounced "El whip" or "l.w. I.P."? I like the Mexican flair of El Whip! (Actually, it's pronounced "lightweight IP" - boring…)

Wednesday, January 8, 2014

Motorola 68000 uses 32 bit addressing. Don't forget it!

Fixed the not enough space for new header size error.
For some reason, I thought the 68K processor was 16-bit, so I told lwip a pointer uses 16 bits in the cc.h header file. (It has a 16 bit data bus, 24-bit external address bus, but is 32 bits internally.) Now, you would think I would have figured this out after using 32-bit addressing to get past the previous link error. Or, maybe I would have looked at the lwip cc.h for the coldfire processor, which is a 68K at heart. Or, maybe I would have read the Apple SC/SCpp Reference more thoroughly the first time around. Anyway, MPW for 68K uses 32 bit pointers.
Quick fix to the code:
typedef u32_t mem_ptr_t;
And... no assertion errors at run-time! It still isn't completing the PPP negotiation, but it is trying so hard: PowerMac-G4 pppd[777] <notice>: pppd 2.4.2 (Apple version 233-0-8) started by epooch, uid 0 PowerMac-G4 pppd[777] <notice>: Connect: ppp0 <--> /dev/cu.usbserial PowerMac-G4 pppd[777] <error>: Received bad configure-ack: 02 06 00 00 00 00 05 06 bf 68 ca 18 07 02 08 02 PowerMac-G4 pppd[777] <warning>: IPCP: timeout sending Config-Requests; PowerMac-G4 pppd[777] <warning>: acscp: timeout sending Config-Requests; PowerMac-G4 pppd[777] <notice>: Connection terminated.

Tuesday, December 31, 2013

Setting Up the Work Environment

I couldn't wait any longer! I dusted off my Macs and booted them all up to make sure I wouldn't spend the whole month fixing hardware. They all work!

Mac G4, 128K, SE

Hardware

Basically, I will be using a PowerMac G4 to do the software development and the Macintosh SE for initial testing. I decided to do testing on the Mac SE for a few reasons:

  • faster serial ports for data transfer;
  • ethernet card installed (broken?);
  • MacTCP and FreePPP installed for comparison testing;
  • SCSI port and a harddrive;
  • more robust System software (System 7.1);
  • same Motorola 68k processor as the 128K.
This should make testing much less painful. If I get anything working on the SE, I can give it a try on the Mac 128K. I have an external SCSI zip drive that seems to work well as an external harddrive (and lots of zip disks!).

Wednesday, December 4, 2013

RetroChallenge 2014WW Entry

I have again entered the RetroChallenge! This time I will be using my Apple Power Macintosh G4 500 DP from the year 2000 to compile some programs. Now, even though this computer is technically eligible for the RetroChallenge, the real "retro" part is that the program I will be compiling is for the Apple Macintosh, as in, the original 128K Macintosh from 1984. I will be using the Classic Environment of Mac OS X 10.4 running MPW as my development environment.

As for the programming, I will attempt to port the lwIP TCP/IP stack to the original Macintosh. This Macintosh is unique because it did not have enough memory to run any commercially available networking stack. Even the 512K Macintosh had some networking possibilities. I attempted this project a number of years ago but couldn't get past the multi-thread requirement of the lwip PPP implementation. As far as I know, the original Macintosh operating system does not have any multithreading libraries or routines. I recently noticed that a branch of the lwIP code includes a PPP module that claims to not require multiple threads! So I will give this another shot. If PPP fails, I can try to get SLIP working instead.

Here is my target hardware/software flow:

Macintosh -> lwIP -> ppp ->  RS-422 -> RS-232 -> USB -> PowerMac G4 -> getty -> pppd -> THE WORLD!

Having worked on this before, and having struggled to understand how to use the code, I have a feeling I will get stuck at some point. If that happens, I will probably work on building a ROM burner to flash some Apple II ROMS or work in my Apple IIgs.

Monday, July 26, 2010

RetroChallenge Part 2

Here is my router shipping info:
Status: In Transit - On Time  Scheduled Delivery Date: 07/30/2010
That gives me a full day to complete my experiment! With a list price of only $1,420.80, $25.00 is a pretty good deal. I paid $18.00 for the additional serial interface so I can hopefully have 6 ethernet-less Macs connected to the internet at once.

Saturday, July 24, 2010

RetroChallenge

With only one week to go, I decided to enter the RetroChallenge. The plan is to get all of my Ethernet-less Macs online without having to buy expensive hardware, and without using another computer. here is how I used to do it: Getting a Classic Mac online using a Mac OS X server. And here is what I want to try: 3com 5009 router. This is an high-end router that is readily available online for about $25 including shipping. It has 2 serial ports. The plan is to hook the Mac serial ports up to it and make the connection through PPP.