So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By Colin Chambers
#90265 The post below relates to the gen4-IoD-32T display from 4D Systems. I’ve already posted it on the 4D forum, but thought it might reach a wider audience with esp8266 experience here. Hopefully someone can help…

I'm new to these displays and tools, but have a little experience with Arduino.
My intention is to use 4D Workshop, but presently I'm just trying to get an example program to load directly from the Arduino IDE.
The platform is Windows XP SP3, Arduino IDE 1.8.9 (portable) and I've tried Python 2.7.18 & 3.4.4, which all look to be XP-compatible.
I can now compile the GFX4d IoDTemplate sketch successfully, but it fails to upload. The error is:

pyserial or esptools directories not found next to this upload.py tool.

I've tried various solutions found on the Arduino and esp8266 forums, to no avail. Both directories are present and I've tried placing the esptool 3.0 and pyserial 3.4 files there manually. I also tried copying the esptool files into the same directory as upload.py, with the same result. I've also tried editing upload.py to do the following:
1. Report sys.path[0] and sys.path[1]. Both look OK.
2. Omitting (commenting out) the except: section. A syntax error is then reported on the next line (cmdline = []).

My impression is that the import esptool line is failing for some reason other than the directories not being present. Not having enough experience with these tools or Python, I don't know what to do to resolve this. Hopefully someone out there can suggest something to edit, replace or move to get past this hurdle. Thanks in advance.

Here's the message report I'm seeing:

Arduino: 1.8.9 (Windows XP), Board: "4D Systems gen4 IoD Range, 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), DOUT (compatible), 2MB (FS:64KB OTA:~992KB), v2 Lower Memory, Disabled, None, Only Sketch, 115200"

Executable segment sizes:


BSS : 36408 ) - zeroed variables (global, static) in RAM/HEAP


IRAM : 27376 / 32768 - code in IRAM (ICACHE_RAM_ATTR, ISRs...)


RODATA : 2792 ) / 81920 - constants (global, static) in RAM/HEAP


DATA : 1320 ) - initialized variables (global, static) in RAM/HEAP


IROM : 265812 - code in flash (default or ICACHE_FLASH_ATTR)


Sketch uses 297300 bytes (28%) of program storage space. Maximum is 1044464 bytes.
Global variables use 40520 bytes (49%) of dynamic memory, leaving 41400 bytes for local variables. Maximum is 81920 bytes.
C:\Arduino-1.8.9\portable\packages\esp8266\tools\python3\3.7.2-post1/python3 C:\Arduino-1.8.9\portable\packages\esp8266\hardware\esp8266\2.7.4/tools/upload.py --chip esp8266 --port COM15 --baud 115200 --before default_reset --after hard_reset write_flash 0x0 C:\DOCUME~1\COLINC~1\LOCALS~1\Temp\arduino_build_791887/IoDTemplate.ino.bin
C:/Arduino-1.8.9/portable/packages/esp8266/hardware/esp8266/2.7.4/tools
C:/Arduino-1.8.9/portable/packages/esp8266/hardware/esp8266/2.7.4/tools/esptool
C:/Arduino-1.8.9/portable/packages/esp8266/hardware/esp8266/2.7.4/tools/pyserial
pyserial or esptool directories not found next to this upload.py tool.
An error occurred while uploading the sketch

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
User avatar
By Colin Chambers
#90272
Colin Chambers wrote:The post below relates to the gen4-IoD-32T display from 4D Systems. I’ve already posted it on the 4D forum, but thought it might reach a wider audience with esp8266 experience here. Hopefully someone can help…

I'm new to these displays and tools, but have a little experience with Arduino.
My intention is to use 4D Workshop, but presently I'm just trying to get an example program to load directly from the Arduino IDE.
The platform is Windows XP SP3, Arduino IDE 1.8.9 (portable) and I've tried Python 2.7.18 & 3.4.4, which all look to be XP-compatible.
I can now compile the GFX4d IoDTemplate sketch successfully, but it fails to upload. The error is:

pyserial or esptools directories not found next to this upload.py tool.

