Topics

Trouble flasing SHC ESP32

Bas Prins
 

Hi,

I'm having problems flashing the ESP32 version of the SHC. My Arduino IDE is 1.8.10. My Onstep version is 1.16h.

There are messages about "esptoo.py" and missing header files in u8g2-master. At some point it was specifically mentioning u8g2lib.h, but it is definitely in folder D:\Documenten\Arduino\libraries\u8g2-master\cppsrc

On the ESP32 a red led is lit, a blue one is flashing.

These are the current messages:

Sketch uses 383962 bytes (29%) of program storage space. Maximum is 1310720 bytes.
Global variables use 20196 bytes (6%) of dynamic memory, leaving 307484 bytes for local variables. Maximum is 327680 bytes.
esptool.py v2.6
Serial port usb:0/140000/0/1
Traceback (most recent call last):
  File "esptool.py", line 2959, in <module>
  File "esptool.py", line 2952, in _main
  File "esptool.py", line 2652, in main
  File "esptool.py", line 222, in __init__
  File "site-packages\serial\__init__.py", line 88, in serial_for_url
  File "site-packages\serial\serialwin32.py", line 62, in open
serial.serialutil.SerialException: could not open port 'usb:0/140000/0/1': WindowsError(123, 'De syntaxis van de bestandsnaam, mapnaam of volumenaam is onjuist.')
Failed to execute script esptool
the selected serial port Failed to execute script esptool
 does not exist or your board is not connected
Invalid library found in D:\Documenten\Arduino\libraries\u8g2-master: no headers files (.h) found in D:\Documenten\Arduino\libraries\u8g2-master
Invalid library found in D:\Documenten\Arduino\libraries\u8g2-master: no headers files (.h) found in D:\Documenten\Arduino\libraries\u8g2-master

I hope someone has a clue about what I'm doing wrong. 

Bas.

Khalid Baheyeldin
 

On Fri, Oct 18, 2019 at 01:05 PM, Bas Prins wrote:
There are messages about "esptoo.py" and missing header files in u8g2-master. At some point it was specifically mentioning u8g2lib.h, but it is definitely in folder D:\Documenten\Arduino\libraries\u8g2-master\cppsrc

On the ESP32 a red led is lit, a blue one is flashing.

These are the current messages:

Sketch uses 383962 bytes (29%) of program storage space. Maximum is 1310720 bytes.
Global variables use 20196 bytes (6%) of dynamic memory, leaving 307484 bytes for local variables. Maximum is 327680 bytes.
esptool.py v2.6
Serial port usb:0/140000/0/1
Traceback (most recent call last):
  File "esptool.py", line 2959, in <module>
  File "esptool.py", line 2952, in _main
  File "esptool.py", line 2652, in main
  File "esptool.py", line 222, in __init__
  File "site-packages\serial\__init__.py", line 88, in serial_for_url
  File "site-packages\serial\serialwin32.py", line 62, in open
serial.serialutil.SerialException: could not open port 'usb:0/140000/0/1': WindowsError(123, 'De syntaxis van de bestandsnaam, mapnaam of volumenaam is onjuist.')
Failed to execute script esptool
the selected serial port Failed to execute script esptool
 does not exist or your board is not connected
Invalid library found in D:\Documenten\Arduino\libraries\u8g2-master: no headers files (.h) found in D:\Documenten\Arduino\libraries\u8g2-master
Invalid library found in D:\Documenten\Arduino\libraries\u8g2-master: no headers files (.h) found in D:\Documenten\Arduino\libraries\u8g2-master
Seems you have two separate issues.

First, the name of the directory ...\libraries\u8g2-master should be ...\libraries\u8g2 (without the -master).
But that does not seem to affect compilation, since you get Sketch uses xxx bytes, ...etc. and an attempt to flash.

Second issue is a USB connection problem. Perhaps you did not select the correct COMx port in the IDE? Perhaps it is on some other port? The error message says "The syntax of the file name, folder name, or volume name is incorrect". I don't use Windows so can't tell what this is.

Bas Prins
 

I think I solved the u8g2 problem by removing it and the re-installing it. I'm not getting the messages about missing .h files anymore.

Com port selection is disabled. While uploading the IDE just shows "NodeMCU32S on usb:0/140000/0/1" at the right hand bottom corner.
If I attempt to open the serial monitor I get: "Board at usb:0/140000/0/1 is not available"

The messages shown are now:

Sketch uses 383962 bytes (29%) of program storage space. Maximum is 1310720 bytes.
Global variables use 20196 bytes (6%) of dynamic memory, leaving 307484 bytes for local variables. Maximum is 327680 bytes.
Traceback (most recent call last):
esptool.py v2.6
  File "esptool.py", line 2959, in <module>
Serial port usb:0/140000/0/1
  File "esptool.py", line 2952, in _main
  File "esptool.py", line 2652, in main
  File "esptool.py", line 222, in __init__
  File "site-packages\serial\__init__.py", line 88, in serial_for_url
  File "site-packages\serial\serialwin32.py", line 62, in open
