Showing posts with label WIFI232. Show all posts
Showing posts with label WIFI232. 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!

Saturday, February 13, 2016

USR-WIFI232 and ADTPro Continued...

I really wanted the standard ADTPro Ethernet connection to work properly so that I don't have to start the ADTPro Server from the command line. Unfortunately, that connection type adds a byte to the start of the ADT packet indicating the packet number. That seems appropriate for the UDP protocol that is used, but that one byte confuses the Apple II client enough that it immediately reports an error. Commenting-out the code that adds the packet number byte allowed me to get everything working, at the expense of out-of-order packets not getting re-ordered. Not a great solution, but it is more convenient now. Really, ADTPro Server just needs a decent interface for its SerialIP mode.

Full details on the ADTPro Support Forum (Archived on the Wayback Machine).

I really like this USR-WIFI232 compared to an Apple II ethernet card. It is compatible with anything that uses the Apple SSC card, has a nice web interface for configuring it, and includes WiFi, at a little over 1/2 the price. Unfortunately, the user guide can be a bit hard to decipher.

Tuesday, February 9, 2016

USR-WIFI232 and ADTPro

Based on my testing, the USR-WIFI232 appears to work fairly well with ADTPro giving yet another option for disk transfers. However, you have to set ADTPro to use Virtual Serial over IP (localhost mode). Open the ADTPro.properties file that gets created (using a text editor, such as TextEdit) and enter the IP address and Port number of your USR-232-WIFI. Quit ADTPro, run it again, and it will connect! I set my USR-WIFI232 device to use the following UART setting from the web interface: 9600,8,None,1,Enable,Disable,Disable, and set complimentary settings on the Super Serial Card (<ctrl-a>14B). ADTPro seems to like 8 data bits, which prevents you from using the USR-WIFI232 AT commands.

I used the ADT Serial Pacing setting of "Pacing: 1000" to get a reliable connection for bootstrapping. I don't think the speed settings are tested with a TCP connection to a real Apple //e.

Once the bootstrapping is successful and ADTPro is running, it was necessary to change the UART settings of the USR-WIFI232 via the web interface to: 19200,8,None,1,Enable,Disable,Disable, as ADTPro only runs at higher speeds.

Uart Setting
Baudrate
Data Bits
Parity
Stop
CTSRTS
485 mode
Baudrate adaptive (RFC2117)

Set the CONFI(G) in ADTPro to 19200 Baud Rate as well. After that was completed, I was able to transfer directory data, and a disk with ADTPro on it!

If the bootstrapped ADTPro gives an error INSERT SYSTEM DISK AND RESTART -ERR -1 when you restart your USR-WIFI232 (due to the hardware handshake, I think), just hit <ctrl>-<reset>, then type 800G<enter> to restart ADTPro.

Sunday, January 31, 2016

Truly Wireless Now

In a quest to make my Apple //e truly wireless, I did some soldering this morning to create a cable to go directly from the Apple Super Serial Card to the USR-WIFI232. This allowed me to get rid of the bulky DB-25->DB-9 adapter, and a short DB-9 cable to go from the adapter to the USR-WIFI232 (see photos).  Then, I used double-stick tape to mount the USR-WIFI232 on top of the Apple //e power supply. The Apple //e already has a pop-out that fits the antenna and power supply cord fairly well. The result is an internal WIFI adapter! I suppose I could get the power for the adapter from the Apple power supply, but I'd rather not run the risk.

I really like this set-up as connecting to the Apple over serial cables always meant finding the right cables and adapters, or a null modem. They would inevitably get unplugged for another project or to move the computer.

There is a lot of potential for this configuration for transferring disk images with ADTPro. I have to use 300 baud for the Apple BASIC interpreter to keep up, but it looks like higher baud rates will work in the terminal mode of the SSC, or with a compiled program. Come to think of it, you could even have a web page on the Apple //e that accepted disk image uploads.

This is a simple, and inexpensive ($40 on ebay) alternative to some of the other Apple Ethernet products out there. Some people have done similar things with a Raspberry Pi, but, again, this is pretty much plug and play and includes WIFI.

