Amiga Retro Brisbane

Amiga Hardware => Amiga Hardware (Classic) => CD32 & CDTV => Topic started by: matt020 on April 11, 2020, 11:00:42 pm

Title: Wifi on the CD32
Post by: matt020 on April 11, 2020, 11:00:42 pm
I'm about to venture into this, has anyone done it?

I have a CD32 with a TF330. It has an ESP header, which takes serial.device to the edge of the TF330 card. With a little wifi module, and a TCP/IP stack program (Roadshow, MiamiDX, etc) people are getting internet connectivity on their CD32.

If you have a CD32 with a TF330 and have working wifi, I would LOVE to hear/read about your experience!!

Cheers,
Matt.
(WA)
Title: Re: Wifi on the CD32
Post by: dalek on April 16, 2020, 12:57:57 am
I've programmed the ESP-01S but yet to dig out the the CD32.  Will give it a crack in the next few days.
Title: Re: Wifi on the CD32
Post by: quantum8 on April 16, 2020, 10:25:09 pm
Now this looks interesting!

Yet another project to add to my to do list :)
Title: Re: Wifi on the CD32
Post by: matt020 on April 16, 2020, 11:43:23 pm
I've programmed the ESP-01S but yet to dig out the the CD32.  Will give it a crack in the next few days.


Did you program it in Windows or Linux?
Title: Re: Wifi on the CD32
Post by: Heywood on April 19, 2020, 01:26:29 pm
Which firmware for the ESP did you use?  I have used https://github.com/allenhuffman/Zimodem and some RS232-TTL convertors to do serial over TCP before

basically you use your comms proggy and do AT+CONFIG to set up the wifi stuff and then call out doing ATDT"ciaamigabbs.dynu.net:6400"

For general netowrking I guess you might need a raspberry pi or something terminate a SLIP/PPP connection?
Title: Re: Wifi on the CD32
Post by: dalek on April 21, 2020, 10:46:12 am
Programmed an ESP-01S with linux (esptool.py) using a usb to ttl adapter and some extra wires for grounding gpio0, pulling EN high etc.

Firmware here: https://github.com/martin-ger/esp_slip_router

It acts as a slip router endpoint so you go Amiga->SLIP Router->WIFI DHCP

TF thread here: https://exxoshost.co.uk/forum/viewtopic.php?f=65&t=2103&start=20
Title: Re: Wifi on the CD32
Post by: matt020 on April 25, 2020, 10:49:27 pm
So I spent a week solid on it. The guides on various sites don't cover off too well when something goes wrong. Esptool.py was a bit of a b*tch to get going with its error messages, and in the end I used NodeMCU on Windows.

Downloading the .bin files from the Github page.... dont right-click and "save-as", it doesnt work. Who'd have thought that?  :-\ No, you have to download the repo as a lot and then get the bin files out of the archive that way.

The CD32 with a telnet app such as DCTelnet can be used to telnet in on port 7777 to change the config for SSID, etc. Linux box isn't needed. No one has mentioned that, and can save someone a few hours getting a Linux OS on a memory stick up and running.

I have this big intention of writing up a how-to, including how to deal with issues that arise. We'll see how far I get with that  :) ;) :D ;D
Title: Re: Wifi on the CD32
Post by: quantum8 on April 29, 2020, 09:52:25 am
Looking forward to that writeup!

I'll hold off and beta test the doc for you when you're done with it  :)
Title: Re: Wifi on the CD32
Post by: Heywood on April 29, 2020, 02:14:32 pm
So the I the bits I ordered have arrived and hopefully in the next day or so I'll be able to flash the ESP and install it in my TF330.

Just a quick question - did you solder the ESP directly or install headers? I'm thinking headers just so if I need a firmware update it's easier to remove
Title: Re: Wifi on the CD32
Post by: matt020 on May 14, 2020, 08:44:23 pm
So the I the bits I ordered have arrived and hopefully in the next day or so I'll be able to flash the ESP and install it in my TF330.

Just a quick question - did you solder the ESP directly or install headers? I'm thinking headers just so if I need a firmware update it's easier to remove

I installed headers, bought some from Jaycar, trimmed them to length and soldered the headers onto the board.

If you get stuck, let me know. I certainly hit hurdle after hurdle and I reckon I can nut out any problems you come across. I havent written up the how-to guide, but I am pretty passionate about this. I think it's because the forums and guides out there are good but skip just the little things, and its the little things that will cause this whole thing to come to a stop!!!!

Not sure if you noticed my previous post, but despite what the already-made guides say, you dont need a linux box. You can telnet into the ESP device using the Amiga to set up the SSID, password etc etc using DC Telnet
Title: Re: Wifi on the CD32
Post by: Heywood on May 15, 2020, 12:43:49 am
Hey Matt,

I've been able to flash the 1MB ESP-01 using esptool  - I short GPIO0 to ground and then user esptool to flash the firmware from https://github.com/martin-ger/esp_slip_router but haven't gotten things to quite behave as expected

This is the procedure I performed

1 Flash the ESP

