Here’s a complete sequence that worked for me just now, using ESP uLisp 4.0b on an Adafruit ESP32 Feather:
1. Connect to your Wi-Fi with your network name and password:
> (wifi-connect "Home" "secret")
2. Define the lisp-server function and the utilities:
(defun ip (lis)
(let ((x 0))
(mapc (lambda (n) (setq x (+ (ash x 8) n))) (reverse lis))
(defun println (x s) (princ x s) (princ #\return s) (princ #\newline s))
(defun lisp-server (&rest iplist)
(with-client (s (ip iplist) 8080)
(unless (= 0 (available s))
(let ((line (read-line s)))
(println (eval (read-from-string line)) s)))
Here I’ve used 8080 as the port number.
3. Discover the IP address of your remote computer
This can be the one connected to the ESP32, or any other computer on the network.
For example you can use ipconfig at the terminal:
$ ipconfig getifaddr en0
or you might need to use en1.
4. Start telnet from the terminal on your remote computer to the port you’re going to use:
$ nc -l 8080
It should hang up.
5. Run lisp-server with the IP address of the remote computer:
> (lisp-server 10 0 1 44)
If you omitted to start the telnet session in the previous step it will just return with nil.
6. Enter some Lisp
Now at the telnet session you can type:
(defun sq (x) (* x x))
and it will echo
Then you can type:
and it will echo
To exit from the telnet session press Ctrl-Z.
In one of your posts you mentioned running lisp-server using uLisp’s autorun feature, by restarting the ESP32. That may be interfering with the Wi-Fi connection, so try following my sequence without restarting the ESP32.
Let me know how you get on!
Update: added the utilities you also need to install.