Troubleshooting

Please let me know when you run into issues. I will update this page with solutions as we find them.

Arduino Troubleshooting

Port doesn’t exist

❯ make upload                                                                                                                                                  (base)
arduino-cli upload . --input-dir build/esp32.esp32.XIAO_ESP32S3
esptool.py v4.6
Serial port /dev/cu.usbmodem2101

A fatal error occurred: Could not open /dev/cu.usbmodem2101, the port doesn't exist
Failed uploading: uploading error: exit status 2
make: *** [upload] Error 1

Solutions: unplug your board and then plug it back in.

Port not found

arduino-cli compile . --config-file ../../arduino.yaml
Error getting port metadata: port not found: /dev/cu.usbmodem2101 serial
make: *** [build/esp32.esp32.XIAO_ESP32S3/PositionControl.ino.bin] Error 1

Solutions: plug your board into the computer.

No serial data received

Here are a few error messages that you might receive relating to “No serial data received”:

A fatal error occurred: No serial data received.
Failed uploading: uploading error: exit status 2
make: *** [upload] Error 1
Sketch uses 886641 bytes (26%) of program storage space. Maximum is 3342336 bytes.
Global variables use 42932 bytes (13%) of dynamic memory, leaving 284748 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.6
Serial port /dev/cu.usbmodem101
Connecting...
Chip is ESP32-S3 (revision v0.2)
Features: WiFi, BLE
Crystal is 40MHz
MAC: 64:e8:33:50:bf:d4
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
A fatal error occurred: No serial data received.
Sketch uses 886641 bytes (26%) of program storage space. Maximum is 3342336 bytes.
Global variables use 42932 bytes (13%) of dynamic memory, leaving 284748 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.6
Serial port /dev/cu.Bluetooth-Incoming-Port
Connecting......................................
A fatal error occurred: Failed to connect to ESP32-S3: No serial data received.
For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html

In each of these cases, you should try the following steps:

  1. Unplug the microcontroller from the computer and plug it back in. Then try again.
  2. Press the “Reset” (R) button on the microcontroller. Then try again.
  3. Perform a full boot-reset:
    1. Connect the microcontroller to power (either through USB or the battery)
    2. Press and hold the “Boot” (B) button
    3. Press and release the “Reset” (R) button
    4. Release the “Boot” (B) button
    5. Attempt to upload the code again

Toit/Jaguar Troubleshooting

No serial data received (Possibility 1)

Try the following steps:

  • Connect the microcontroller to power (either through USB or the battery)
  • Press and hold the “Boot” (B) button
  • Press and release the “Reset” (R) button
  • Release the “Boot” (B) button
  • Attempt to upload the code again

No serial data received (Possibility 2)

If you see an output like the following:

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
Error: exit status 1

It likely means jag is trying to use the wrong port. Try listing the available ports with the following command:

jag port --list

And add the correct port to whatever command you are trying to run. For example:

jag flash --chip esp32s3 --port /dev/cu.usbmodem14401

WARN: connect failed

You might often see an error message like the following:

[toit] INFO: running on ESP32S3 - revision 0.2
[wifi] DEBUG: connecting
[wifi] WARN: connect failed {reason: timeout}
[wifi] DEBUG: closing
[jaguar] WARN: running Jaguar failed due to ‘DEADLINE_EXCEEDED’ (1/3)
[wifi] DEBUG: connecting
[wifi] WARN: connect failed {reason: unknown reason (39)}
[wifi] DEBUG: closing
[jaguar] WARN: running Jaguar failed due to ‘CONNECT_FAILED: unknown reason (39)’ (2/3)
[wifi] DEBUG: connecting
[wifi] WARN: connect failed {reason: unknown reason (39)}
[wifi] DEBUG: closing
[jaguar] WARN: running Jaguar failed due to ‘CONNECT_FAILED: unknown reason (39)’ (3/3)
[jaguar] INFO: backing off for 5s

The first thing you should try is to move your antenna away from other wires and electrical components (e.g., the motors and battery). If that does not work, then try connecting to the TP-Link router instead of Claremont-ETC or PomonaIoT.

PSRAM Initialization Error

You can ignore the following error message:

E (299) quad_psram: PSRAM ID read error: 0x00ffffff, PSRAM chip not found or not supported, or wrong PSRAM line mode
E (299) esp_psram: PSRAM enabled but initialization failed. Bailing out.

Miscellaneous Troubleshooting

npm cannot install wscat

If you see an error message like the following:

> npm install -g wscat

npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/wscat
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir ‘/usr/local/lib/node_modules/wscat’
npm ERR! [Error: EACCES: permission denied, mkdir ‘/usr/local/lib/node_modules/wscat’] {
npm ERR!  errno: -13,
npm ERR!  code: ‘EACCES’,
npm ERR!  syscall: ‘mkdir’,
npm ERR!  path: ‘/usr/local/lib/node_modules/wscat’
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in: /Users/ACCOUNT/.npm/_logs/2024-09-12T17_07_20_354Z-debug-0.log

You will need to either

  • changes the permissions of your /usr/local/lib/node_modules directory, or
  • install wscat with sudo: sudo npm install -g wscat