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

LMSFan72 Jan 15, 2019

  1. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    Hi

    I thought I'd have a go at building the DCC++ base station on this OLED equipped ESP32. I thought I'd install without any motor shields just to try the device out. My initial build seems to work - I get the below output when I use Serial Monitor (IP addresses replaced):


    ets Jun 8 2016 00:22:57
    rst:0x1 (POWERON_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
    configsip: 0, SPIWP:0xee
    clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
    mode:DIO, clock div:2
    load:0x3fff0018,len:4
    load:0x3fff001c,len:928
    ho 0 tail 12 room 4
    load:0x40078000,len:9280
    load:0x40080400,len:5860
    entry 0x40080698
    [DCCppESP32.cpp:164] setup(): DCC++ ESP starting up
    Unable to initialize InfoScreen, switching to Serial
    DCC++ESP: v1.1.2
    IP:pending
    [WiFiInterface.cpp:53] begin(): Connecting to WiFi: WIFI_SSID
    [D][WiFiGeneric.cpp:342] _eventCallback(): Event: 0 - WIFI_READY
    [D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
    [WiFiInterface.cpp:55] begin(): Waiting for WiFi to connect
    [D][WiFiGeneric.cpp:342] _eventCallback(): Event: 4 - STA_CONNECTED
    [WiFiInterface.cpp:62] begin(): WiFi status: 0


    [WiFiInterface.cpp:62] begin(): WiFi status: 0
    [D][WiFiGeneric.cpp:342] _eventCallback(): Event: 7 - STA_GOT_IP
    [D][WiFiGeneric.cpp:385] _eventCallback(): STA IP: 111.111.111.111, MASK: 111.111.111.111, GW: 111.111.111.111
    111.111.111.111
    [MotorBoard.cpp:37] GenericMotorBoard(): [MAIN] Configuring motor board [ADC1 Channel: 0, currentLimit: 2007, enablePin: 25]
    [MotorBoard.cpp:37] GenericMotorBoard(): [PROG] Configuring motor board [ADC1 Channel: 3, currentLimit: 2007, enablePin: 23]
    [V][DCCppProtocol.cpp:262] registerCommand(): Registering interface command t
    [V][DCCppProtocol.cpp:262] registerCommand(): Registering interface command f
    [V][DCCppProtocol.cpp:262] registerCommand(): Registering interface command a
    [V][DCCppProtocol.cpp:262] registerCommand(): Registering interface command 1
    [V][DCCppProtocol.cpp:262] registerCommand(): Registering interface command 0
    [V][DCCppProtocol.cpp:262] registerCommand(): Registering interface command c
    [V][DCCppProtocol.cpp:262] registerCommand(): Registering interface command s
    [V][DCCppProtocol.cpp:262] registerCommand(): Registering interface command R
    [V][DCCppProtocol.cpp:262] registerCommand(): Registering interface command W
    [V][DCCppProtocol.cpp:262] registerCommand(): Registering interface command B
    [V][DCCppProtocol.cpp:262] registerCommand(): Registering interface command w
    [V][DCCppProtocol.cpp:262] registerCommand(): Registering interface command b
    [V][DCCppProtocol.cpp:262] registerCommand(): Registering interface command e
    [V][DCCppProtocol.cpp:262] registerCommand(): Registering interface command E
    [V][DCCppProtocol.cpp:262] registerCommand(): Registering interface command Z
    [V][DCCppProtocol.cpp:262] registerCommand(): Registering interface command T
    [V][DCCppProtocol.cpp:262] registerCommand(): Registering interface command S
    [Outputs.cpp:100] init(): Initializing outputs
    [E][Preferences.cpp:330] getUShort(): nvs_get_u16 fail: OutputCount NOT_FOUND
    [Outputs.cpp:102] init(): Found 0 outputs
    [Turnouts.cpp:78] init(): Initializing turnout list
    [E][Preferences.cpp:330] getUShort(): nvs_get_u16 fail: TurnoutCount NOT_FOUND
    [Turnouts.cpp:80] init(): Found 0 turnouts
    [Sensors.cpp:81] init(): Initializing sensors list
    [E][Preferences.cpp:330] getUShort(): nvs_get_u16 fail: SensorCount NOT_FOUND
    [Sensors.cpp:83] init(): Found 0 sensors
    [SignalGenerator.cpp:217] startSignal(): [OPS] Adding reset packet to packet queue
    [SignalGenerator.cpp:219] startSignal(): [OPS] Adding idle packet to packet queue
    [SignalGenerator.cpp:222] startSignal(): [OPS] Configuring Timer(0) for generating DCC Signal (Full Wave)
    [SignalGenerator.cpp:224] startSignal(): [OPS] Attaching interrupt handler to Timer(0)
    [SignalGenerator.cpp:226] startSignal(): [OPS] Configuring alarm on Timer(0) to 116us
    [SignalGenerator.cpp:228] startSignal(): [OPS] Setting load on Timer(0) to zero
    [I][SignalGenerator.cpp:231] startSignal(): [OPS] Configuring Timer(1) for generating DCC Signal (Half Wave)
    [I][SignalGenerator.cpp:233] startSignal(): [OPS] Attaching interrupt handler to Timer(1)
    [I][SignalGenerator.cpp:235] startSignal(): [OPS] Configuring alarm on Timer(1) to 58us
    [I][SignalGenerator.cpp:237] startSignal(): [OPS] Setting load on Timer(1) to zero
    [I][SignalGenerator.cpp:240] startSignal(): [OPS] Enabling alarm on Timer(0)
    [I][SignalGenerator.cpp:242] startSignal(): [OPS] Enabling alarm on Timer(1)
    [I][SignalGenerator.cpp:217] startSignal(): [PROG] Adding reset packet to packet queue
    [I][SignalGenerator.cpp:219] startSignal(): [PROG] Adding idle packet to packet queue
    [I][SignalGenerator.cpp:222] startSignal(): [PROG] Configuring Timer(2) for generating DCC Signal (Full Wave)
    [I][SignalGenerator.cpp:224] startSignal(): [PROG] Attaching interrupt handler to Timer(2)
    [I][SignalGenerator.cpp:226] startSignal(): [PROG] Configuring alarm on Timer(2) to 116us
    [I][SignalGenerator.cpp:228] startSignal(): [PROG] Setting load on Timer(2) to zero
    [I][SignalGenerator.cpp:231] startSignal(): [PROG] Configuring Timer(3) for generating DCC Signal (Half Wave)
    [I][SignalGenerator.cpp:233] startSignal(): [PROG] Attaching interrupt handler to Timer(3)
    [I][SignalGenerator.cpp:235] startSignal(): [PROG] Configuring alarm on Timer(3) to 58us
    [I][SignalGenerator.cpp:237] startSignal(): [PROG] Setting load on Timer(3) to zero
    [I][SignalGenerator.cpp:240] startSignal(): [PROG] Enabling alarm on Timer(2)
    [I][SignalGenerator.cpp:242] startSignal(): [PROG] Enabling alarm on Timer(3)
    [I][DCCppESP32.cpp:192] setup(): DCC++ READY![/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I]
    [I][I][I][I][I][I][I][I][I][I][I][I][I][I][I][I][I][I]


    So it looks to me like it should work. However, I note 2 things:

    1. I took a flier with this chip that the OLED was a supported chip. It's actually an SSD1306 not an SH1306. I don't get anything on the display and I see the monitor says "Unable to initialize InfoScreen". Is this likely to be the cause. I'd appreciate any tips on how to fix this/switch the library, etc...

    2. Sending <0> or <1> or any other command for that matter doesn't generate any response in the serial monitor window. Given the ESP32 has no shields on is this expected?

    I am a very early stage beginner on this, so, all help greatly received! Thanks[/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i]
     
  2. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    OK, Some immediate re-reading of the config.h file helped me with some of part 1. I found the lines to use for a Heltec device. I am now trying to find the correct I2C address.... new output shows:

    rst:0x1 (POWERON_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
    configsip: 0, SPIWP:0xee
    clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
    mode:DIO, clock div:2
    load:0x3fff0018,len:4
    load:0x3fff001c,len:928
    ho 0 tail 12 room 4
    load:0x40078000,len:9280
    load:0x40080400,len:5860
    entry 0x40080698
    [DCCppESP32.cpp:164] setup(): DCC++ ESP starting up
    [V][esp32-hal-i2c.c:1483] i2cInit(): num=0 sda=21 scl=22 freq=0
    [V][esp32-hal-i2c.c:1677] i2cSetFrequency(): freq=100000Hz
    [V][esp32-hal-i2c.c:1692] i2cSetFrequency(): cpu Freq=240Mhz, i2c Freq=100000Hz
    [V][esp32-hal-i2c.c:1698] i2cSetFrequency(): Fifo delta=1
    OLED screen not found at 0x3C
    Unable to initialize InfoScreen, switching to Serial
     
  3. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    OK, solved the screen with the following settings - it was the pin set ups causing the problems:

    // DEFINE INFO SCREEN Parameters
    //
    // BOTH OLED AND LCD SCREENS ARE SUPPORTED

    // If the ESP32 board does not use standard SDA/SCL pins as defined in pins_arduino.h
    // uncomment the next two lines and define the pins that need to be used instead.
    #define INFO_SCREEN_SDA_PIN 4//SDA
    #define INFO_SCREEN_SCL_PIN 15//SCL

    // If your board is a Heltec variant, uncomment the following line to enable the
    // OLED reset support for this board.
    #define INFO_SCREEN_RESET_PIN 16//15

    // OLED SCREEN PARAMETERS
    #define INFO_SCREEN_OLED true
    // OLED SUPPORTED CHIPSETS: SH1106, SH1306
    #define OLED_CHIPSET SH1306
    #define INFO_SCREEN_OLED_I2C_ADDRESS 0x3C
    #define INFO_SCREEN_OLED_VERTICAL_FLIP false
    #define INFO_SCREEN_OLED_LINES 5
     
  4. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    Now that the screen is working I still don't seem to be able to send any commands via the serial monitor - is that normal? I did note I got a couple of compile warnings:

    Compiling .pioenvs\esp32\src\Sensors.cpp.o
    src\DCCppProtocol.cpp: In lambda function:
    src\DCCppProtocol.cpp:28:97: warning: deleting object of abstract class type 'DCCPPProtocolCommand' which has non-virtual destructor will cause undefined behaviour
    [-Wdelete-non-virtual-dtor]
    LinkedList<DCCPPProtocolCommand *> registeredCommands([](DCCPPProtocolCommand *command) {delete command; });
    ^
    src\InfoScreen.cpp: In static member function 'static void InfoScreen::update()':
    src\InfoScreen.cpp:214:18: warning: unused variable '_dccIndex' [-Wunused-variable]
    static uint8_t _dccIndex = 0;
    ^
    src\Sensors.cpp: In lambda function:
    src\Sensors.cpp:78:57: warning: deleting object of polymorphic class type 'Sensor' which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor]
    LinkedList<Sensor *> sensors([](Sensor *sensor) {delete sensor; });
    ^
    Compiling .pioenvs\esp32\src\SignalGenerator.cpp.o
    src\MotorBoard.cpp: In static member function 'static GenericMotorBoard* MotorBoardManager::registerBoard(adc1_channel_t, uint8_t, MOTOR_BOARD_TYPE, String)':
    src\MotorBoard.cpp:113:10: warning: 'board' may be used uninitialized in this function [-Wmaybe-uninitialized]
    return board;
    ^
     
  5. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    Little, by little - I seem to be getting there. I just set up a profile in JMRI and was able to connect and turn the power on according to the OLED screen, so, it's looking good so far. Now to actually connect some shields!
     
  6. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    One thing I notice before I do anything else is that I am getting over-current faults - cycling and resetting continuously even though track power is OFF and I have no shields connected. Would we expect this at this stage?

    Thanks
     
  7. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    Hi, so I believe I do have some sort of problem. As soon as I turn on track power in JMRI I get an overcurrent problem.

    [MotorBoard.cpp:37] GenericMotorBoard(): [MAIN] Configuring motor board [ADC1 Channel: 0, currentLimit: 2007, enablePin: 25]
    [MotorBoard.cpp:37] GenericMotorBoard(): [PROG] Configuring motor board [ADC1 Channel: 3, currentLimit: 2007, enablePin: 23]
    [V][DCCppProtocol.cpp:262] registerCommand(): Registering interface command t
    [V][DCCppProtocol.cpp:262] registerCommand(): Registering interface command f
    [V][DCCppProtocol.cpp:262] registerCommand(): Registering interface command a
    [V][DCCppProtocol.cpp:262] registerCommand(): Registering interface command 1
    [V][DCCppProtocol.cpp:262] registerCommand(): Registering interface command 0
    [V][DCCppProtocol.cpp:262] registerCommand(): Registering interface command c
    [V][DCCppProtocol.cpp:262] registerCommand(): Registering interface command s
    [V][DCCppProtocol.cpp:262] registerCommand(): Registering interface command R
    [V][DCCppProtocol.cpp:262] registerCommand(): Registering interface command W
    [V][DCCppProtocol.cpp:262] registerCommand(): Registering interface command B
    [V][DCCppProtocol.cpp:262] registerCommand(): Registering interface command w
    [V][DCCppProtocol.cpp:262] registerCommand(): Registering interface command b
    [V][DCCppProtocol.cpp:262] registerCommand(): Registering interface command e
    [V][DCCppProtocol.cpp:262] registerCommand(): Registering interface command E
    [V][DCCppProtocol.cpp:262] registerCommand(): Registering interface command Z
    [V][DCCppProtocol.cpp:262] registerCommand(): Registering interface command T
    [V][DCCppProtocol.cpp:262] registerCommand(): Registering interface command S
    [Outputs.cpp:100] init(): Initializing outputs
    [E][Preferences.cpp:330] getUShort(): nvs_get_u16 fail: OutputCount NOT_FOUND
    [Outputs.cpp:102] init(): Found 0 outputs
    [Turnouts.cpp:78] init(): Initializing turnout list
    [E][Preferences.cpp:330] getUShort(): nvs_get_u16 fail: TurnoutCount NOT_FOUND
    [Turnouts.cpp:80] init(): Found 0 turnouts
    [Sensors.cpp:81] init(): Initializing sensors list
    [E][Preferences.cpp:330] getUShort(): nvs_get_u16 fail: SensorCount NOT_FOUND
    [Sensors.cpp:83] init(): Found 0 sensors
    [SignalGenerator.cpp:217] startSignal(): [OPS] Adding reset packet to packet queue
    [SignalGenerator.cpp:219] startSignal(): [OPS] Adding idle packet to packet queue
    [SignalGenerator.cpp:222] startSignal(): [OPS] Configuring Timer(0) for generating DCC Signal (Full Wave)
    [SignalGenerator.cpp:224] startSignal(): [OPS] Attaching interrupt handler to Timer(0)
    [SignalGenerator.cpp:226] startSignal(): [OPS] Configuring alarm on Timer(0) to 116us
    [SignalGenerator.cpp:228] startSignal(): [OPS] Setting load on Timer(0) to zero
    [SignalGenerator.cpp:231] startSignal(): [OPS] Configuring Timer(1) for generating DCC Signal (Half Wave)
    [SignalGenerator.cpp:233] startSignal(): [OPS] Attaching interrupt handler to Timer(1)
    [SignalGenerator.cpp:235] startSignal(): [OPS] Configuring alarm on Timer(1) to 58us
    [SignalGenerator.cpp:237] startSignal(): [OPS] Setting load on Timer(1) to zero
    [SignalGenerator.cpp:240] startSignal(): [OPS] Enabling alarm on Timer(0)
    [I][SignalGenerator.cpp:242] startSignal(): [OPS] Enabling alarm on Timer(1)
    [I][SignalGenerator.cpp:217] startSignal(): [PROG] Adding reset packet to packet queue
    [I][SignalGenerator.cpp:219] startSignal(): [PROG] Adding idle packet to packet queue
    [I][SignalGenerator.cpp:222] startSignal(): [PROG] Configuring Timer(2) for generating DCC Signal (Full Wave)
    [I][SignalGenerator.cpp:224] startSignal(): [PROG] Attaching interrupt handler to Timer(2)
    [I][SignalGenerator.cpp:226] startSignal(): [PROG] Configuring alarm on Timer(2) to 116us
    [I][SignalGenerator.cpp:228] startSignal(): [PROG] Setting load on Timer(2) to zero
    [I][SignalGenerator.cpp:231] startSignal(): [PROG] Configuring Timer(3) for generating DCC Signal (Half Wave)
    [I][SignalGenerator.cpp:233] startSignal(): [PROG] Attaching interrupt handler to Timer(3)
    [I][SignalGenerator.cpp:235] startSignal(): [PROG] Configuring alarm on Timer(3) to 58us
    [I][SignalGenerator.cpp:237] startSignal(): [PROG] Setting load on Timer(3) to zero
    [I][SignalGenerator.cpp:240] startSignal(): [PROG] Enabling alarm on Timer(2)
    [I][SignalGenerator.cpp:242] startSignal(): [PROG] Enabling alarm on Timer(3)
    [I][DCCppESP32.cpp:192] setup(): DCC++ READY!
    [D][WiFiInterface.cpp:113] update(): Command: <s>
    [D][WiFiInterface.cpp:113] update(): Command: <s>
    [D][WiFiInterface.cpp:113] update(): Command: <S>
    [D][WiFiInterface.cpp:113] update(): Command: <1>
    [I][MotorBoard.cpp:132] powerOnAll(): Enabling DCC Signal for all boards
    [I][MotorBoard.cpp:41] powerOn(): [MAIN] Enabling DCC Signal
    [I][MotorBoard.cpp:41] powerOn(): [PROG] Enabling DCC Signal
    [D][WiFiInterface.cpp:113] update(): Command: <s>
    [I][MotorBoard.cpp:77] check(): [PROG] Overcurrent detected 1222.17 mA
    [I][MotorBoard.cpp:50] powerOff(): [PROG] Disabling DCC Signal
    [I][MotorBoard.cpp:77] check(): [MAIN] Overcurrent detected 1999.51 mA
    [I][MotorBoard.cpp:50] powerOff(): [MAIN] Disabling DCC Signal
    [I][MotorBoard.cpp:92] check(): [PROG] Overcurrent cleared, 9750 ms before re-enable
    [I][MotorBoard.cpp:92] check(): [MAIN] Overcurrent cleared, 9750 ms before re-enable
    [I][esp32-hal-i2c.c:1130] i2cProcQueue(): Bus busy, reinit
    [V][esp32-hal-i2c.c:1483] i2cInit(): num=0 sda=4 scl=15 freq=0
    [V][esp32-hal-i2c.c:1677] i2cSetFrequency(): freq=701754Hz
    [V][esp32-hal-i2c.c:1692] i2cSetFrequency(): cpu Freq=240Mhz, i2c Freq=701754Hz
    [V][esp32-hal-i2c.c:1698] i2cSetFrequency(): Fifo delta=5
    [I][MotorBoard.cpp:92] check(): [PROG] Overcurrent cleared, 9500 ms before re-enable
    [I][MotorBoard.cpp:84] check(): [MAIN] Overcurrent persists (250 ms) 1999.51 mA
    [I][MotorBoard.cpp:92] check(): [PROG] Overcurrent cleared, 9250 ms before re-enable
    [I][MotorBoard.cpp:84] check(): [MAIN] Overcurrent persists (500 ms) 1999.51 mA
    ....
    [I][MotorBoard.cpp:92] check(): [PROG] Overcurrent cleared, 500 ms before re-enable
    [I][MotorBoard.cpp:92] check(): [MAIN] Overcurrent cleared, 1750 ms before re-enable
    [I][MotorBoard.cpp:92] check(): [PROG] Overcurrent cleared, 250 ms before re-enable
    [I][MotorBoard.cpp:92] check(): [MAIN] Overcurrent cleared, 1500 ms before re-enable
    [I][MotorBoard.cpp:88] check(): [PROG] Overcurrent cleared, enabling
    [I][MotorBoard.cpp:41] powerOn(): [PROG] Enabling DCC Signal
    [I][MotorBoard.cpp:92] check(): [MAIN] Overcurrent cleared, 1250 ms before re-enable
    [I][MotorBoard.cpp:92] check(): [MAIN] Overcurrent cleared, 1000 ms before re-enable
    [I][MotorBoard.cpp:92] check(): [MAIN] Overcurrent cleared, 750 ms before re-enable
    [I][MotorBoard.cpp:92] check(): [MAIN] Overcurrent cleared, 500 ms before re-enable
    [I][MotorBoard.cpp:92] check(): [MAIN] Overcurrent cleared, 250 ms before re-enable
    [I][MotorBoard.cpp:88] check(): [MAIN] Overcurrent cleared, enabling
    [I][MotorBoard.cpp:41] powerOn(): [MAIN] Enabling DCC Signal
    [D][WiFiInterface.cpp:113] update(): Command: <s>
    [D][WiFiInterface.cpp:113] update(): Command: <s>
    [D][WiFiInterface.cpp:113] update(): Command: <s>[/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I][/I]
    [I][I][I][I][I][I][I][I][I][I][I][I][I][I][I][I][I][I][I][I][I][I][I][I][I][I][I][I][I][I][I][I][I][I][I][I][I][I][I][I][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i]
     
  8. Atani

    Atani TrainBoard Member

    1,469
    1,757
    37
    The serial connection is not usable for JMRI or anything other than debugging. You would need to connect via JMRI or use the web page built into the base station for monitoring.

    On the development branch there is now code to dump the I2C scan output so you can configure the correct address for the OLED screen. since you are using a Heltec board, you will need to override SDA/SCL in the config files. On the development branch this is handled automatically and you do not need to handle overrides as long as you set the correct board type in platformio.ini (or in the arduino ide) it will find the right pins based on the arduino-esp32 definition for the board type.

    Good to know that you are getting that far :) It isn't always easy getting JMRI to work with DCC++ (any version).

    you should check that the analog pins (SVP and SVN) you have connected to the shield are connected correctly, they appear to be reading a positive voltage and if the track power is OFF then there should be no voltage being read. What shield are you using?

    Also I'd recommend using the development branch https://github.com/atanisoft/DCCppESP32/tree/development as it has a number of bug fixes that are not present (yet) on master. I'm working on stabilizing the code and am working towards a new release in early Feb.

    Mike
     
  9. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    Hi Mike

    I am using the Arduino Motor Shield. I confess to not knowing which pins I need to connect. I think I followed the overview instructions but I assume I also need to connect 5V and GND from the ESP32 to the shield. I will try and post a marked up diagram later.

    I will take a look at the development branch in more detail. Visual Studio wanted me to download git for it to compile so I need to pay more attention to what that is and why!

    Thanks again, Andy
     
  10. Atani

    Atani TrainBoard Member

    1,469
    1,757
    37
    There are a couple dependencies in the current development branch which require git, I'll remove them this evening as they are no longer necessary.

    Make sure you have GND and VCC (5v) connected and then you can follow the connections:
    MOTORBOARD_ENABLE_PIN_MAIN -> shield pin 3
    MOTORBOARD_CURRENT_SENSE_MAIN -> shield pin A0
    DCC_SIGNAL_PIN_OPERATIONS -> shield pin 12
    MOTORBOARD_ENABLE_PIN_PROG -> shield pin 11
    MOTORBOARD_CURRENT_SENSE_PROG -> shield pin A1
    DCC_SIGNAL_PIN_PROGRAMMING -> shield pin 13
     
  11. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    Here is how I have it connected in the attached file. I did wonder whether Pin 25 on the ESP32++ is the right one to use?
     

    Attached Files:

  12. Atani

    Atani TrainBoard Member

    1,469
    1,757
    37
    you may want to shift the pins over to the right side only (if it is easier to wire), using the pins 12,13,14,27 for the ENABLE/SIGNAL pins and shift over to 34/35 for the CURRENT_SENSE pins. I'm basing this off of the pins not being marked in yellow on the diagram you provided. I don't have that specific board to test with unfortunately.
     
  13. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    Mike, thanks, I will try that. Currently, I get the over-current fault with no shield connected
     
  14. Atani

    Atani TrainBoard Member

    1,469
    1,757
    37
    Try shorting 36 and 39 to GND and see if that resolves it. It is very likely a floating read on the pin due to no GND ref.
     
  15. Jimbo20

    Jimbo20 TrainBoard Member

    274
    178
    11
    If you dont have a sheild connected you probably need to ground the sense pins, because if they are floating the noise on them would likely be enough to trigger overcurrent errors

    Edit :Atani beat me to it!
     
    Atani likes this.
  16. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    OK, so that's just a case of putting a jump cable between those pins and the grnd pin, correct?

    @Atani: I tried the other pins but the ESP32 didn't seem to like it - it seemed to time out connecting and then would blank screen. However, this may be something else as now back in JMRI on the original settings I am getting very intermittent response. I now seem to have broken JMRI - the connections don't start and I get an error message about previous power control failure at start up!!
     
  17. Atani

    Atani TrainBoard Member

    1,469
    1,757
    37
    Yes, that should be sufficient.

    Make sure to update the config files with the new pins to match how you hooked it up. If you have done that then I'm not sure what it could be.

    That doesn't sound good. You may need to cleanup and recreate the JMRI profile. If you are on a newer OS you may also be able to use an mDNS name instead of the base station IP, use the HOSTNAME specified in the config with ".local" appended and it should work. I've done this on rPI successfully (I'm on win7 which doesn't support mDNS directly)
     
  18. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    Hi Mike did you manage to remove the dependencies yet? I thought I'd give it a go again later! Thanks
     
  19. Atani

    Atani TrainBoard Member

    1,469
    1,757
    37
    I'm currently out of town for work but you can use this as your platformio.ini file and it should go through:
    Code:
    ; PlatformIO Project Configuration File
    ;
    ; Build options: build flags, source filter
    ; Upload options: custom upload port, speed and extra flags
    ; Library options: dependencies, extra library storages
    ; Advanced options: extra scripting
    ;
    ; Please visit documentation for the other options and examples
    ; http://docs.platformio.org/page/projectconf.html
    [platformio]
    description=DCC Base station for the ESP32
    [env:esp32]
    extra_scripts=build_index_header.py
    platform=espressif32
    board=esp32dev
    framework=arduino
    lib_deps=
      SPI
      ArduinoJson@5.13.4
      AsyncTCP@1.0.3
      ESP Async WebServer
      ESP8266_SSD1306
      LiquidCrystal_PCF8574
      ESPmDNS
      Wire
      EEPROM
    lib_compat_mode=2
    lib_ldf_mode=chain+
    build_flags =
      -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_INFO
    monitor_speed=115200
    board_build.partitions=minimal.csv
    
    Make sure to set the board type to the appropriate variant for your board.
     
  20. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9

Share This Page