@ralphwetzel,
Have been playing a bit to tweak the steps a bit more to fit my case. Every time I wanted to flash the wt32-eth01 I got this error:
Serial port /dev/ttyUSB0
Connecting......................................
A fatal error occurred: Failed to connect to ESP32: No serial data received.
For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html
CMake Error at run_serial_tool.cmake:56 (message):
/home/pi/.espressif/python_env/idf4.4_py3.9_env/bin/python
/home/pi/esp-idf/components/esptool_py/esptool/esptool.py --chip esp32
failed
ninja failed with exit code 1
FAILED: CMakeFiles/flash
Needed an extra power off/on of the mcu and then this problem is solved.
So it seems this will be my sequence:
- Put wt32-eth01 in programming mode (connect IO0 to GND)
- Build with target "Build"
- Power off/on the wt32-eth01 (to avoid the above error)
- Build with target "Deploy"
- Put wt32-eth01 in normal mode (disconnect IO0 from GND)
- Build with target "Xsbug" (with debug target "console")
- Power off/on the wt32-eth01 (to start receiving messages in xsbug-log)
Ok so finally I am ready for the real work. But not there yet:
Problem 1: Catch node
I added an MQTT-Out node, with an incorrect config node (i.e. it made sure the node is pointing to an unexisting MQTT broker). And I also added a Catch node:
Since the MQTT-Out node could not connect to the MQTT broker, the status was "connecting" as expected. And the xsbug-log showed correctly information about this problem:
# starting xsbug
PORT_USED=$(grep 'Serial port' /home/pi/Projects/moddable/build/tmp/esp32/wt32_eth01/debug/t5rg16s07b/xsProj-esp32/flashOutput | awk 'END{print($3)}'); \
cd /home/pi/Projects/moddable/tools/xsbug-log && node xsbug-log bash -c \"XSBUG_PORT=5004 XSBUG_HOST=localhost serial2xsbug /dev/ttyUSB0 460800 8N1\"
# xsbug-log listening on port 5002. ^C to exit.
# Connected to "main"
Skipping Ethernet setup because Wi-Fi SSID is configured.
Wi-Fi connected to "xxxx"
IP address xxxxxxxx
<info>{"payload":1678738507069,"_msgid":"00e8dcaaabb53f82","source":{"id":"b0ce969590fa53d8","type":"debug","name":"debug 23"}}
mqttClient error: unknown
<info>{"payload":1678738512069,"_msgid":"4bbaac55d8904805","source":{"id":"b0ce969590fa53d8","type":"debug","name":"debug 23"}}
<info>{"payload":1678738517069,"_msgid":"0c75047ddcec5b31","source":{"id":"b0ce969590fa53d8","type":"debug","name":"debug 23"}}
mqttClient error: unknown
So far so good. The only thing I don't understand is that I didn't receive any errors on my Catch node output about this. Normally I very rarely use the Catch node, but in this case I had hoped/expected that it could give me enough information without having to relay on xsbug and a serial connection...
If anybody sees a problem in my way of thinking, please share!
Problem 2: flow keeps hanging
Now I entered the correct MQTT broker settings in my MQTT-Out node. But then I get this:
>> IDF_PYTHON_ENV_PATH: /home/pi/.espressif/python_env/idf4.4_py3.9_env
>> mcconfig -d -x localhost:5004 -l -v -m -p esp32/wt32_eth01 -t xsbug ssid=xxx password=yyy
/home/pi/esp-idf/tools/idf.py
# starting xsbug
PORT_USED=$(grep 'Serial port' /home/pi/Projects/moddable/build/tmp/esp32/wt32_eth01/debug/t5rg16s07b/xsProj-esp32/flashOutput | awk 'END{print($3)}'); \
cd /home/pi/Projects/moddable/tools/xsbug-log && node xsbug-log bash -c \"XSBUG_PORT=5004 XSBUG_HOST=localhost serial2xsbug /dev/ttyUSB0 460800 8N1\"
# xsbug-log listening on port 5002. ^C to exit.
# Connected to "main"
Skipping Ethernet setup because Wi-Fi SSID is configured.
Wi-Fi connected to "xxx"
IP address xxxxxxx
# Break: MQTTOutNode.prototype.onStart: cannot coerce undefined to object!
#0: MQTTOutNode.prototype.onStart /home/pi/.node-red/node_modules/@ralphwetzel/node-red-mcu-plugin/node-red-mcu/nodered.js:1247
#1: build /home/pi/Projects/moddable/build/tmp/esp32/wt32_eth01/debug/t5rg16s07b/modules/flows.js:59
#2: RED.build /home/pi/.node-red/node_modules/@ralphwetzel/node-red-mcu-plugin/node-red-mcu/nodered.js:163
#3: main /home/pi/.node-red/mcu-plugin-cache/t5rg16s07b/main.js:3
#4: (host)
#5: @anonymous-2193
#6: (anonymous-649) /home/pi/.node-red/node_modules/@ralphwetzel/node-red-mcu-plugin/node-red-mcu/setupwifi.js:47
#7: (anonymous-812) /home/pi/Projects/moddable/examples/network/wifi/wificonnection/wificonnection.js:95
#8: (host)
XS abort: unhandled exception
# Break: C: xsDebugger!
#0: (host)
#1: @anonymous-2193
#2: (anonymous-649) /home/pi/.node-red/node_modules/@ralphwetzel/node-red-mcu-plugin/node-red-mcu/setupwifi.js:47
#3: (anonymous-812) /home/pi/Projects/moddable/examples/network/wifi/wificonnection/wificonnection.js:95
#4: (host)
# Disconnected from "main"
And the notifications keep popping up in my flow editor:
Since it has an "undefined" at nodered.js at line 1247, I assume the #broker is undefined:
Which means (line 1243) it cannot find my config node, although it is available in my flow editor:
I assume I need to register a issue in the Github repo of node-red-mcu?
But do you have any idea why the notifications keep popping up. Is this perhaps a timer that polls the status every x time?