C:\Users\Adam\Documents\esp_slip_router-master\firmware>esptool.py --port com7 write_flash -fs 1MB 0x00000 0x00000.bin 0x10000 0x10000.bin
esptool.py v2.8
Serial port com7
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: ec:fa:bc:a8:81:c3
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Flash params set to 0x0020
Compressed 36256 bytes to 25788...
Wrote 36256 bytes (25788 compressed) at 0x00000000 in 2.3 seconds (effective 126.8 kbit/s)...
Hash of data verified.
Compressed 232996 bytes to 160748...
Wrote 232996 bytes (160748 compressed) at 0x00010000 in 14.2 seconds (effective 130.9 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...


2 Initial ESP Check using Putty

After that I fired up Putty and did a direct connect to com7 with speed 115200, removed the GPIO0/Ground short and pull the ESP out of the USB programmer and popped it back in and saw around 20-30 characters of mess which I believe is meant to be the ESP trying to talk SLIP or something.

3 Install ESP into TF330 and copy network stuff onto the flash card

So I put the ESP in my TF330 (I ended up using headers which I think is a good thing since I've had the ESP in and out a bit trying to get it to play nice) and copied the networking stuff on the compact flash card, specifically
Roadshow Demo, Terriblefire's install script and DC Telnet

4 Power up the CD32 and install the networking stack and interface driver

I installed roadshow, then run the install script and rebooted the CD32

5 Attempt to get the CD32 on the interwebs

After the reboot, I start a shell and when running shownetworkinterface it appears that I have interface slip0 up with the default gateway of 192.168.240.1 (which should be the ESP) and my IP of 192.168.240.2
I tried to ping 192.168.240.1 but it just times out so is not looking promising :(

I install DCTelnet and fire it up and in the options menu enable local echo and set Return = CR+LF
Then I attempt to connect to 192.168.240.1,7777 but it just sits there for eternity - no telnet session and command window

6 Get a bit frustrated and look to troubleshoot

If you have some ideas to try, I'm happy to give them a shot - over the weekend I'm going to try to connect the ESP to my ubuntu box and see if it can slattach
Title: Re: Wifi on the CD32
Post by: Heywood on May 19, 2020, 09:25:17 pm
I couldn't get my ESP-01 to be connected to on my linux box, so I took a punt and ordered an ESP-01s from ebay as these things are relatively cheap.  I followed exactly the same programming steps as above (copy and pasted the commandline actually) and this time it worked!  I guess the existing ESP was working enough to allow the flashing to occur but perhaps other parts of the EEPROM were borked stopping it from properly behaving.

Or at least enough so I could ping the ESP and use DC Telnet to communicate with it in order to set up my WiFi


The next hurdle I had to overcome was dealing with a WiFi password that had spaces in it - however this was achieved through "escaping" the space character so the slip router parser wouldn't wrongly assume that the password ended early.

E.g.
cmd>set password something\ with\ spaces\ in \it


After that I was able to ping google.  I haven't done much else, currently I'm using the Roadshow demo but I might look at installing MiamiDX as it's available as part of the ClassicWB install I'm using and I suspect the performance difference at the speed of the serial connection isn't enough to get worked up about.

The ESP-01s I used was an ebayer in Brisbane (https://www.ebay.com.au/itm/333575326557), so was a nice quick mail delivery even in the time of COVID.
Title: Re: Wifi on the CD32
Post by: Heywood on May 23, 2020, 12:02:58 pm
So I uninstalled Roadshow and installed MiamiDX which was pretty straightforward

Run the Miami installer (this is located in the myfile directory if you have ClassicWB installed) - I installed everything into "SYS:Internet" for internet related Apps.

Launch MiamiInit to setup:
This writes the config file that can be loaded into MiamiDX itself

Launch MiamiDX and right click and select "Import settings from MiamiInitV3"
Then I configure things a little more to make it more friendly for starting with workbench:
In the Events Tab under start I select "auto-online" and "Hide GUI"
Save the Settings

Then edit user-startup so that MiamiDX is started with workbench by adding "run <> nil: miami:miamidx'

Then it's time to installer some stuff so we can browse the web in 2020:
AmiSSL-4.5 and IBrowse-2.5.2-020+

A potential problem with the TF330 is that there is no realtime clock and anything with certificates is going to cause a lot of warnings and errors due to the system date being wrong but this can be resolved through the power of the internet.

Thankfully with IBrowse installed we can visit aminet.net and search for amitimekeeper which is an NTP client for the amiga
After installing it, I add it my s:user-startup "run <>nil: SYS:internet/amitimekeeper/timekeeper" so that the time is updated shortly after I get the workbench screen - you may want to ensure your local settings are correct for the correct local time adjustments

Finally after all this - I can visit this amigaretro.com... on a modern browser this site is very reminiscent of the classic Amiga and feels quite lithe - with the CD32 with TF330 and SLIP/WiFi being very restricted plus the overhead of TLS hitting the 030, it's vaguely useable but not especially pleasing for long term use (at least with standard resolutions)

All up, the actual cost to get this happening if you have a CD32 with TF330 is quite minimal and you do get something that is good for small transfers when you don't feel like removing the flash card from the system.  Next step is to try some BBS browsing.
Title: Re: Wifi on the CD32
Post by: intangybles on August 19, 2020, 04:27:20 pm
Forgot to thank you gents for the amazing write-ups and discussion!

Just wanted to mention that this area is the next I am going to add to the publicly readable content.

https://www.amigaretro.com/index.php/topic,206.0.html (https://www.amigaretro.com/index.php/topic,206.0.html)