serial.serialutil.SerialException: could not open port 'usb:0/140000/0/1': WindowsError(123, 'De syntaxis van de bestandsnaam, mapnaam of volumenaam is onjuist.')
Failed to execute script esptool
the selected serial port Failed to execute script esptool
 does not exist or your board is not connected

Bas Prins
 

Okay, feels a  bit stupid, but the USB cable was not as data cable.

I'm still working on the flashing, though. Thought I'd just let you know, not to waste your time.

Bas Prins
 

Next episode...

It seems that I was able to flash the SHC, The Teen Astro splash screen showed.

The Arduino IDE returned this:

Sketch uses 383962 bytes (29%) of program storage space. Maximum is 1310720 bytes.
Global variables use 20196 bytes (6%) of dynamic memory, leaving 307484 bytes for local variables. Maximum is 327680 bytes.
esptool.py v2.6
Serial port COM5
Connecting........_____....._____.....__
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
MAC: 80:7d:3a:b7:c4:c4
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 3276.8 kbit/s)...
Hash of data verified.
Compressed 15856 bytes to 10276...
Writing at 0x00001000... (100 %)
Wrote 15856 bytes (10276 compressed) at 0x00001000 in 0.2 seconds (effective 807.9 kbit/s)...
Hash of data verified.
Compressed 384080 bytes to 220882...
Writing at 0x00010000... (7 %)
Writing at 0x00014000... (14 %)
Writing at 0x00018000... (21 %)
Writing at 0x0001c000... (28 %)
Writing at 0x00020000... (35 %)
Writing at 0x00024000... (42 %)
Writing at 0x00028000... (50 %)
Writing at 0x0002c000... (57 %)
Writing at 0x00030000... (64 %)
Writing at 0x00034000... (71 %)
Writing at 0x00038000... (78 %)
Writing at 0x0003c000... (85 %)
Writing at 0x00040000... (92 %)
Writing at 0x00044000... (100 %)
Wrote 384080 bytes (220882 compressed) at 0x00010000 in 3.5 seconds (effective 870.2 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 128...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (128 compressed) at 0x00008000 in 0.0 seconds (effective 1228.8 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...


That last line, however, seems a bit ambiguous to me. Did it reset, or was it still resetting?

I reflashed Onstep with #define ST4_PULLUP (#define ST4_HAND_CONTROL_ON was already ON).

Now, when I connect the SHC to Onstep. The screen stays black and the DEC motor starts to run spontaneously.
I use a RJ12 Male (6p6c) cable with that was left over from an old telephone. Not sure whether that is what I'm supposed to use.

Any ideas?

Khalid Baheyeldin
 

On Sat, Oct 19, 2019 at 03:23 PM, Bas Prins wrote:
Hard resetting via RTS pin...

That last line, however, seems a bit ambiguous to me. Did it reset, or was it still resetting?
It resets and exists, so the ESP32 should be reset at this point.

I reflashed Onstep with #define ST4_PULLUP (#define ST4_HAND_CONTROL_ON was already ON).
That is correct. Pullup is needed on the STM32 at least. Perhaps others. What is your OnStep board?

Now, when I connect the SHC to Onstep. The screen stays black and the DEC motor starts to run spontaneously.
This tells me that a pin is sending a guide command that OnStep understands as a guiding for DEC.
Are you sure you have resistor networks on the ST4 port on the OnStep side?
Are you sure you have 5V on the last pin on the ST4 port?

I use a RJ12 Male (6p6c) cable with that was left over from an old telephone. Not sure whether that is what I'm supposed to use.
The cable configuration is straight through. Look carefully using a magnifier and see if you can see wire colours on both connectors

Dave Schwartz
 

The cable is likely the problem. Telephone cables are usually wired crossover while ST4 is straight-through.

As Khalid said, look at the colors of the wire insulation with both connectors oriented exactly the same way... the colors must be in the same order left-to-right. That often means that the printing on the cable is on opposite sides as well (picture below). The order of the colors in my cable is, left-to-right, white, black, red, green, yellow, blue (you can't see the blue because of the angle from which I took the picture).


P.S. You aren't the first to have been unable to flash something by using a non-data cable and you won't be the last. Many manufacturers who let you charge a device from a USB port but the device doesn't exchange data over USB will cheap out and omit the data conductors from the cable they include. Probably saves them pennies per thousand but makes the cable unusable with other things.

Bas Prins
 

Hahaha, seems like a real cable drama then. My cable does not look like that. But I’m happy though, seems like an easy fix. Thank you both. (Can’t promise I won’t be back.)

Bas Prins
 

To recap:

  •  USB cable changed to data cable for sketch upload (duh!)
  •  Put on the 5V jumper on the miniPCB for ST4 power
  •  Use a straight through ST4 cable instead of a telephone cable (Wasn't so easy to find over here and didn't want to buy a crimper tool for infrequent use. Bought the cable from an astronomy shop.)

After that still no success! Nothing happened after the TeenAstro splash screen came up.

Then upgraded Onstep to 2.22p, and SHC to 1.5f.


YEA! That did it.

So, thanks again.