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")
"10.0.1.49"
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))
x))
(defun println (x s) (princ x s) (princ #\return s) (princ #\newline s))
(defun lisp-server (&rest iplist)
(with-client (s (ip iplist) 8080)
(print "Listening...")
(loop
(unless (= 0 (available s))
(let ((line (read-line s)))
(print line)
(println (eval (read-from-string line)) s)))
(delay 1000))))
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
10.0.1.44
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)
"Listening..."
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
sq
Then you can type:
(sq 123)
and it will echo
15129
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.