ESP32 Built-in OLED – Heltec WiFi Kit 32 DCC++ Questions

LMSFan72 Jan 15, 2019

  1. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    With development branch running as per above, I connected the motor shield, attached as per photo..

    The interesting thing is that with the shield on there is power to the track even when the OLED says power off. However, with track on or off although I can see volts on the track no command gets sent (loco will not respond).... This seems to support the behavior without a shield on where I get over-current faults. I must be missing something (or faulty hardware?)
     

    Attached Files:

  2. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    I will add that the motor shield works fine - it is the one I use on my Arduino Uno DCC++ station and it is faultless!
     
  3. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    I am not sure what the LEDs on the shield show. On my DCC++ they are off until I enable track power on the station. When I enable power both pairs of LEDs for A and B light up. On the ESP32 I get the "2nd" LED of output A lit permanently when the ESP32 is powered up - and no others when I do anything else. (By the 2nd I mean the one closes to the B output.
     
  4. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    There is an LED on the ESP32 that flashes continuously - not sure what it indicates. However, it is on pin 25 so I suspect that may be one issue.
     
  5. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    I just retried the development branch build with the RHS pins 12,13,14,27. I thought if I connect each output with an LED between itself and GND I might "see what's going on". Basically the LEDs are lit for 12, 13, 14 but not 27. Toggling the power doesn't switch any of them - although there may be an instantaneous switch off-on on the ENABLE_PIN_MAIN
     
  6. Atani

    Atani TrainBoard Member

    1,469
    1,756
    37
    These are sourced from the pins_arduino.h that is included via the Arduino.h file. The specific pins_arduino.h file that gets picked up is based on the board type you define in platformio.ini. Which board type did you pick in the ini file?

    Can you also open a terminal and run "platformio run -v" and paste the output from the compilation phase? It doesn't need to be the full output (it will be huge) but one showing the compiler options passed into the ArduinoFramework compilation phase. It may have the options in a "long options" file prefixed with an @ sign.

    Nope, not missing anything... I updated the file last night after posting to remove the ifdef/endif around the NextionInterface.h so that it is always included, you can see that in the latest development branch on line 90.
     
  7. Atani

    Atani TrainBoard Member

    1,469
    1,756
    37
    the wiring looks ok, I think. It is possible the ESP32 board has some of these pins in use by other hardware that we haven't taken into account.

    double check wiring, the lights should be the same as on the Arduino Uno. either all on or all off depending on track output. With the lights coming on (even one of them) with the track power set to OFF on the base station it would appear that one (or both?) of the enable pins is incorrectly held HIGH by the ESP32 board. I'd suggest shift both of the enable pins to a different pair and see if that works.

    If that LED is flashing with the track power OFF then that means it is being used by the board for something else and we should move the MAIN track enable pin to another pin.

    whichever pins you have selected for DIRECTION will almost always remain on due to the frequency at which the polarity shifts as part of the DCC signal. With track power OFF though the ENABLE pins should remain LOW (GND) so the LED should be OFF. This heltic board may take some experimentation to find a set of pins for ENABLE/DIRECTION/CURRENT_SENSE that work reliably. Since the board has a built-in OLED and non-standard I2C pin assignments there is bound to be a few pins that are used by the board itself.
     
  8. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    I run out of terminal output (it replaces the lines) so this is all I could capture...I will also capture the non-verbose output

    Processing heltec_wifi_kit_32 (framework: arduino; lib_deps: SPI, ArduinoJson@5.13.4, AsyncTCP@1.0.3, ESP Async WebServer, ESP8266_SSD1306, LiquidCrystal_PCF8574, ESPmDNS, Wire, EEPROM; build_flags: -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_VERBOSE; monitor_speed: 115200;
    platform: espressif32; board: heltec_wifi_kit_32; lib_ldf_mode: chain+; board_build.partitions: minimal.csv; lib_compat_mode: 2)
    -------------------------------------------------------------------------------------------------------------------------------------
    Library Storage: C:\Users\andre.DESKTOP-TLMQMS5\Downloads\DCCppESP32-development\DCCppESP32-development\.piolibdeps
    Looking for SPI library in registry
    Warning! Library `{'requirements': None, 'name': 'SPI'}` has not been found in PlatformIO Registry.
    You can ignore this message, if `{'requirements': None, 'name': 'SPI'}` is a built-in library (included in framework, SDK). E.g., SPI, Wire, etc.
    LibraryManager: Installing id=64 @ 5.13.4
    ArduinoJson @ 5.13.4 is already installed
    LibraryManager: Installing id=1826 @ 1.0.3
    AsyncTCP @ 1.0.3 is already installed
    LibraryManager: Installing id=306
    ESP Async WebServer @ 1.2.0 is already installed
    Installing dependencies
    LibraryManager: Installing id=305
    ESPAsyncTCP @ 1.2.0 is already installed
    LibraryManager: Installing id=1826
    AsyncTCP @ 1.0.3 is already installed
    LibraryManager: Installing id=562
    ESP8266_SSD1306 @ 4.0.0 is already installed
    LibraryManager: Installing id=1165
    LiquidCrystal_PCF8574 @ 1.1.0 is already installed
    Looking for ESPmDNS library in registry
    Warning! Library `{'requirements': None, 'name': 'ESPmDNS'}` has not been found in PlatformIO Registry.
    You can ignore this message, if `{'requirements': None, 'name': 'ESPmDNS'}` is a built-in library (included in framework, SDK). E.g.,
    SPI, Wire, etc.
    Looking for Wire library in registry
    Warning! Library `{'requirements': None, 'name': 'Wire'}` has not been found in PlatformIO Registry.
    You can ignore this message, if `{'requirements': None, 'name': 'Wire'}` is a built-in library (included in framework, SDK). E.g., SPI, Wire, etc.
    Looking for EEPROM library in registry
    Conflict: More than one library has been found by request {"requirements": null, "name": "EEPROM"}:
    eeprom
    ======
    #ID: 2284
    I2C EEPROM library from 24C01 to 24C1025
    Keywords: eeprom
    Compatible frameworks: mbed
    Compatible platforms: Atmel SAM, Freescale Kinetis, Maxim Integrated MAX32, Nordic nRF51, Nordic nRF52, NXP LPC, Silicon Labs EFM32, ST STM32, Teensy, WIZNet W7500
    Authors: bernard borredon
    EEPROM
    ======
    #ID: 3516
    I2C EEPROM library for 1k to 512k chip
    Keywords: c24lcxxx, eeprom, i2c
    Compatible frameworks: mbed
    Compatible platforms: Atmel SAM, Freescale Kinetis, Maxim Integrated MAX32, Nordic nRF51, Nordic nRF52, NXP LPC, Silicon Labs EFM32, ST STM32, Teensy, WIZNet W7500
    Authors: Wojciech Biegun
    eeprom
    ======
    #ID: 2286
    LPC11U24 internal EEPROM
    Keywords: eeprom, lpc11u24
    Compatible frameworks: mbed
    Compatible platforms: Atmel SAM, Freescale Kinetis, Maxim Integrated MAX32, Nordic nRF51, Nordic nRF52, NXP LPC, Silicon Labs EFM32, ST STM32, Teensy, WIZNet W7500
    Authors: Suga koubou
    EEPROM
    ======
    #ID: 2201
    EEPROM in TG-LPC11U35-501
    Keywords: eeprom
    Compatible frameworks: mbed
    Compatible platforms: Atmel SAM, Freescale Kinetis, Maxim Integrated MAX32, Nordic nRF51, Nordic nRF52, NXP LPC, Silicon Labs EFM32, ST STM32, Teensy, WIZNet W7500
    Authors: yasuyuki onodera
    eeprom
    ======
    #ID: 2287
    STM32 EEPROM emulation AN2594
    Keywords: eeprom, flash, stm32f10x
    Compatible frameworks: mbed
    Compatible platforms: Atmel SAM, Freescale Kinetis, Maxim Integrated MAX32, Nordic nRF51, Nordic nRF52, NXP LPC, Silicon Labs EFM32, ST STM32, Teensy, WIZNet W7500
    Authors: Chau Vo
    eeprom
    ======
    #ID: 3514
    stm32l053 eeprom
    Keywords: eeprom, read, stm32
    Compatible frameworks: mbed
    Compatible platforms: Atmel SAM, Freescale Kinetis, Maxim Integrated MAX32, Nordic nRF51, Nordic nRF52, NXP LPC, Silicon Labs EFM32, ST STM32, Teensy, WIZNet W7500
    Authors: lzbp li
    eeprom
    ======
    #ID: 2179
    sf
    Keywords: eeprom
    Compatible frameworks: mbed
    Compatible platforms: Atmel SAM, Freescale Kinetis, Maxim Integrated MAX32, Nordic nRF51, Nordic nRF52, NXP LPC, Silicon Labs EFM32, ST STM32, Teensy, WIZNet W7500
    Authors: li lei
    Automatically chose the first available library (use `--interactive` option to make a choice)
    Found: https://platformio.org/lib/show/2284/eeprom
    LibraryManager: Installing id=2284
    eeprom @ 925096a4c7 is already installed
    CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/heltec_wifi_kit_32.html
    PLATFORM: Espressif 32 > Heltec WIFI Kit 32
    HARDWARE: ESP32 240MHz 320KB RAM (4MB Flash)
    DEBUG: CURRENT(esp-prog) EXTERNAL(esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
    Library Dependency Finder -> http://bit.ly/configure-pio-ldf
    LDF MODES: FINDER(chain+) COMPATIBILITY(strict)
    Platform incompatible library C:\Users\andre.DESKTOP-TLMQMS5\Downloads\DCCppESP32-development\DCCppESP32-development\.piolibdeps\ESPAsyncTCP_ID305
    Platform incompatible library C:\Users\andre.DESKTOP-TLMQMS5\.platformio\packages\framework-arduinoespressif32\libraries\AsyncUDP
    CMollected 33 compatible librariesore details about "Library Compatibility Mode": https://docs.platformio.org/page/librarymanager/ldf.html#ldf-compat-mode
    Scanning dependencies...
    Skip platform incompatible dependency {u'platforms': [u'espressif8266'], u'name': u'ESPAsyncTCP'}
    Dependency Graph
    |-- <SPI> 1.0 (C:\Users\andre.DESKTOP-TLMQMS5\.platformio\packages\framework-arduinoespressif32\libraries\SPI)
    |-- <ArduinoJson> 5.13.4 (C:\Users\andre.DESKTOP-TLMQMS5\Downloads\DCCppESP32-development\DCCppESP32-development\.piolibdeps\ArduinoJson_ID64)
    |-- <AsyncTCP> 1.0.3 (C:\Users\andre.DESKTOP-TLMQMS5\Downloads\DCCppESP32-development\DCCppESP32-development\.piolibdeps\AsyncTCP_ID1826)
    |-- <ESP Async WebServer> 1.2.0 (C:\Users\andre.DESKTOP-TLMQMS5\Downloads\DCCppESP32-development\DCCppESP32-development\.piolibdeps\ESP Async WebServer_ID306)
    | |-- <AsyncTCP> 1.0.3 (C:\Users\andre.DESKTOP-TLMQMS5\Downloads\DCCppESP32-development\DCCppESP32-development\.piolibdeps\AsyncTCP_ID1826)
    | |-- <WiFi> 1.0 (C:\Users\andre.DESKTOP-TLMQMS5\.platformio\packages\framework-arduinoespressif32\libraries\WiFi)
    | |-- <FS> 1.0 (C:\Users\andre.DESKTOP-TLMQMS5\.platformio\packages\framework-arduinoespressif32\libraries\FS)
    | |-- <ArduinoJson> 5.13.4 (C:\Users\andre.DESKTOP-TLMQMS5\Downloads\DCCppESP32-development\DCCppESP32-development\.piolibdeps\ArduinoJson_ID64)
    |-- <ESP8266_SSD1306> 4.0.0 (C:\Users\andre.DESKTOP-TLMQMS5\Downloads\DCCppESP32-development\DCCpp
     
  9. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    Processing heltec_wifi_kit_32 (framework: arduino; platform: espressif32; board: heltec_wifi_kit_32)
    -------------------------------------------------------------------------------------------------------------------------------------
    Verbose mode can be enabled via `-v, --verbose` option
    CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/heltec_wifi_kit_32.html
    PLATFORM: Espressif 32 > Heltec WIFI Kit 32
    HARDWARE: ESP32 240MHz 320KB RAM (4MB Flash)
    DEBUG: CURRENT(esp-prog) EXTERNAL(esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
    Library Dependency Finder -> http://bit.ly/configure-pio-ldf
    LDF MODES: FINDER(chain+) COMPATIBILITY(strict)
    Collected 33 compatible libraries
    Scanning dependencies...
    Dependency Graph
    |-- <SPI> 1.0
    |-- <ArduinoJson> 5.13.4
    |-- <AsyncTCP> 1.0.3
    |-- <ESP Async WebServer> 1.2.0
    | |-- <AsyncTCP> 1.0.3
    | |-- <FS> 1.0
    | |-- <ArduinoJson> 5.13.4
    | |-- <WiFi> 1.0
    |-- <ESP8266_SSD1306> 4.0.0
    | |-- <Wire> 1.0.1
    | |-- <SPI> 1.0
    |-- <LiquidCrystal_PCF8574> 1.1.0
    | |-- <Wire> 1.0.1
    |-- <ESPmDNS> 1.0
    | |-- <WiFi> 1.0
    |-- <Wire> 1.0.1
    |-- <EEPROM> 1.0
    |-- <SPIFFS> 1.0
    | |-- <FS> 1.0
    |-- <WiFi> 1.0
    |-- <FS> 1.0
    Compiling .pioenvs\heltec_wifi_kit_32\src\ConfigurationManager.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\DCCppESP32.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\DCCppProtocol.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\HC12Interface.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\InfoScreen.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\LocoNet2\LocoNet.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\LocoNet2\LocoNetAvrICP.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\LocoNet2\LocoNetCV.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\LocoNet2\LocoNetESP32.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\LocoNet2\LocoNetESP32UART.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\LocoNet2\LocoNetFastClock.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\LocoNet2\LocoNetMessageBuffer.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\LocoNet2\LocoNetSystemVariable.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\LocoNet2\LocoNetThrottle.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\LocoNet2\LocoNetUART.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\Locomotive.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\LocomotiveConsist.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\LocomotiveManager.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\MotorBoard.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\NeoNextion\INextionColourable.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\NeoNextion\INextionFontStyleable.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\NeoNextion\INextionTouchable.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\NeoNextion\INextionWidget.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\NeoNextion\Nextion.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\NeoNextion\NextionCrop.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\NeoNextion\NextionPage.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\NeoNextion\NextionPicture.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\NeoNextion\NextionSlidingText.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\NeoNextion\NextionTimer.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\NeoNextion\NextionWaveform.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\NextionInterface.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\NextionInterfaceAddressPage.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\NextionInterfaceBasePage.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\NextionInterfaceThrottlePage.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\NextionInterfaceTurnoutPage.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\Outputs.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\RemoteSensors.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\S88Sensors.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\Sensors.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\SignalGenerator.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\Turnouts.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\WebServer.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\src\WiFiInterface.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\libd8c\SPI\SPI.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\lib076\FS\FS.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\lib076\FS\vfs_api.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\libf97\WiFi\ETH.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\libf97\WiFi\WiFi.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\libf97\WiFi\WiFiAP.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\libf97\WiFi\WiFiClient.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\libf97\WiFi\WiFiGeneric.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\libf97\WiFi\WiFiMulti.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\libf97\WiFi\WiFiSTA.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\libf97\WiFi\WiFiScan.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\libf97\WiFi\WiFiServer.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\libf97\WiFi\WiFiUdp.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\lib1c2\Wire\Wire.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\lib0dd\ESPmDNS\ESPmDNS.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\lib498\EEPROM\EEPROM.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\lib09f\SPIFFS\SPIFFS.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\Esp.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\FunctionalInterrupt.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\HardwareSerial.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\IPAddress.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\IPv6Address.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\MD5Builder.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\Print.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\Stream.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\StreamString.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\WMath.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\WString.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\base64.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\cbuf.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\esp32-hal-adc.c.o
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\esp32-hal-bt.c.o
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\esp32-hal-cpu.c.o
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\esp32-hal-dac.c.o
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\esp32-hal-gpio.c.o
    C:\Users\andre.DESKTOP-TLMQMS5\.platformio\packages\framework-arduinoespressif32\cores\esp32\esp32-hal-cpu.c: In function 'setCpuFrequencyMhz':
    C:\Users\andre.DESKTOP-TLMQMS5\.platformio\packages\framework-arduinoespressif32\cores\esp32\esp32-hal-cpu.c:134:14: warning: variable 'min_cpu_mhz' set but not used [-Wunused-but-set-variable]
    uint32_t min_cpu_mhz = 10;
    ^
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\esp32-hal-i2c.c.o
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\esp32-hal-ledc.c.o
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\esp32-hal-matrix.c.o
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\esp32-hal-misc.c.o
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\esp32-hal-psram.c.o
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\esp32-hal-rmt.c.o
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\esp32-hal-sigmadelta.c.o
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\esp32-hal-spi.c.o
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\esp32-hal-time.c.o
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\esp32-hal-timer.c.o
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\esp32-hal-touch.c.o
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\esp32-hal-uart.c.o
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\libb64\cdecode.c.o
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\libb64\cencode.c.o
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\main.cpp.o
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\stdlib_noniso.c.o
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\wiring_pulse.c.o
    Compiling .pioenvs\heltec_wifi_kit_32\FrameworkArduino\wiring_shift.c.o
    Linking .pioenvs\heltec_wifi_kit_32\firmware.elf
    Retrieving maximum program size .pioenvs\heltec_wifi_kit_32\firmware.elf
    Building .pioenvs\heltec_wifi_kit_32\firmware.bin
    Checking size .pioenvs\heltec_wifi_kit_32\firmware.elf
    Memory Usage -> http://bit.ly/pio-memory-usage
    DATA: [== ] 19.5% (used 63856 bytes from 327680 bytes)
    PROGRAM: [======= ] 74.9% (used 981650 bytes from 1310720 bytes)
    esptool.py v2.6
    Configuring upload protocol...
    AVAILABLE: esp-prog, esptool, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa
    CURRENT: upload_protocol = esptool
    Looking for upload port...
    Auto-detected: COM3
    Uploading .pioenvs\heltec_wifi_kit_32\firmware.bin
    esptool.py v2.6
    Serial port COM3
    Connecting.....
    Chip is ESP32D0WDQ6 (revision 1)
    Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
    MAC: 3c:71:bf:ab:5b:30
    Uploading stub...
    Running stub...
    Stub running...
    Changing baud rate to 921600
    Changed.
    Configuring flash size...
    Auto-detected Flash size: 4MB
    Compressed 16176 bytes to 10658...
    Wrote 16176 bytes (10658 compressed) at 0x00001000 in 0.1 seconds (effective 911.3 kbit/s)...
    Hash of data verified.
    Compressed 3072 bytes to 134...
    Wrote 3072 bytes (134 compressed) at 0x00008000 in 0.0 seconds (effective 2234.2 kbit/s)...
    Hash of data verified.
    Compressed 8192 bytes to 47...
    Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 6553.6 kbit/s)...
    Hash of data verified.
    Compressed 981760 bytes to 547614...
     
  10. Atani

    Atani TrainBoard Member

    1,469
    1,756
    37
  11. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    So I will use an LED trying to find a pin where the LED is not lit when I power it up, then update the enable/dirn/current sense to those I find we may have a way - just by systematically trying....Can I do any damage just by connecting an LED between any pinout and GND?
     
  12. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
  13. Atani

    Atani TrainBoard Member

    1,469
    1,756
    37
    you may want to connect a resistor with the LED to ensure you don't send too much current to the LED.

    For the current sense pins, those will need to be any of the ADC1_? inputs, many of these are input only so they shouldn't be a problem.
     
  14. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    OK, so I ran through that. Most of the pins on the RHS have voltage. Now I know some of these still may be used for other things, but, those that didn't light the LED are:

    17, 5, 18, 23, 19, 22, 21
    27, 34, 39, 38, 37, 36

    Therefore i went for the following:


    #define MOTORBOARD_ENABLE_PIN_MAIN 27
    #define MOTORBOARD_CURRENT_SENSE_MAIN ADC1_CHANNEL_0 //(pin 36)
    #define MOTORBOARD_ENABLE_PIN_PROG 23
    #define MOTORBOARD_CURRENT_SENSE_PROG ADC1_CHANNEL_3 //(pin 39)
    #define DCC_SIGNAL_PIN_OPERATIONS 19
    #define DCC_SIGNAL_PIN_PROGRAMMING 28

    This, without the motor shield, seems to work. I will try the motor shield over the weekend.

    I also believe the JMRI error is caused by the network not connecting properyl. I have 2 routers. One it doesn't seem to like!!
     
  15. Atani

    Atani TrainBoard Member

    1,469
    1,756
    37
    Your pin selection looks good. I'd say give it a try and hopefully it will all work well.

    Sent from my ONEPLUS A5010 using Tapatalk
     
  16. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    Just realised that last one should be 18 not 28 - typo!
     
  17. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    I decided to try this on a pololu shield instead. I changed Config_MotorBoard.h to show:
    #define MOTORBOARD_TYPE_PROG POLOLU

    Is that the only change I need? I then connected as I had used for my DCC++ Arduino Mega:
    5V ESP32 -> shield VDD
    GND ESP32-> shield GND
    Pin 27 (MOTORBOARD_ENABLE_PIN_MAIN)-> shield pin D2
    Pin 36 (MOTORBOARD_CURRENT_SENSE_MAIN)-> shield pin A0
    Pin 19 (DCC_SIGNAL_PIN_OPERATIONS) -> shield pin 12 (M1DIR)
    Pin 23 (MOTORBOARD_ENABLE_PIN_PROG) -> shield pin M2PWM
    Pin 39 (MOTORBOARD_CURRENT_SENSE_PROG) -> shield pin A1
    Pin 18 (DCC_SIGNAL_PIN_PROGRAMMING) -> shield pin 8 (M2DIR)

    I have the traces cut on the jumpers for pins 12, 10, 4

    Initial testing suggests it's not working, so, does this seem correct - I wonder if I should be connecting M1PWM in place of D2?
     
  18. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    I'm also now wondering if I have connected power correctly... Should I be taking the 5V from the ESP32 to Vin rather than VDD (or 5V on the Arduino Motor Shield)
     
  19. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    Correction:
    Pin 19 (DCC_SIGNAL_PIN_OPERATIONS) -> shield pin 7 (M1DIR)
     
  20. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    I think I have answered this myself - it goes to both I think...Still not working though..
     

Share This Page