Happy holidays all.
My Christmas project has been to build the LUA Wireless Joystick. Its been a lot of fun learning about the Lua workspace and programming ESP32s.
The code seems to be running, but it doesnt seem to be communicating or sending GCODE through the JSON server.
I have successfully run the Joystick test code and tweaked my debouncing logic.
Here is what Im seeing in the console widget.
A couple of worrying elements that I havent resolved.
“local UDP socket address / port: 0.0.0.0:8988” → In johns video this returned a value.
“Going to connect to websocket on 192.168.1.101 and see if TinyG exists…” → In johns video this announced that a TinyG was found.
I am programming using MAC OS Catlina 10.15.7 ( Serial Port JSON Server v1.92
musmpsmfvh9l.local)
I also upgrade my RPi Serial Port JSON Server v1.96 CNCPi
I have an init.lua that contains
“dofile(“main_chilipeppr_joystick.lc”)”
================================================
Make sure to update your Wifi network ssid’s and passwords in esp32_wifi.lua
Initializing pins
Initting LED pin for ESP32 device: ESP32_Lolin32 pin: 5
e[0;32mI (42456) gpio: GPIO[5]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 e[0m
Initting LED pin for ESP32 device: ESP32_TTGO pin: 13
e[0;32mI (42466) gpio: GPIO[13]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 e[0m
Initting LED pin for ESP32 device: ESP32_DOIT pin: 2
e[0;32mI (42486) gpio: GPIO[2]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 e[0m
Initting LED pin for ESP32 device: ESP32_Wemos pin: 16
e[0;32mI (42496) gpio: GPIO[16]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 e[0m
Setting up wifi
Attempting to connect to wifi…
I (42516) wifi: wifi timer task: 3ffe7588, prio:22, stack:3584
I (42526) wifi: mode : sta (3c:71:bf:5a:83:5c)
Wifi started
I (43866) wifi: n:11 0, o:1 0, ap:255 255, sta:11 0, prof:1
I (44526) wifi: state: init → auth (b0)
I (44526) wifi: state: auth → assoc (0)
I (44536) wifi: state: assoc → run (10)
I (44566) wifi: connected with Ukelele, channel 11
Wifi connected. ssid: Ukelele , bssid: 18:78:d4:26:4d:66 , channel: 11 , auth: 3
We should then get an ip…
e[0;32mI (46516) event: ip: 192.168.1.216, mask: 255.255.255.0, gw: 192.168.1.1e[0m
Oh, we got ourselves an IP: 192.168.1.216 , Netmask: 255.255.255.0 , GW: 192.168.1.1
Got wifi. IP: 192.168.1.216 Netmask: 255.255.255.0 GW: 192.168.1.1
Init…
local UDP socket address / port: 0.0.0.0:8988
UDP Server started on port 8988
Announce to broadcast ip: 192.168.1.255
Announce: {“JsonTag”:“{"Icon":"https://raw.githubusercontent.com/chilipeppr/widget-cayenn/master/joystick.png\",\“Name\”:\"Joystick for TinyG","Desc":"This joystick auto-connects to SPJS and sends GCode commands to jog"}”,“MyDeviceId”:“chip:0x283c71bf5a83-ip:192.168.1.216”,“Announce”:“i-am-a-client”,“Widget”:“com-chilipeppr-widget-undefined”}
TCP Recv {“Announce”:“i-am-your-server”,“Widget”:“com-chilipeppr-widget-undefined”,“YourDeviceId”:“chip:0x283c71bf5a83-ip:192.168.1.216”,“ServerIp”:“192.168.1.101”,“JsonTag”:“”}, peerIp:192.168.1.101, peerPort:40860
Got a server:{“192.168.1.101”:true}
Going to connect to websocket on 192.168.1.101 and see if TinyG exists…
Websocket connecting to: 192.168.1.101 port: 8989 path: /ws
GET /ws HTTP/1.1
Host: 192.168.1.101
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Key: x3JJHMbDL1EzLkh9GBhXDw==
Sec-WebSocket-Protocol: chat, superchat
Sec-WebSocket-Version: 13
Origin: esp32
Websocket found hdr
Websocket connected to host: 192.168.1.101 port: 8989 path: /ws
Websocket doing send. data: list
I (54536) wifi: pm start, type:0
Ping
Got pong. We’re alive.