Menu

Compiling with Platform.io

Tom Hayko
2022-03-08
2022-03-16
  • Tom Hayko

    Tom Hayko - 2022-03-08

    Has anybody tried this?

    I think I've just about got it compiling by importing the Arduino IDE project, but I was wondering what Web Server library is being used.

     
    • brownrb

      brownrb - 2022-03-09

      You mean tried this project - answer is a lot of people.
      The PDF and the Readme,cmd document outlines all the libraries that are necessary,
      https://sourceforge.net/projects/myfocuserpro2-esp32/files/Firmware/
      and if you scroll down its lists the libraries you need to download and install using the Library manager of the Arduino IDE

      OneWire https://github.com/PaulStoffregen/OneWire
      IRRemote https://github.com/crankyoldgit/IRremoteESP8266
      DuckDNS https://github.com/ayushsharma82/EasyDDNS
      ESP32 Sketch Data uploader https://github.com/me-no-dev/arduino-esp32fs-plugin/releases/
      ESP8266 Sketch Data uploader https://github.com/esp8266/arduino-esp8266fs-plugin

      , and then the required libraries that also need to be installed

      myOLED
      myHalfStepperESP32
      myDallasTemperature
      myfp2eIRremoteESP8266
      esp8266-oled-ssd1306
      

      There is no Web Server library required.
      If you have issues in compiling, the bottom window of the Arduino IDE lists all the compile messages and errors. under File Preferences ensure that Compiler Warnings is set to All

      This gives clues to where an issue is found during the compilation process. You can copy all the text in the bottom window and paste it into a text file, and then post it here.

      When the arduino IDE stops compiling the code, you click in that bottom window, use CTRL + A to select all the text, then CTRL + C to copy the text, then open Notepad and paste the copied text with CTRL - V and then save the file.

      Regards
      Robert

      I assume you have installed the required Arduino Core for ESP32 as well as the other libraries mentioned above.

       
  • Tom Hayko

    Tom Hayko - 2022-03-10

    Robert, thanks for the reply.

    I've got no trouble compiling everything using the Arduino IDE, but I prefer to the use Platform.io add on to Visual Studio code, as the the environment is a little more advanced than the Arduino IDE.

    I'm trying to see if I could add support for Wii Nunchuck as a focus controller.

    I'm getting errors from a few source files complaining that the WebServer type is is not defined:

    src/Ascom.cpp:49:8: error: 'WebServer' does not name a type extern WebServer mserver;

     

    Last edit: Tom Hayko 2022-03-10
  • brownrb

    brownrb - 2022-03-10

    I am assuming that you are using ESP32

    You did set the target board to esp32
    tools board

    Set your DRVBRD in focuserconfig.h so the correct driver board is used?

    What version of the Arduino ESP32 core? I am using 2.0.2
    Compiler is 1.8.19

    make sure you set the arduino IDE to File Preferences Compiler warnings: all

    src/Ascom.cpp:49:8: error: 'WebServer' does not name a type extern WebServer mserver;

    I would need to look at the compilation messages (rather than just a single line), which would give some context around the warnings/errors. generally, WebServer is part of the Aduino core that is installed, it would indicate that you have an issue with how your environment is set up in Platform IO

    regards
    Robert

     
  • Tom Hayko

    Tom Hayko - 2022-03-10

    Thanks.

    I set the board to wemos_d1_mini32. I'll try "Expressif ESP32 Dev Model" and/or "Hornbill ESP32 Dev" to see if that makes any difference.

     
  • brownrb

    brownrb - 2022-03-11

    I would need to look at the compilation messages (rather than just a single line), which would give some context around the warnings/errors. generally, WebServer is part of the Aduino core that is installed, it would indicate that you have an issue with how your environment is set up in Platform IO

    When you compile, goto the message window where the cmpilation messages are displayed.
    When it stops, use CTRL+A to select all text, then CTRL + C to copy the selection. then paste it into a new text file and send it to me.

     
    • Tom Hayko

      Tom Hayko - 2022-03-11

      Thanks!

      I've set "Espressif32 ESP32 Dev Model" as the board in Platform.IO, and here are are the errors from the build:

       
  • brownrb

    brownrb - 2022-03-12

    Hi Tom

    I see two issues
    Issue 1
    In file included from src/displays.cpp:17:0:
    src/displays.h:12:87: fatal error: SSD1306Wire.h: No such file or directory

    You need to install the myOLED library. That will get you past the first issue.

    Issue 2
    src/Ascom.cpp:49:8: error: 'WebServer' does not name a type
    extern WebServer mserver;

    However, before I address that - i am guessing (from the compilation list ouput) that you have a number of things enabled in focuserconfig.h

    #define INFRAREDREMOTE
    #define CONTROLLERMODE  BLUETOOTHMODE
    #define OTAUPDATES  5
    define MDNSSERVER   8
    

    is that correct?

     
  • Tom Hayko

    Tom Hayko - 2022-03-13

    Thanks Robert!

    I've tried adding the version of myOLED.zip library as opposed the one included with the 230-1 firmware, and I'm definitely still getting the message regarding SSD1306Wire.h.

    I do not have INFRAREDREMOTE defined, CONTROLLERMODE is defined to STATIONMODE, OTAUPDATES is also not defined, but MDNSSERVER is defined.

    I've attached my version of focuserconfig.h and the latest compile errors (although I don't see any difference from the previously attached version)

     
  • brownrb

    brownrb - 2022-03-13

    ok, myoled is not the one you need (only for text oled) not graphic one.

    If you decide to use OLEDGRAHICS, you must download and install the OLED Graphics library from https://github.com/ThingPulse/esp8266-oled-ssd1306

    The library is also in the library-files folder of the downloaded firmware zip file
    esp8266-oled-ssd1306.zip

    That should get you a step further.

     
  • Tom Hayko

    Tom Hayko - 2022-03-13

    Thanks!

    My bad, I thought I had already added that one.

    I've added it now but I'm still getting errors on definition of Web Server.

     
  • brownrb

    brownrb - 2022-03-14

    You did download and install the arduino esp32 core v2.0.2 ?
    As I do not use PlatformIO I would not know where to do that in PlatformIO

    WebServer is defined as part of the ESP32 core code. If it is not installed then that would cause the issue.
    It is easy enough to install in Arduino IDE - pdf has details
    The firmware does depend on some settings with the Arduino IDE, am not sure if PlatformIO is picking those up.

    Regards
    Robert

     
  • brownrb

    brownrb - 2022-03-15

    Can only assist with the first one, using Arduino IDE.
    As stated earlier, I don't use PlatformIO.

    regards
    Robert

     
    • Tom Hayko

      Tom Hayko - 2022-03-15

      Yeah, I'm trying to sort that through with some help from the PlatformIO community.

      I'm not giving up yet!

       
  • Tom Hayko

    Tom Hayko - 2022-03-16

    After some back and forth the Platform.io community and little bit of hacking on my own, I think I've gotten past the errors with the definition of the WebServer class, but I'm now getting some different errors.

    Oddly enough, even after getting the issues with arduino ESP32 core not building properly, I was still getting errors that "WebServer" not defined. On a whim, I renamed the webserver.cpp and webserver.h files included in the firmware source MyFP2webserver.cpp and MyFP2webserver.h, changed the

    #define webserver_h
    

    in MyFP2webserver.h to

    #define MyFP2webserver_h
    

    My suspicion was that the definition of webserver_h was colliding with the definition WEBSERVER_H in the ESP32 arduino core. I have no explanation (yet!) of why this seemed to resolve the issue, as I thought the preprocessor definitions are supposed to case sensitive.

    I'm now getting errors that look like they are from the OneWire library.

    Robert, which version of the OneWire library are you using?

    Here are the errors I'm getting:

    In file included from C:/Users/Tom Hayko/.platformio/packages/framework-arduinoespressif32@src-e36c2260a49b9bf6768237494cebb35d/cores/esp32/Arduino.h:36,
                     from .pio/libdeps/arduino-esp32/OneWire/OneWire.cpp:142:
    .pio/libdeps/arduino-esp32/OneWire/util/OneWire_direct_gpio.h: In function 'void directModeInput(uint32_t)':
    .pio/libdeps/arduino-esp32/OneWire/util/OneWire_direct_gpio.h:191:38: error: 'esp32_gpioMux' was not declared in this scope
             ESP_REG(DR_REG_IO_MUX_BASE + esp32_gpioMux[pin].reg) = pinFunction;
                                          ^~~~~~~~~~~~~
    C:/Users/Tom Hayko/.platformio/packages/framework-arduinoespressif32@src-e36c2260a49b9bf6768237494cebb35d/cores/esp32/esp32-hal.h:73:47: note: in definition of macro 'ESP_REG'
     #define ESP_REG(addr) *((volatile uint32_t *)(addr))
                                                   ^~~~
    .pio/libdeps/arduino-esp32/OneWire/util/OneWire_direct_gpio.h: In function 'void directModeOutput(uint32_t)':
    .pio/libdeps/arduino-esp32/OneWire/util/OneWire_direct_gpio.h:232:38: error: 'esp32_gpioMux' was not declared in this scope
             ESP_REG(DR_REG_IO_MUX_BASE + esp32_gpioMux[pin].reg) = pinFunction;
                                          ^~~~~~~~~~~~~
    C:/Users/Tom Hayko/.platformio/packages/framework-arduinoespressif32@src-e36c2260a49b9bf6768237494cebb35d/cores/esp32/esp32-hal.h:73:47: note: in definition of macro 'ESP_REG'
     #define ESP_REG(addr) *((volatile uint32_t *)(addr))
                                                   ^~~~
    *** [.pio\build\arduino-esp32\liba67\OneWire\OneWire.cpp.o] Error 1
    
     

    Last edit: Tom Hayko 2022-03-16
  • brownrb

    brownrb - 2022-03-16

    Hi Tom
    yes, I shouldve picked that up, because, in another project I recently did that. I have been trying to move to lowercase filenames as well, makes things a bit easier when going back and forth between Linux and Windows

    The last time I compiled the myfp2esp code was sometime back
    The OneWire was
    OneWire 2.3.5

    I am currently using 2.3.6 as shown by the library manager in the Arduino IDE

    I have made a long list of things to do/rewrite for the next release of the myFP2ESP firmware, once I find the time to start it.

    regards
    Robert

     
    • Tom Hayko

      Tom Hayko - 2022-03-16

      I'll have to dig deeper on OneWire, as I seem to be using 2.3.6 as well.

      It's a never ending battle of refactoring code, especially when it's moving between platforms.

      It's funny that it builds fine using the Arduino IDE. I wonder if there are some differences in the paths for includes between the Arduino IDE and PlatformIO. That's something I'll dig into as I progress.

      BTW, a good part of the problem I was wrestling with on PlatformIO is actually a bug in PlatformIO. I've got a work around for it now, and they are at least aware of the issue, so hopefully it's fixed soon. Here's the PlatformIO community thread on the issue:

      https://community.platformio.org/t/working-with-esp-arduino-2-0-2/26540/14

       

      Last edit: Tom Hayko 2022-03-16
  • Tom Hayko

    Tom Hayko - 2022-03-16

    BTW, importing the Arduino Project using PlatformIO with the board set to wemos_d1_mini32, and then renaming webserver.cpp and webserver.h, and updated the #define guard in the newly renamed webserver.h seems to be enough to get a clean build using PlatformIO. I haven't actually tested that it runs properly yet, but a clean build is as step in the right direction.

    Thanks for all your help with this so far Robert! I'm awaiting some hardware but my plan is to add support for Wii Nunchuck. I'll keep you posted!

     

    Last edit: Tom Hayko 2022-03-16

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.