I've tried various solutions found on the Arduino and esp8266 forums, to no avail. Both directories are present and I've tried placing the esptool 3.0 and pyserial 3.4 files there manually. I also tried copying the esptool files into the same directory as upload.py, with the same result. I've also tried editing upload.py to do the following:
1. Report sys.path[0] and sys.path[1]. Both look OK.
2. Omitting (commenting out) the except: section. A syntax error is then reported on the next line (cmdline = []).

My impression is that the import esptool line is failing for some reason other than the directories not being present. Not having enough experience with these tools or Python, I don't know what to do to resolve this. Hopefully someone out there can suggest something to edit, replace or move to get past this hurdle. Thanks in advance.

Here's the message report I'm seeing:

Arduino: 1.8.9 (Windows XP), Board: "4D Systems gen4 IoD Range, 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), DOUT (compatible), 2MB (FS:64KB OTA:~992KB), v2 Lower Memory, Disabled, None, Only Sketch, 115200"

Executable segment sizes:


BSS : 36408 ) - zeroed variables (global, static) in RAM/HEAP


IRAM : 27376 / 32768 - code in IRAM (ICACHE_RAM_ATTR, ISRs...)


RODATA : 2792 ) / 81920 - constants (global, static) in RAM/HEAP


DATA : 1320 ) - initialized variables (global, static) in RAM/HEAP


IROM : 265812 - code in flash (default or ICACHE_FLASH_ATTR)


Sketch uses 297300 bytes (28%) of program storage space. Maximum is 1044464 bytes.
Global variables use 40520 bytes (49%) of dynamic memory, leaving 41400 bytes for local variables. Maximum is 81920 bytes.
C:\Arduino-1.8.9\portable\packages\esp8266\tools\python3\3.7.2-post1/python3 C:\Arduino-1.8.9\portable\packages\esp8266\hardware\esp8266\2.7.4/tools/upload.py --chip esp8266 --port COM15 --baud 115200 --before default_reset --after hard_reset write_flash 0x0 C:\DOCUME~1\COLINC~1\LOCALS~1\Temp\arduino_build_791887/IoDTemplate.ino.bin
C:/Arduino-1.8.9/portable/packages/esp8266/hardware/esp8266/2.7.4/tools
C:/Arduino-1.8.9/portable/packages/esp8266/hardware/esp8266/2.7.4/tools/esptool
C:/Arduino-1.8.9/portable/packages/esp8266/hardware/esp8266/2.7.4/tools/pyserial
pyserial or esptool directories not found next to this upload.py tool.
An error occurred while uploading the sketch

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.


Further to my last post, I realised the except: section is probably required syntax, so instead I tried just commenting out the sys.exit(1) statement. The last part of the message report is now:

C:\Arduino-1.8.9\portable\packages\esp8266\tools\python3\3.7.2-post1/python3 C:\Arduino-1.8.9\portable\packages\esp8266\hardware\esp8266\2.7.4/tools/upload.py --chip esp8266 --port COM15 --baud 115200 --before default_reset --after hard_reset write_flash 0x0 C:\DOCUME~1\COLINC~1\LOCALS~1\Temp\arduino_build_573580/IoDTemplate.ino.bin
C:/Arduino-1.8.9/portable/packages/esp8266/hardware/esp8266/2.7.4/tools
C:/Arduino-1.8.9/portable/packages/esp8266/hardware/esp8266/2.7.4/tools/esptool
C:/Arduino-1.8.9/portable/packages/esp8266/hardware/esp8266/2.7.4/tools/pyserial
pyserial or esptool directories not found next to this upload.py tool.
Traceback (most recent call last):
File "C:\Arduino-1.8.9\portable\packages\esp8266\hardware\esp8266\2.7.4/tools/upload.py", line 71, in <module>
esptool.main(cmdline)
NameError: name 'esptool' is not defined
NameError: name 'esptool' is not defined

So it looks like esptool is not recognised, which I guess is consistent with the import failing.

By the way, I originally tried this with a standard Arduino installation and saw the same problem. I moved to a "portable" installation, albeit still on C:\, as I saw some posts suggesting it might be more reliable. It didn't seem to make any difference.

I'm really not sure what to try next.