Palm,  palm os,  tutoriels

WiFi WEP network for Palm OS devices

Earlier this year, I rediscovered my interest for old Palm OS devices. I went on eBay and managed to find some of the models I had in the past: the Palm TX, Tungsten T3 (which I never owned before but it’s an excellent device, and surprisingly has a vibration motor), Tungsten E2, and most importantly, the Zire 72. The Zire 72 was my first Palm, and it’s the device that got me interested in programming and making apps. I just had to get it back.

But connecting these devices to the internet today isn’t easy except for the Palm TX. Most of them only support WEP encryption with the WIFI SDIO card, which is outdated and insecure by modern standards. But for the sake of nostalgia, I was ready to give it a try.

The Challenge of WEP Wi-Fi

Devices like the Zire 72 only understand WEP, which makes connecting to today’s networks a challenge. Fortunately, I found a solution: turning a Raspberry Pi into a Wi-Fi access point that uses WEP.

What You’ll Need

  • A Raspberry Pi (I used a Raspberry Pi 4)
  • A microSD card with Raspberry Pi OS installed
  • An Ethernet connection for the Raspberry Pi
  • Basic knowledge of Linux and terminal commands
  • Your favorite Palm OS devices

Step 1: Prepare the Raspberry Pi

First, I made sure my Raspberry Pi was up to date:

sudo apt-get update
sudo apt-get upgrade

Next, I installed the tools needed to turn the Pi into a Wi-Fi hotspot:

sudo apt-get install hostapd dnsmasq

Step 2: Configure the Wi-Fi Network with WEP

I started by configuring the hostapd.conf file to set the SSID (network name), channel, and of course, the WEP key. The key needs to be in hexadecimal format, something like 1234567890 for a 64-bit key:

sudo nano /etc/hostapd/hostapd.conf

I added the following lines:

interface=wlan0
driver=nl80211
ssid=YourNetworkName
hw_mode=g
channel=7
macaddr_acl=1
accept_mac_file=/etc/hostapd/accept
auth_algs=1
wep_default_key=0
wep_key0=YourWEPKeyInHex
ignore_broadcast_ssid=1

MAC Address Filtering: To add a layer of security, I enabled MAC address filtering. I created a list of allowed devices by their MAC addresses in the accept file:

sudo nano /etc/hostapd/accept

I added the MAC address of my Palm SDIO card:

XX:XX:XX:XX:XX:XX

Hiding the Network: I also decided to hide the network by setting ignore_broadcast_ssid=1, so the SSID won’t be broadcasted and only devices that know the network name can connect.

Step 3: Configure DHCP with dnsmasq

The dnsmasq configuration handles DHCP requests, which means assigning IP addresses to devices that connect:

sudo nano /etc/dnsmasq.conf

I added:

interface=wlan0
dhcp-range=192.168.4.2,192.168.4.20,255.255.255.0,24h

Step 4: Enable Internet Sharing

To share the internet connection from Ethernet to the Wi-Fi network, I enabled IP forwarding and set up NAT (Network Address Translation) with iptables:

sudo nano /etc/sysctl.conf

I uncommented this line:

net.ipv4.ip_forward=1

Then applied the changes:

sudo sysctl -p

And configured iptables:

sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo sh -c "iptables-save > /etc/iptables.ipv4.nat"

Step 5: Start the Network

With everything set up, I started the Wi-Fi network by launching the necessary services:

sudo systemctl start hostapd
sudo systemctl start dnsmasq
sudo systemctl enable hostapd
sudo systemctl enable dnsmasq

Connecting Your Palm OS Devices

The moment of truth had arrived. With the Raspberry Pi broadcasting the WEP network, I grabbed my Palm Zire 72 with its SDIO WiFi card, and navigated to the Wi-Fi settings. After scanning for networks, mine appeared. I entered the WEP key, and just like that, my Zire 72 was online, bringing back memories of a time when this device was at the cutting edge of mobile technology.

And the Palm TX?

If you have a Palm TX, you’re in luck. It’s the only Palm device that supports WPA2, so you don’t need to set up a WEP network for it. But for all the other models, this Raspberry Pi setup is a lifesaver.

Controlling the Network with Homebridge

Since WEP isn’t very secure, I wanted an easy way to turn the network on and off as needed. With Homebridge, I integrated this function into my smart home setup (HomeKit). Here’s what I did:

1. Install Cmd4:

sudo npm install -g homebridge-cmd4

2. Create a Control Script: I wrote a simple bash script to manage the Wi-Fi network:

sudo nano /usr/local/bin/wifi_control.sh

The script looks like this:

#!/bin/bash

set -e
set -u

length=$#
device=""
io=""
characteristic=""
option=""

if [ $length -le 1 ]; then
   printf "Usage: $0 Get < AccessoryName > < Characteristic >\n"
   printf "Usage: $0 Set < AccessoryName > < Characteristic > < Value >\n"
   exit -1
fi

if [ $length -ge 1 ]; then
    io=$1
fi
if [ $length -ge 2 ]; then
    device=$2
fi
if [ $length -ge 3 ]; then
    characteristic=$3
fi
if [ $length -ge 4 ]; then
    option=$4
fi

if [ "${io}" == "Get" ]; then
   case $characteristic in
      'On')
         if systemctl is-active --quiet hostapd; then
            printf "1\n"  # Wi-Fi is enabled
         else
            printf "0\n"  # Wi-Fi is disabled
         fi
         exit 0
         ;;
      *)
         printf "UnHandled Get ${device} Characteristic ${characteristic}\n"
         exit -1
         ;;
   esac
fi

if [ "${io}" == "Set" ]; then
   case $characteristic in
      'On')
         if [ "${option}" == "1" ]; then
            sudo systemctl start hostapd
            sudo systemctl start dnsmasq
            sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT
            sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state ESTABLISHED,RELATED -j ACCEPT
            echo "Wi-Fi network enabled"
         else
            sudo systemctl stop hostapd
            sudo systemctl stop dnsmasq
            sudo iptables -D FORWARD -i wlan0 -o eth0 -j ACCEPT
            sudo iptables -D FORWARD -i eth0 -o wlan0 -m state --state ESTABLISHED,RELATED -j ACCEPT
            echo "Wi-Fi network disabled"
         fi
         exit 0
         ;;
      *)
         printf "UnHandled Set ${device} Characteristic ${characteristic}\n"
         exit -1
         ;;
   esac
fi

printf "Unknown io command ${io}\n"
exit -1

3. Update Homebridge Config: In config.json, I added an entry to control the Wi-Fi network as a Switch accessory.

{
    "platform": "Cmd4",
    "debug": false,
    "outputConstants": false,
    "accessories": [
        {
            "type": "Switch",
            "displayName": "Wi-Fi Koti Network",
            "name": "WiFiKotiNetwork",
            "state_cmd": "bash /usr/local/bin/wifi_control.sh",
            "polling": true,
            "interval": 10
        }
    ]
}

Conclusion

Setting up a WEP network on a Raspberry Pi might not be the most secure option, but it’s perfect for connecting your old Palm OS devices to the internet today. Just remember to disable the network when you’re not using it to minimize security risks.

I hope this guide helps you bring your Palm OS devices back to life.

This is my first blog post in English here, and even more significantly, my first post since 2013 😂. A lot has changed since then. There will probably be more posts coming soon—or maybe in another 11 years…