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

LMSFan72 Jan 15, 2019

  1. Atani

    Atani TrainBoard Member

    1,469
    1,757
    37
    Looks like the config is corrupted somehow, not sure what or how... I'd suggest a new profile.
     
  2. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    Thanks Mike. I updated the platformio.ini and got further but I am getting the following errors, all seemingly related to the Nextion side of things (I don't have it defined to be used in config.h):

    src\NextionInterfaceAddressPage.cpp:41:1: error: 'NextionAddressPage' does not name a type
    NextionAddressPage::NextionAddressPage(Nextion &nextion) :
    ^
    src\NextionInterfaceAddressPage.cpp:54:4: error: expected unqualified-id before ',' token
    },
    ^
    src\NextionInterfaceAddressPage.cpp:55:14: error: expected constructor, destructor, or type conversion before '(' token
    _doneButton(nextion, ADDRESS_PAGE, save1, "Save"),
    ^
    src\NextionInterfaceBasePage.cpp:26:1: error: 'DCCPPNextionPage' does not name a type
    DCCPPNextionPage::DCCPPNextionPage(Nextion &nextion, const uint8_t pageID, const String &pageName) :
    ^
    src\NextionInterfaceBasePage.cpp:51:6: error: 'DCCPPNextionPage' has not been declared
    void DCCPPNextionPage::display() {
    ^
    src\NextionInterfaceBasePage.cpp: In function 'void display()':
    src\NextionInterfaceBasePage.cpp:52:12: error: 'show' was not declared in this scope
    if(!show()) {
    ^
    src\NextionInterfaceBasePage.cpp:53:56: error: 'm_name' was not declared in this scope
    printf("display of page %s was not successful.\n", m_name.c_str());
    ^
    src\NextionInterfaceBasePage.cpp:55:35: error: 'm_name' was not declared in this scope
    printf("displayed page %s\n", m_name.c_str());
    ^
    src\NextionInterfaceBasePage.cpp:57:7: error: '_pageInitialized' was not declared in this scope
    if(!_pageInitialized) {
    ^
    src\NextionInterfaceBasePage.cpp:61:23: error: 'refreshPowerButtons' was not declared in this scope
    refreshPowerButtons();
    ^
    src\NextionInterfaceBasePage.cpp:62:15: error: 'displayPage' was not declared in this scope
    displayPage();
    ^
    src\NextionInterfaceBasePage.cpp: At global scope:
    src\NextionInterfaceBasePage.cpp:65:6: error: 'DCCPPNextionPage' has not been declared
    void DCCPPNextionPage::refresh() {
    ^
    src\NextionInterfaceBasePage.cpp: In function 'void refresh()':
    src\NextionInterfaceBasePage.cpp:66:23: error: 'refreshPowerButtons' was not declared in this scope
    refreshPowerButtons();
    ^
    src\NextionInterfaceBasePage.cpp:67:15: error: 'refreshPage' was not declared in this scope
    refreshPage();
    ^
    src\NextionInterfaceBasePage.cpp: At global scope:
    src\NextionInterfaceBasePage.cpp:70:6: error: 'DCCPPNextionPage' has not been declared
    void DCCPPNextionPage::setTrackPower(bool on) {
    ^
    src\NextionInterfaceBasePage.cpp: In function 'void setTrackPower(bool)':
    src\NextionInterfaceBasePage.cpp:76:23: error: 'refreshPowerButtons' was not declared in this scope
    refreshPowerButtons();
    ^
    src\NextionInterfaceBasePage.cpp: At global scope:
    src\NextionInterfaceBasePage.cpp:79:6: error: 'DCCPPNextionPage' has not been declared
    void DCCPPNextionPage::sendEStop() {
    ^
    src\NextionInterfaceBasePage.cpp:83:6: error: 'DCCPPNextionPage' has not been declared
    void DCCPPNextionPage::displayPreviousPage(bool invokeCallback) {
    ^
    src\NextionInterfaceBasePage.cpp: In function 'void displayPreviousPage(bool)':
    src\NextionInterfaceBasePage.cpp:84:6: error: '_returnPageID' was not declared in this scope
    if(_returnPageID > 0) {
    ^
    src\NextionInterfaceBasePage.cpp:85:5: error: 'nextionPages' was not declared in this scope
    nextionPages[_returnPageID]->display();
    ^
    src\NextionInterfaceBasePage.cpp:87:57: error: invalid use of 'this' in non-member function
    nextionPages[_returnPageID]->previousPageCallback(this);
    ^
    src\NextionInterfaceBasePage.cpp: At global scope:
    src\NextionInterfaceBasePage.cpp:92:6: error: 'DCCPPNextionPage' has not been declared
    void DCCPPNextionPage::refreshPowerButtons() {
    ^
    src\NextionInterfaceBasePage.cpp: In function 'void refreshPowerButtons()':
    src\NextionInterfaceBasePage.cpp:94:5: error: '_onButton' was not declared in this scope
    _onButton.setNumberProperty("pic", ON_PIC_ON);
    ^
    src\NextionInterfaceBasePage.cpp:95:5: error: '_offButton' was not declared in this scope
    _offButton.setNumberProperty("pic", OFF_PIC_OFF);
    ^
    src\NextionInterfaceBasePage.cpp:97:5: error: '_onButton' was not declared in this scope
    _onButton.setNumberProperty("pic", ON_PIC_OFF);
    ^
    src\NextionInterfaceBasePage.cpp:98:5: error: '_offButton' was not declared in this scope
    _offButton.setNumberProperty("pic", OFF_PIC_ON);
    ^
    *** [.pioenvs\esp32\src\NextionInterfaceAddressPage.cpp.o] Error 1
    *** [.pioenvs\esp32\src\NextionInterfaceBasePage.cpp.o] Error 1
    src\NextionInterfaceThrottlePage.cpp:92:1: error: 'NextionThrottlePage' does not name a type
    NextionThrottlePage::NextionThrottlePage(Nextion &nextion) : DCCPPNextionPage(nextion, THROTTLE_PAGE, "2"),
    ^
    src\NextionInterfaceThrottlePage.cpp:95:25: error: expected unqualified-id before ',' token
    _locoNumbers {0, 0, 0},
    ^
    src\NextionInterfaceThrottlePage.cpp:96:16: error: expected constructor, destructor, or type conversion before '{' token
    _locoButtons {
    ^
    src\NextionInterfaceThrottlePage.cpp:100:4: error: expected unqualified-id before ',' token
    },
    ^
    src\NextionInterfaceThrottlePage.cpp:101:18: error: expected constructor, destructor, or type conversion before '{' token
    _fgroupButtons {
    ^
    src\NextionInterfaceThrottlePage.cpp:105:4: error: expected unqualified-id before ',' token
    },
    ^
    src\NextionInterfaceThrottlePage.cpp:106:13: error: expected constructor, destructor, or type conversion before '(' token
    _fwdButton(nextion, THROTTLE_PAGE, fwd, "Fwd"),
    ^
    src\NextionInterfaceThrottlePage.cpp:119:4: error: expected unqualified-id before ',' token
    },
    ^
    src\NextionInterfaceThrottlePage.cpp:120:15: error: expected constructor, destructor, or type conversion before '(' token
    _locoAddress(nextion, THROTTLE_PAGE, locoaddr, "LocoAddr"),
    ^
    src\NextionInterfaceTurnoutPage.cpp:77:1: error: 'NextionTurnoutPage' does not name a type
    NextionTurnoutPage::NextionTurnoutPage(Nextion &nextion) :
    ^
    src\NextionInterfaceTurnoutPage.cpp:95:4: error: expected unqualified-id before ',' token
    },
    ^
    src\NextionInterfaceTurnoutPage.cpp:96:14: error: expected constructor, destructor, or type conversion before '(' token
    _backButton(nextion, TURNOUT_PAGE, back, "Back"),
    ^
    src\NextionInterfaceTurnoutPage.cpp:118:4: error: expected unqualified-id before ',' token
    }, _turnoutStartIndex(0) {
    ^
    src\NextionInterfaceTurnoutPage.cpp:118:24: error: expected constructor, destructor, or type conversion before '(' token
    }, _turnoutStartIndex(0) {
    ^
    *** [.pioenvs\esp32\src\NextionInterfaceThrottlePage.cpp.o] Error 1
    *** [.pioenvs\esp32\src\NextionInterfaceTurnoutPage.cpp.o] Error 1
     
  3. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    Hi Mike. I updated the ini file and got further but I am getting build errors related to Nextion even though it's excluded in config.h:

    src\NextionInterfaceAddressPage.cpp:41:1: error: 'NextionAddressPage' does not name a type
    NextionAddressPage::NextionAddressPage(Nextion &nextion) :
    ^
    src\NextionInterfaceAddressPage.cpp:54:4: error: expected unqualified-id before ',' token
    },
    ^
    src\NextionInterfaceAddressPage.cpp:55:14: error: expected constructor, destructor, or type conversion before '(' token
    _doneButton(nextion, ADDRESS_PAGE, save1, "Save"),
    ^
    src\NextionInterfaceBasePage.cpp:26:1: error: 'DCCPPNextionPage' does not name a type
    DCCPPNextionPage::DCCPPNextionPage(Nextion &nextion, const uint8_t pageID, const String &pageName) :
    ^
    src\NextionInterfaceBasePage.cpp:51:6: error: 'DCCPPNextionPage' has not been declared
    void DCCPPNextionPage::display() {
    ^
    src\NextionInterfaceBasePage.cpp: In function 'void display()':
    src\NextionInterfaceBasePage.cpp:52:12: error: 'show' was not declared in this scope
    if(!show()) {
    ^
    src\NextionInterfaceBasePage.cpp:53:56: error: 'm_name' was not declared in this scope
    printf("display of page %s was not successful.\n", m_name.c_str());
    ^
    src\NextionInterfaceBasePage.cpp:55:35: error: 'm_name' was not declared in this scope
    printf("displayed page %s\n", m_name.c_str());
    ^
    src\NextionInterfaceBasePage.cpp:57:7: error: '_pageInitialized' was not declared in this scope
    if(!_pageInitialized) {
    ^
    src\NextionInterfaceBasePage.cpp:61:23: error: 'refreshPowerButtons' was not declared in this scope
    refreshPowerButtons();
    ^
    src\NextionInterfaceBasePage.cpp:62:15: error: 'displayPage' was not declared in this scope
    displayPage();
    ^
    src\NextionInterfaceBasePage.cpp: At global scope:
    src\NextionInterfaceBasePage.cpp:65:6: error: 'DCCPPNextionPage' has not been declared
    void DCCPPNextionPage::refresh() {
    ^
    src\NextionInterfaceBasePage.cpp: In function 'void refresh()':
    src\NextionInterfaceBasePage.cpp:66:23: error: 'refreshPowerButtons' was not declared in this scope
    refreshPowerButtons();
    ^
    src\NextionInterfaceBasePage.cpp:67:15: error: 'refreshPage' was not declared in this scope
    refreshPage();
    ^
    src\NextionInterfaceBasePage.cpp: At global scope:
    src\NextionInterfaceBasePage.cpp:70:6: error: 'DCCPPNextionPage' has not been declared
    void DCCPPNextionPage::setTrackPower(bool on) {
    ^
    src\NextionInterfaceBasePage.cpp: In function 'void setTrackPower(bool)':
    src\NextionInterfaceBasePage.cpp:76:23: error: 'refreshPowerButtons' was not declared in this scope
    refreshPowerButtons();
    ^
    src\NextionInterfaceBasePage.cpp: At global scope:
    src\NextionInterfaceBasePage.cpp:79:6: error: 'DCCPPNextionPage' has not been declared
    void DCCPPNextionPage::sendEStop() {
    ^
    src\NextionInterfaceBasePage.cpp:83:6: error: 'DCCPPNextionPage' has not been declared
    void DCCPPNextionPage::displayPreviousPage(bool invokeCallback) {
    ^
    src\NextionInterfaceBasePage.cpp: In function 'void displayPreviousPage(bool)':
    src\NextionInterfaceBasePage.cpp:84:6: error: '_returnPageID' was not declared in this scope
    if(_returnPageID > 0) {
    ^
    src\NextionInterfaceBasePage.cpp:85:5: error: 'nextionPages' was not declared in this scope
    nextionPages[_returnPageID]->display();
    ^
    src\NextionInterfaceBasePage.cpp:87:57: error: invalid use of 'this' in non-member function
    nextionPages[_returnPageID]->previousPageCallback(this);
    ^
    src\NextionInterfaceBasePage.cpp: At global scope:
    src\NextionInterfaceBasePage.cpp:92:6: error: 'DCCPPNextionPage' has not been declared
    void DCCPPNextionPage::refreshPowerButtons() {
    ^
    src\NextionInterfaceBasePage.cpp: In function 'void refreshPowerButtons()':
    src\NextionInterfaceBasePage.cpp:94:5: error: '_onButton' was not declared in this scope
    _onButton.setNumberProperty("pic", ON_PIC_ON);
    ^
    src\NextionInterfaceBasePage.cpp:95:5: error: '_offButton' was not declared in this scope
    _offButton.setNumberProperty("pic", OFF_PIC_OFF);
    ^
    src\NextionInterfaceBasePage.cpp:97:5: error: '_onButton' was not declared in this scope
    _onButton.setNumberProperty("pic", ON_PIC_OFF);
    ^
    src\NextionInterfaceBasePage.cpp:98:5: error: '_offButton' was not declared in this scope
    _offButton.setNumberProperty("pic", OFF_PIC_ON);
    ^
    *** [.pioenvs\esp32\src\NextionInterfaceAddressPage.cpp.o] Error 1
    *** [.pioenvs\esp32\src\NextionInterfaceBasePage.cpp.o] Error 1
    src\NextionInterfaceThrottlePage.cpp:92:1: error: 'NextionThrottlePage' does not name a type
    NextionThrottlePage::NextionThrottlePage(Nextion &nextion) : DCCPPNextionPage(nextion, THROTTLE_PAGE, "2"),
    ^
    src\NextionInterfaceThrottlePage.cpp:95:25: error: expected unqualified-id before ',' token
    _locoNumbers {0, 0, 0},
    ^
    src\NextionInterfaceThrottlePage.cpp:96:16: error: expected constructor, destructor, or type conversion before '{' token
    _locoButtons {
    ^
    src\NextionInterfaceThrottlePage.cpp:100:4: error: expected unqualified-id before ',' token
    },
    ^
    src\NextionInterfaceThrottlePage.cpp:101:18: error: expected constructor, destructor, or type conversion before '{' token
    _fgroupButtons {
    ^
    src\NextionInterfaceThrottlePage.cpp:105:4: error: expected unqualified-id before ',' token
    },
    ^
    src\NextionInterfaceThrottlePage.cpp:106:13: error: expected constructor, destructor, or type conversion before '(' token
    _fwdButton(nextion, THROTTLE_PAGE, fwd, "Fwd"),
    ^
    src\NextionInterfaceThrottlePage.cpp:119:4: error: expected unqualified-id before ',' token
    },
    ^
    src\NextionInterfaceThrottlePage.cpp:120:15: error: expected constructor, destructor, or type conversion before '(' token
    _locoAddress(nextion, THROTTLE_PAGE, locoaddr, "LocoAddr"),
    ^
    src\NextionInterfaceTurnoutPage.cpp:77:1: error: 'NextionTurnoutPage' does not name a type
    NextionTurnoutPage::NextionTurnoutPage(Nextion &nextion) :
    ^
    src\NextionInterfaceTurnoutPage.cpp:95:4: error: expected unqualified-id before ',' token
    },
    ^
    src\NextionInterfaceTurnoutPage.cpp:96:14: error: expected constructor, destructor, or type conversion before '(' token
    _backButton(nextion, TURNOUT_PAGE, back, "Back"),
    ^
    src\NextionInterfaceTurnoutPage.cpp:118:4: error: expected unqualified-id before ',' token
    }, _turnoutStartIndex(0) {
    ^
    src\NextionInterfaceTurnoutPage.cpp:118:24: error: expected constructor, destructor, or type conversion before '(' token
    }, _turnoutStartIndex(0) {
    ^
    *** [.pioenvs\esp32\src\NextionInterfaceThrottlePage.cpp.o] Error 1
    *** [.pioenvs\esp32\src\NextionInterfaceTurnoutPage.cpp.o] Error 1
     
  4. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    apologies for the double post!
     
  5. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    Yes, have done that. It then seems to affect the new one too after a while. I have uninstalled and reinstalled and still have it..Luckily this isn't the computer I normally run things on so I am using it is a sandbox!
     
  6. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    The interesting thing is it seems to be because it can't connect to the IP - if I change the connection type to simulator it goes in fine but if then change it back to use Ethernet or Server it fails with he same message...
     
  7. Atani

    Atani TrainBoard Member

    1,469
    1,757
    37
    Can you try with hostname instead of IP address? Ideally with the mDNS name it should automatically resolve to the right hostname once the base station is up and running successfully.
     
  8. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    Good idea. I will have to read through to see how I do that! Thanks
     
  9. Atani

    Atani TrainBoard Member

    1,469
    1,757
    37
    try "DCCpp32.local" as the name, this is based on the default in Config.h. If the env you are running in supports mDNS it should be able to resolve that to an IP, even if it changes.
     
  10. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    Thanks Mike, I will give it a try. Did you see the error on the development branch for the Nextion includes. Anyway I can bypass them to see if I can get that up? Thanks, Andy
     
  11. Atani

    Atani TrainBoard Member

    1,469
    1,757
    37
    how old of a development branch image do you have? This looks related to the dependencies under the lib folder, check if the lib folder is empty etc.. If so repull the latest development branch and it should work.
     
  12. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    OK, getting out of my depth I think! So, this is the image I pulled "Latest commit db918e3 5 days ago". I don't see a lib folder - is that a familiar name for a different folder. This is the tree:

    upload_2019-1-17_22-22-50.png
     
  13. Atani

    Atani TrainBoard Member

    1,469
    1,757
    37
  14. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    Hi, well I'm calling it quits for the night... I connected 36 to the GND pin on the top at the LHS and 39 to the top at the RHS of the board and I still have the over-current problem. Something isn't quite working!!
     
  15. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    Mike, which exact OLED boards, if any, have you had working...maybe a shortcut is to get one of those whilst I continue to fault find this one!
     
  16. Atani

    Atani TrainBoard Member

    1,469
    1,757
    37
    I've used both the SSD1306 and SH1106. I have an ESP32 with built in OLED but the USB connector is broken (need to fix or use a JTAG adapter to flash it now).

    That doesn't make a lot of sense, it should have read at zero always if they are shorted to GND.

    Also just looked at the pin mappings again, you don't have any jumpers on the motor shield correct? Just the wires from it to the ESP32?
     
  17. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    Correct. I have the shield traces on the brake pins and on Vin cut, that’s all. I’ll see if I can take a photo tomorrow
     
    Atani likes this.
  18. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
  19. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    OK, ignore last. I found the lines in the file. That compiled!
     
  20. LMSFan72

    LMSFan72 TrainBoard Member

    118
    18
    9
    In development branch. I set the board type in platformio.ini but the below in config.h did not work;

    // For the Heltec or TTGO boards the below checks will automatically enable the OLED
    // and configure it for use. To use this setup be sure to select the correct board
    // type in platformio.ini:
    // Heltec: heltec_wifi_kit_32 or heltec_wifi_lora_32
    // TTGO: ttgo-lora32-v1
    // D-duino-32: d-duino-32 (if available, if not use block below)
    #if defined(OLED_SDA) && defined(OLED_SCL)
    #define OLED_CHIPSET SH1306
    #define INFO_SCREEN_OLED_I2C_ADDRESS 0x3C
    #define INFO_SCREEN_SDA_PIN OLED_SDA
    #define INFO_SCREEN_SCL_PIN OLED_SCL
    #ifdef OLED_RST
    #define INFO_SCREEN_RESET_PIN OLED_RST
    #endif
    #else

    So I then also defined the pins lower down and that did work:

    // 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
    #endif

    Where does the above code pull the OLED_SDA and OLED_SCL pins from?
     

Share This Page