Having made two web servers out of old Apples, I am finding that it would be a lot more interesting to make a web browser. That will probably be a future project.

Saturday, January 30, 2016

Apple //e Webserver Running!

I have my Apple //e BASIC web server running!... sort of. Try it out. Be gentle and patient, it's only 300 BAUD!: http://162.232.186.125:8899

Code after the break.. Update: minor change in code to allow OPTIONS method

Wednesday, January 27, 2016

More WIFI Details...

So, this USR-WIFI232 runs a TCP/IP server on port 8899. That allows me to telnet to the IP address and just start typing as if I were at the computer: ]LIST LIST 10 PRINT "hello" 20 PRINT "writing this from the internet" ]RUN RUN hello writing this from the internet ]

I just need to figure out how to open up my router to let the world in! ... And write a web server in BASIC...

WIFI enabled!

I took the day off from work, so I had a chance to get some real RetroChallenge work done!

It took a while to figure out that the USR-WIFI232 needs a null modem adapter to connect to a normal computer (but not to the Apple IIe in Terminal mode). I did not see that documented anywhere. Once I figured that out, I played around with the converter on my MacBook and my good ol' Macintosh G3. Some well-hidden tips:

  1. Use a null modem to connect
  2. type +++ to set the terminal mode. the module will respond with a
  3. type a and the module responds with +ok
  4. type AT+H for a list of commands.

I have struggled for a while to get my Apple IIe to connect to anything but my Macintosh G3, running ZTerm. This problem was apparent when I was unable to communicate between my Apple IIe and the USR-WIFI232 device. Oddly, I noticed that anything I typed was being echoed by the USR-WIFI232, but it would not respond to the Apple IIe. In fact, I was able to connect my Apple IIe, the G3 and the USR-WIFI232, at the same time, and view a complete transaction between the G3 and the USR-WIFI232 from the Apple IIe, but it would still not communicate with the USR-WIFI232!

I played around with the settings and discovered that the problem is that the (just mine?) Apple IIe Super Serial Card (SSC) does not seem to communicate correctly in the 8 Data, 1 Stop, 0 Parity mode. I had enabled the "No Extended Characters (strip hi bit)" setting in ZTerm which fixed the problem, but only for ZTerm. I think the Apple IIe was sending data with the high-bit enabled, which being echoed by the USR-WIFI232, then the Apple IIe would strip the high-bit making it look OK, even though the characters were junk.

Anyway, 7 Data, 1 Stop, 0 Parity mode works correctly. So, to enable this setting on the Apple IIe, enter <ctrl-A> and then at the APPLE SSC: prompt, enter: 1D . For the USR-WIFI232, enter: AT+UART=9600,7,1,None,NFC, then AT+Z. Once I did that, I was able to send and receive commands between the Apple IIe and the USR-WIFI232! I am losing a little bit of data from the USR-WIFI232 at speeds greater than 300 Baud though.

Using the Terminal mode of the SSC, I could send various AT commands to the USR-WIFI232, but I couldn't really do much with it other than PING or scan for WIFI networks. Then, I discovered the built-in web socket webpage. This allowed me to send data through the webpage to the Apple IIe! When I exited the SSC terminal mode, I could send commands to AppleSoft BASIC, and I even ran a little program.

Wednesday, January 6, 2016

RetroChallenge 2016/01 Attempt

So, RetroChallenge 2015/07 was a total flop for me. All I managed to do was go to the beauty shop to find hydrogen peroxide for Retr0brite. I couldn't find what I needed and pretty much gave up on everything. But, January has always been a better month for me to do this. Just a few, very practical goals:

  • Get a color monitor for my Apple IIe
  • Watch and review Steve Jobs, and Jobs
  • Try again to hook up an RS232 WIFI device to an old Macintosh, or maybe the Apple IIe

Sunday, June 28, 2015

RetroChallenge 2015/07 Agenda

July RetroChallenge requires moderation for me, so I will keep my challenges simple: