Error compiling with ESP 32

Home Forum Makelangelo Polargraph Art Robot Error compiling with ESP 32

  • This topic has 6 replies, 3 voices, and was last updated 3 months ago by DanDan.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #29186
    Avatarplangenh
    Participant

    Hi, I’m the new one.

    I tried compiling with an ESP32 but end up in errors (see below).
    My workflow so far:
    – Copy library folder into the main library folder of Arduino
    – create local_config.h , in my case this contains the following:

    #define MACHINE_STYLE POLARGRAPH
    #define LCD_TYPE LCD_NONE
    #define MOTHERBOARD BOARD_ESP32

    I end up with the following error that I find nothing about in the forum.
    Any help is much appreciated!!

    Arduino: 1.8.13 (Mac OS X), Board: "ESP32 Dev Module, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, None"
    
    MServo.cpp:58:8: error: 'servo_t' does not name a type
     static servo_t servos[MAX_SERVOS];                          // static array of servo structures
            ^
    MServo.cpp:59:17: error: 'int8_t' does not name a type
     static volatile int8_t Channel[_Nbr_16timers ];             // counter for the servo being pulsed for each timer (or -1 if refresh interval)
                     ^
    MServo.cpp:61:1: error: 'uint8_t' does not name a type
     uint8_t ServoCount = 0;                                     // the total number of attached servos
     ^
    MServo.cpp:75:38: error: variable or field 'handle_interrupts' declared void
     static inline void handle_interrupts(timer16_Sequence_t timer, volatile uint16_t *TCNTn, volatile uint16_t* OCRnA)
                                          ^
    MServo.cpp:75:38: error: 'timer16_Sequence_t' was not declared in this scope
    MServo.cpp:75:64: error: expected primary-expression before 'volatile'
     static inline void handle_interrupts(timer16_Sequence_t timer, volatile uint16_t *TCNTn, volatile uint16_t* OCRnA)
                                                                    ^
    MServo.cpp:75:90: error: expected primary-expression before 'volatile'
     static inline void handle_interrupts(timer16_Sequence_t timer, volatile uint16_t *TCNTn, volatile uint16_t* OCRnA)
                                                                                              ^
    sketch/parser.cpp: In member function 'void Parser::start()':
    parser.cpp:43:3: error: 'WiFi' was not declared in this scope
       WiFi.mode(WIFI_AP);
       ^
    parser.cpp:43:13: error: 'WIFI_AP' was not declared in this scope
       WiFi.mode(WIFI_AP);
                 ^
    parser.cpp:44:31: error: 'SSID_NAME' was not declared in this scope
       Serial.println( WiFi.softAP(SSID_NAME, SSID_PASS) ? "WIFI OK" : "WIFI FAILED" );
                                   ^
    parser.cpp:44:42: error: 'SSID_PASS' was not declared in this scope
       Serial.println( WiFi.softAP(SSID_NAME, SSID_PASS) ? "WIFI OK" : "WIFI FAILED" );
                                              ^
    parser.cpp:45:19: error: 'port' was not declared in this scope
       Serial.println( port.begin(localPort) ? "UDP OK" : "UDP FAILED" );
                       ^
    parser.cpp:45:30: error: 'localPort' was not declared in this scope
       Serial.println( port.begin(localPort) ? "UDP OK" : "UDP FAILED" );
                                  ^
    sketch/parser.cpp: In member function 'void Parser::update()':
    parser.cpp:180:20: error: 'port' was not declared in this scope
       int packetSize = port.parsePacket();
                        ^
    sketch/parser.cpp: In member function 'void Parser::M42()':
    parser.cpp:683:30: error: 'LED_BUILTIN' was not declared in this scope
       int pin = parseNumber('P', LED_BUILTIN);
                                  ^
    sketch/parser.cpp: In member function 'void Parser::M100()':
    parser.cpp:717:16: error: 'WiFi' was not declared in this scope
       Serial.print(WiFi.softAPIP());
                    ^
    parser.cpp:719:16: error: 'localPort' was not declared in this scope
       Serial.print(localPort);
                    ^
    sketch/parser.cpp: In member function 'void Parser::M205()':
    parser.cpp:892:87: error: no matching function for call to 'min(float&, int)'
       f = parseNumber('B', min_segment_time_us);  min_segment_time_us = max(min(f, 1000000), (float)0);
                                                                                           ^
    In file included from /Users/heljo/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/xtensa-esp32-elf/include/c++/5.2.0/algorithm:62:0,
                     from /Users/heljo/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/Arduino.h:142,
                     from sketch/configure.h:99,
                     from sketch/parser.cpp:1:
    /Users/heljo/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/xtensa-esp32-elf/include/c++/5.2.0/bits/stl_algo.h:3451:5: note: candidate: template<class _Tp, class _Compare> _Tp std::min(std::initializer_list<_Tp>, _Compare)
         min(initializer_list<_Tp> __l, _Compare __comp)
         ^
    /Users/heljo/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/xtensa-esp32-elf/include/c++/5.2.0/bits/stl_algo.h:3451:5: note:   template argument deduction/substitution failed:
    sketch/parser.cpp:892:87: note:   mismatched types 'std::initializer_list<_Tp>' and 'float'
       f = parseNumber('B', min_segment_time_us);  min_segment_time_us = max(min(f, 1000000), (float)0);
                                                                                           ^
    In file included from /Users/heljo/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/xtensa-esp32-elf/include/c++/5.2.0/algorithm:62:0,
                     from /Users/heljo/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/Arduino.h:142,
                     from sketch/configure.h:99,
                     from sketch/parser.cpp:1:
    /Users/heljo/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/xtensa-esp32-elf/include/c++/5.2.0/bits/stl_algo.h:3445:5: note: candidate: template<class _Tp> _Tp std::min(std::initializer_list<_Tp>)
         min(initializer_list<_Tp> __l)
         ^
    /Users/heljo/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/xtensa-esp32-elf/include/c++/5.2.0/bits/stl_algo.h:3445:5: note:   template argument deduction/substitution failed:
    sketch/parser.cpp:892:87: note:   mismatched types 'std::initializer_list<_Tp>' and 'float'
       f = parseNumber('B', min_segment_time_us);  min_segment_time_us = max(min(f, 1000000), (float)0);
                                                                                           ^
    In file included from /Users/heljo/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/xtensa-esp32-elf/include/c++/5.2.0/algorithm:61:0,
                     from /Users/heljo/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/Arduino.h:142,
                     from sketch/configure.h:99,
                     from sketch/parser.cpp:1:
    /Users/heljo/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/xtensa-esp32-elf/include/c++/5.2.0/bits/stl_algobase.h:243:5: note: candidate: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
         min(const _Tp& __a, const _Tp& __b, _Compare __comp)
         ^
    /Users/heljo/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/xtensa-esp32-elf/include/c++/5.2.0/bits/stl_algobase.h:243:5: note:   template argument deduction/substitution failed:
    sketch/parser.cpp:892:87: note:   deduced conflicting types for parameter 'const _Tp' ('float' and 'int')
       f = parseNumber('B', min_segment_time_us);  min_segment_time_us = max(min(f, 1000000), (float)0);
                                                                                           ^
    In file included from /Users/heljo/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/xtensa-esp32-elf/include/c++/5.2.0/algorithm:61:0,
                     from /Users/heljo/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/Arduino.h:142,
                     from sketch/configure.h:99,
                     from sketch/parser.cpp:1:
    /Users/heljo/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/xtensa-esp32-elf/include/c++/5.2.0/bits/stl_algobase.h:195:5: note: candidate: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)
         min(const _Tp& __a, const _Tp& __b)
         ^
    /Users/heljo/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/xtensa-esp32-elf/include/c++/5.2.0/bits/stl_algobase.h:195:5: note:   template argument deduction/substitution failed:
    sketch/parser.cpp:892:87: note:   deduced conflicting types for parameter 'const _Tp' ('float' and 'int')
       f = parseNumber('B', min_segment_time_us);  min_segment_time_us = max(min(f, 1000000), (float)0);
                                                                                           ^
    sketch/motor.cpp: In function 'void CRITICAL_SECTION_START()':
    motor.cpp:31:11: error: 'SREG' was not declared in this scope
       _sreg = SREG;  cli();
               ^
    sketch/motor.cpp: In function 'void CRITICAL_SECTION_END()':
    motor.cpp:34:3: error: 'SREG' was not declared in this scope
       SREG = _sreg;
       ^
    sketch/motor.cpp: At global scope:
    motor.cpp:53:1: error: 'Servo' does not name a type
     Servo servos[NUM_SERVOS];
     ^
    In file included from sketch/configure.h:95:0,
                     from sketch/motor.cpp:10:
    sketch/motor.cpp: In function 'void motor_setup()':
    board_esp32.h:26:36: error: expected primary-expression before ')' token
     #define MOTOR_0_LIMIT_SWITCH_PIN  ()   /* X min */
                                        ^
    sketch/motor.cpp:241:33: note: in expansion of macro 'MOTOR_0_LIMIT_SWITCH_PIN'
       motors[NN].limit_switch_pin = MOTOR_##NN##_LIMIT_SWITCH_PIN;
                                     ^
    sketch/motor.cpp:243:3: note: in expansion of macro 'SETUP_MOT'
       SETUP_MOT(0)
       ^
    board_esp32.h:32:36: error: expected primary-expression before ')' token
     #define MOTOR_1_LIMIT_SWITCH_PIN  ()  /* Y min */
                                        ^
    sketch/motor.cpp:241:33: note: in expansion of macro 'MOTOR_1_LIMIT_SWITCH_PIN'
       motors[NN].limit_switch_pin = MOTOR_##NN##_LIMIT_SWITCH_PIN;
                                     ^
    sketch/motor.cpp:245:3: note: in expansion of macro 'SETUP_MOT'
       SETUP_MOT(1)
       ^
    motor.cpp:308:3: error: 'servos' was not declared in this scope
       servos[0].attach(SERVO0_PIN);
       ^
    motor.cpp:349:3: error: 'TCCR1A' was not declared in this scope
       TCCR1A = 0;
       ^
    motor.cpp:351:3: error: 'TCNT1' was not declared in this scope
       TCNT1  = 0;
       ^
    motor.cpp:353:3: error: 'OCR1A' was not declared in this scope
       OCR1A = 2000;  // 1ms
       ^
    motor.cpp:355:3: error: 'TCCR1B' was not declared in this scope
       TCCR1B = (1 << WGM12);
       ^
    motor.cpp:355:18: error: 'WGM12' was not declared in this scope
       TCCR1B = (1 << WGM12);
                      ^
    motor.cpp:357:32: error: 'CS10' was not declared in this scope
       TCCR1B = (TCCR1B & ~(0x07 << CS10)) | (2 << CS10);
                                    ^
    motor.cpp:359:3: error: 'TIMSK1' was not declared in this scope
       TIMSK1 |= (1 << OCIE1A);
       ^
    motor.cpp:359:19: error: 'OCIE1A' was not declared in this scope
       TIMSK1 |= (1 << OCIE1A);
                       ^
    sketch/motor.cpp: In function 'void setPenAngle(int)':
    motor.cpp:411:5: error: 'servos' was not declared in this scope
         servos[0].write(arg0);
         ^
    sketch/motor.cpp: In function 'void segment_update_trapezoid(Segment*, const float&, const float&)':
    motor.cpp:518:70: error: no matching function for call to 'max(const float&, int)'
         accelerate_steps = min( (uint32_t)max( accelerate_steps_float, 0 ), s->steps_total );
                                                                          ^
    In file included from /Users/heljo/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/xtensa-esp32-elf/include/c++/5.2.0/algorithm:62:0,
                     from /Users/heljo/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/Arduino.h:142,
                     from sketch/configure.h:99,
                     from sketch/motor.cpp:10:
    /Users/heljo/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/xtensa-esp32-elf/include/c++/5.2.0/bits/stl_algo.h:3463:5: note: candidate: template<class _Tp, class _Compare> _Tp std::max(std::initializer_list<_Tp>, _Compare)
         max(initializer_list<_Tp> __l, _Compare __comp)
         ^
    /Users/heljo/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/xtensa-esp32-elf/include/c++/5.2.0/bits/stl_algo.h:3463:5: note:   template argument deduction/substitution failed:
    sketch/motor.cpp:518:70: note:   mismatched types 'std::initializer_list<_Tp>' and 'float'
         accelerate_steps = min( (uint32_t)max( accelerate_steps_float, 0 ), s->steps_total );
                                                                          ^
    In file included from /Users/heljo/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/xtensa-esp32-elf/include/c++/5.2.0/algorithm:62:0,
                     from /Users/heljo/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/Arduino.h:142,
                     from sketch/configure.h:99,
                     from sketch/motor.cpp:10:
    /Users/heljo/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/xtensa-esp32-elf/include/c++/5.2.0/bits/stl_algo.h:3457:5: note: candidate: template<class _Tp> _Tp std::max(std::initializer_list<_Tp>)
         max(initializer_list<_Tp> __l)
         ^
    /Users/heljo/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/xtensa-esp32-elf/include/c++/5.2.0/bits/stl_algo.h:3457:5: note:   template argument deduction/substitution failed:
    sketch/motor.cpp:518:70: note:   mismatched types 'std::initializer_list<_Tp>' and 'float'
         accelerate_steps = min( (uint32_t)max( accelerate_steps_float, 0 ), s->steps_total );
                                                                          ^
    In file included from /Users/heljo/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/xtensa-esp32-elf/include/c++/5.2.0/algorithm:61:0,
                     from /Users/heljo/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/Arduino.h:142,
                     from sketch/configure.h:99,
                     from sketch/motor.cpp:10:
    /Users/heljo/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/xtensa-esp32-elf/include/c++/5.2.0/bits/stl_algobase.h:265:5: note: candidate: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)
         max(const _Tp& __a, const _Tp& __b, _Compare __comp)
         ^
    /Users/heljo/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/xtensa-esp32-elf/include/c++/5.2.0/bits/stl_algobase.h:265:5: note:   template argument deduction/substitution failed:
    sketch/motor.cpp:518:70: note:   deduced conflicting types for parameter 'const _Tp' ('float' and 'int')
         accelerate_steps = min( (uint32_t)max( accelerate_steps_float, 0 ), s->steps_total );
                                                                          ^
    In file included from /Users/heljo/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/xtensa-esp32-elf/include/c++/5.2.0/algorithm:61:0,
                     from /Users/heljo/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/Arduino.h:142,
                     from sketch/configure.h:99,
                     from sketch/motor.cpp:10:
    /Users/heljo/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/xtensa-esp32-elf/include/c++/5.2.0/bits/stl_algobase.h:219:5: note: candidate: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)
         max(const _Tp& __a, const _Tp& __b)
         ^
    /Users/heljo/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/xtensa-esp32-elf/include/c++/5.2.0/bits/stl_algobase.h:219:5: note:   template argument deduction/substitution failed:
    sketch/motor.cpp:518:70: note:   deduced conflicting types for parameter 'const _Tp' ('float' and 'int')
         accelerate_steps = min( (uint32_t)max( accelerate_steps_float, 0 ), s->steps_total );
                                                                          ^
    sketch/motor.cpp: In function 'short unsigned int calc_timer(uint32_t, uint8_t*)':
    motor.cpp:718:47: error: 'speed_lookuptable_fast' was not declared in this scope
         const uint16_t table_address = (uint16_t)&speed_lookuptable_fast[(uint8_t)(desired_freq_hz >> 8)][0],
                                                   ^
    In file included from /Users/heljo/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/WString.h:29:0,
                     from /Users/heljo/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/Arduino.h:146,
                     from sketch/configure.h:99,
                     from sketch/motor.cpp:10:
    /Users/heljo/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/pgmspace.h:42:2: error: expected ',' or ';' before ')' token
     })
      ^
    /Users/heljo/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/pgmspace.h:57:35: note: in expansion of macro 'pgm_read_word'
     #define pgm_read_word_near(addr)  pgm_read_word(addr)
                                       ^
    sketch/motor.cpp:719:37: note: in expansion of macro 'pgm_read_word_near'
                        gain = (uint16_t)pgm_read_word_near(table_address + 2);
                                         ^
    motor.cpp:720:44: error: 'gain' was not declared in this scope
         timer = MultiU16X8toH16(tmp_step_rate, gain);
                                                ^
    In file included from /Users/heljo/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/WString.h:29:0,
                     from /Users/heljo/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/Arduino.h:146,
                     from sketch/configure.h:99,
                     from sketch/motor.cpp:10:
    /Users/heljo/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/pgmspace.h:41:35: error: void value not ignored as it ought to be
       *(const unsigned short *)(_addr); \
                                       ^
    /Users/heljo/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/cores/esp32/pgmspace.h:57:35: note: in expansion of macro 'pgm_read_word'
     #define pgm_read_word_near(addr)  pgm_read_word(addr)
                                       ^
    sketch/motor.cpp:721:23: note: in expansion of macro 'pgm_read_word_near'
         timer = (uint16_t)pgm_read_word_near(table_address) - timer;
                           ^
    motor.cpp:723:41: error: 'speed_lookuptable_slow' was not declared in this scope
         uint16_t table_address = (uint16_t)&speed_lookuptable_slow[0][0];
                                             ^
    sketch/motor.cpp: In function 'void isr_internal_pulse()':
    motor.cpp:846:7: error: 'servos' was not declared in this scope
           servos[0].write(global_servoSteps_0);
           ^
    sketch/motor.cpp: At global scope:
    motor.cpp:1057:4: error: expected constructor, destructor, or type conversion before '(' token
     ISR(TIMER1_COMPA_vect) {
        ^
    Mehrere Bibliotheken wurden für "WiFi.h" gefunden
     Benutzt: /Users/heljo/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/libraries/WiFi
     Nicht benutzt: /Applications/Arduino.app/Contents/Java/libraries/WiFi
    exit status 1
    'servo_t' does not name a type
    #29189
    DanDan
    Keymaster

    I haven’t compiled ESP32, so I can’t confirm. Looks like they have their own implementation of Servos. Maybe come to our Discord and we can help more? https://www.marginallyclever.com/channels/

    #29190
    Avatarplangenh
    Participant

    thanks for your quick reply Dan!
    ESP32 is indeed using an own servo library, maybe someone already figured out a way how to implement it.
    The discord link doesn’t work for me 🙁
    do you have an invite link?

    #29192
    Avatarplangenh
    Participant

    Tried everything but the link https://discordapp.com/channels/FkSK3xz just leads me to my discord account and just taking the channel ID doesn’t work either.

    Should look something like that : https://discord.gg/XxX1X1

    could you maybe send me an invite link?
    I am planning on building an esp32 based Makelangelo on a new board that I may able to supply the configuration files to the community

    #29194
    DanDan
    Keymaster

    https://discord.gg/Q5TZFmB idk why it was the other format. Sorry :T

    #29223
    Avatarhopo28
    Participant

    hey hey, any progress on this? I’m trying to set it up on a Wemos D1

    #29226
    DanDan
    Keymaster

    Come talk to us on Discord, we have several ESP32 people wanting to talk about it there.

    https://discord.gg/Q5TZFmB

    • This reply was modified 3 months ago by DanDan.
    • This reply was modified 3 months ago by DanDan.
Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.