getting error while I am trying to compile my following code for connecting nodeMCU(ESP8266) to firebase - firebase

This is an error message that i am getting while I am trying to compile my code for arduino while connecting it to firebase. So, if any one can help me in this regard i will be very thankful to you in advance.
// error I am getting
Arduino: 1.8.19 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Disabled (new aborts on oom), Disabled, All SSL ciphers (most compatible), 32KB cache + 32KB IRAM (balanced), Use pgm_read macros for IRAM/PROGMEM, 4MB (FS:2MB OTA:~1019KB), 2, v2 Lower Memory, Disabled, None, Only Sketch, 115200"
C:\Users\Nitro\Desktop\arduino-1.8.19-windows\arduino-1.8.19\libraries\firebase-arduino-master\src\FirebaseHttpClient_Esp8266.cpp: In member function 'virtual void FirebaseHttpClientEsp8266::begin(const string&)':
C:\Users\Nitro\Desktop\arduino-1.8.19-windows\arduino-1.8.19\libraries\firebase-arduino-master\src\FirebaseHttpClient_Esp8266.cpp:47:50: error: no matching function for call to 'begin(const char*, const char [60])'
47 | http_.begin(url.c_str(), kFirebaseFingerprint);
| ^
In file included from C:\Users\Nitro\Desktop\arduino-1.8.19-windows\arduino-1.8.19\libraries\firebase-arduino-master\src\FirebaseHttpClient_Esp8266.cpp:9:
C:\Users\Nitro\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.1\libraries\ESP8266HTTPClient\src/ESP8266HTTPClient.h:166:10: note: candidate: 'bool HTTPClient::begin(String, uint16_t, String)' (near match)
166 | bool begin(String host, uint16_t port, String uri = "/") __attribute__ ((error("obsolete API, use ::begin(WiFiClient, host, port, uri)")));
| ^~~~~
C:\Users\Nitro\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.1\libraries\ESP8266HTTPClient\src/ESP8266HTTPClient.h:166:10: note: conversion of argument 2 would be ill-formed:
C:\Users\Nitro\Desktop\arduino-1.8.19-windows\arduino-1.8.19\libraries\firebase-arduino-master\src\FirebaseHttpClient_Esp8266.cpp:47:30: error: invalid conversion from 'const char*' to 'uint16_t' {aka 'short unsigned int'} [-fpermissive]
47 | http_.begin(url.c_str(), kFirebaseFingerprint);
| ^~~~~~~~~~~~~~~~~~~~
| |
| const char*
In file included from C:\Users\Nitro\Desktop\arduino-1.8.19-windows\arduino-1.8.19\libraries\firebase-arduino-master\src\FirebaseHttpClient_Esp8266.cpp:9:
C:\Users\Nitro\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.1\libraries\ESP8266HTTPClient\src/ESP8266HTTPClient.h:167:10: note: candidate: 'bool HTTPClient::begin(String, const uint8_t*)' (near match)
167 | bool begin(String url, const uint8_t httpsFingerprint[20]) __attribute__ ((error("obsolete API, use ::begin(WiFiClientSecure, ...)")));
| ^~~~~
C:\Users\Nitro\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.1\libraries\ESP8266HTTPClient\src/ESP8266HTTPClient.h:167:10: note: conversion of argument 2 would be ill-formed:
C:\Users\Nitro\Desktop\arduino-1.8.19-windows\arduino-1.8.19\libraries\firebase-arduino-master\src\FirebaseHttpClient_Esp8266.cpp:47:30: error: invalid conversion from 'const char*' to 'const uint8_t*' {aka 'const unsigned char*'} [-fpermissive]
47 | http_.begin(url.c_str(), kFirebaseFingerprint);
| ^~~~~~~~~~~~~~~~~~~~
| |
| const char*
C:\Users\Nitro\Desktop\arduino-1.8.19-windows\arduino-1.8.19\libraries\firebase-arduino-master\src\FirebaseHttpClient_Esp8266.cpp: In member function 'virtual void FirebaseHttpClientEsp8266::begin(const string&, const string&)':
C:\Users\Nitro\Desktop\arduino-1.8.19-windows\arduino-1.8.19\libraries\firebase-arduino-master\src\FirebaseHttpClient_Esp8266.cpp:51:60: error: invalid conversion from 'const char*' to 'const uint8_t*' {aka 'const unsigned char*'} [-fpermissive]
51 | http_.begin(host.c_str(), kFirebasePort, path.c_str(), kFirebaseFingerprint);
| ^~~~~~~~~~~~~~~~~~~~
| |
| const char*
In file included from C:\Users\Nitro\Desktop\arduino-1.8.19-windows\arduino-1.8.19\libraries\firebase-arduino-master\src\FirebaseHttpClient_Esp8266.cpp:9:
C:\Users\Nitro\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.1\libraries\ESP8266HTTPClient\src/ESP8266HTTPClient.h:168:70: note: initializing argument 4 of 'bool HTTPClient::begin(String, uint16_t, String, const uint8_t*)'
168 | bool begin(String host, uint16_t port, String uri, const uint8_t httpsFingerprint[20]) __attribute__ ((error("obsolete API, use ::begin(WiFiClientSecure, ...)")));
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
I have tried all those solutions that were available online
giving preference
I have already installed all the required libraries.

Related

Compiling error for ESP8266 with I2C-libary

i want to upload a Script to read out a Lightsensor i have bought. The Sensor is a Grove - Sunlightsensor and the libary for it can be found on GitHub.
The Board i am going to use is a WeMos D1 Mini using a ESP8266, but since many Pins are taken i want to use GPIO2 as SDA and 13 as SCL which can be achieved with: Wire.begin(2,13);
But the Pins are not relavant for compiling.
I want to try the example-script found in the libary from the producer:
#include "Si115X.h"
Si115X si1151;
/**
* Setup for configuration
*/
void setup()
{
uint8_t conf[4];
Wire.begin(2,13);
Serial.begin(115200);
if (!si1151.Begin())
Serial.println("Si1151 is not ready!");
else
Serial.println("Si1151 is ready!");
}
/**
* Loops and reads data from registers
*/
void loop()
{
Serial.print("IR: ");
Serial.println(si1151.ReadHalfWord());
Serial.print("VISIBLE: ");
Serial.println(si1151.ReadHalfWord_VISIBLE());
Serial.print("UV: ");
Serial.println(si1151.ReadHalfWord_UV());
delay(100);
}
But i get the following error massage:
c:\Users\nikol\Documents\Mechatronik_Projekte\Arduino_Sketches\libraries\Grove_Sunlight_Sensor-Si1151\Si115X.cpp: In member function 'int Si115X::read_register(uint8_t, uint8_t, int)':
c:\Users\nikol\Documents\Mechatronik_Projekte\Arduino_Sketches\libraries\Grove_Sunlight_Sensor-Si1151\Si115X.cpp:42:39: warning: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
42 | Wire.requestFrom(addr, bytesOfData);
| ^
In file included from c:\Users\nikol\Documents\Mechatronik_Projekte\Arduino_Sketches\libraries\Grove_Sunlight_Sensor-Si1151\Si115X.h:5,
from c:\Users\nikol\Documents\Mechatronik_Projekte\Arduino_Sketches\libraries\Grove_Sunlight_Sensor-Si1151\Si115X.cpp:2:
C:\Users\nikol\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.1\libraries\Wire/Wire.h:73:13: note: candidate 1: 'uint8_t TwoWire::requestFrom(int, int)'
73 | uint8_t requestFrom(int, int);
| ^~~~~~~~~~~
C:\Users\nikol\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.1\libraries\Wire/Wire.h:71:13: note: candidate 2: 'uint8_t TwoWire::requestFrom(uint8_t, uint8_t)'
71 | uint8_t requestFrom(uint8_t, uint8_t);
| ^~~~~~~~~~~
c:/users/nikol/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.1.0-gcc10.3-e5f9fec/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\nikol\AppData\Local\Temp\arduino-sketch-5BFDDB9EDB939386E5CB1A13D5CC3F69\sketch\Si1151.ino.cpp.o: in function `setup':
C:\Users\nikol\AppData\Local\Temp\.arduinoIDE-unsaved2023112-24360-28iud3.owxco\Si1151/Si1151.ino:18: undefined reference to `_ZN6Si115X12ReadHalfWordEv'
c:/users/nikol/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.1.0-gcc10.3-e5f9fec/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\nikol\AppData\Local\Temp\.arduinoIDE-unsaved2023112-24360-28iud3.owxco\Si1151/Si1151.ino:18: undefined reference to `_ZN6Si115X20ReadHalfWord_VISIBLEEv'
c:/users/nikol/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.1.0-gcc10.3-e5f9fec/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\nikol\AppData\Local\Temp\arduino-sketch-5BFDDB9EDB939386E5CB1A13D5CC3F69\sketch\Si1151.ino.cpp.o:(.text.loop+0x14): undefined reference to `_ZN6Si115X15ReadHalfWord_UVEv'
c:/users/nikol/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.1.0-gcc10.3-e5f9fec/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\nikol\AppData\Local\Temp\arduino-sketch-5BFDDB9EDB939386E5CB1A13D5CC3F69\sketch\Si1151.ino.cpp.o:(.text.loop+0x3a): undefined reference to `_ZN6Si115X12ReadHalfWordEv'
c:/users/nikol/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.1.0-gcc10.3-e5f9fec/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\nikol\AppData\Local\Temp\arduino-sketch-5BFDDB9EDB939386E5CB1A13D5CC3F69\sketch\Si1151.ino.cpp.o: in function `loop':
C:\Users\nikol\AppData\Local\Temp\.arduinoIDE-unsaved2023112-24360-28iud3.owxco\Si1151/Si1151.ino:27: undefined reference to `_ZN6Si115X20ReadHalfWord_VISIBLEEv'
c:/users/nikol/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.1.0-gcc10.3-e5f9fec/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\nikol\AppData\Local\Temp\.arduinoIDE-unsaved2023112-24360-28iud3.owxco\Si1151/Si1151.ino:28: undefined reference to `_ZN6Si115X15ReadHalfWord_UVEv'
collect2.exe: error: ld returned 1 exit status
exit status 1
Compilation error: exit status 1
I already tried using a different compilerversion (2.7.4) but the same error accured.
I might be wrong and not expirienced but the error output seems that something is messed up in the libary itselfe?
Thanks for any help. If further information is needed i am happy to give it to you.

ESP32 AsyncWebServer

I currently trying to setup an Async Web Server on the ESP32. But unfortunately I don't get the code to run. I'm usign platform io on windows 10.
#include <Arduino.h>
#include <ESPAsyncWebServer.h>
const char* ssid = "myAP";
const char* password = "123456789";
AsyncWebServer server(80);
setup() and loop() are empty.
If I try to compile the code these message shows up.
compilation terminated.
C:\Users\x\.platformio\lib\ESPAsyncTCP_ID305\src\AsyncPrinter.cpp: In constructor 'AsyncPrinter::AsyncPrinter(AsyncClient*, size_t)':
C:\Users\xanix\.platformio\lib\ESPAsyncTCP_ID305\src\AsyncPrinter.cpp:48:11: error: 'panic' was not declared in this scope
panic(); //What should we do?
^
C:\Users\x\.platformio\lib\ESPAsyncTCP_ID305\src\AsyncPrinter.cpp: In member function 'int AsyncPrinter::connect(IPAddress, uint16_t)':
C:\Users\xanix\.platformio\lib\ESPAsyncTCP_ID305\src\AsyncPrinter.cpp:71:11: error: 'panic' was not declared in this scope
panic();
^
C:\Users\x\.platformio\lib\ESPAsyncTCP_ID305\src\AsyncPrinter.cpp: In member function 'size_t AsyncPrinter::_sendBuffer()':
C:\Users\xanix\.platformio\lib\ESPAsyncTCP_ID305\src\AsyncPrinter.cpp:182:11: error: 'panic' was not declared in this scope
panic(); // Connection should be aborted instead
^
^
C:\Users\x\.platformio\lib\ESPAsyncTCP_ID305\src\ESPAsyncTCPbuffer.cpp: In member function 'size_t AsyncTCPbuffer::_handleRxBuffer(uint8_t*, size_t)':
C:\Users\xanix\.platformio\lib\ESPAsyncTCP_ID305\src\ESPAsyncTCPbuffer.cpp:469:21: error: 'panic' was not declared in this scope
panic(); //TODO: What action should this be ?
C:\Users\x\.platformio\lib\ESPAsyncTCP_ID305\src\ESPAsyncTCP.cpp: In member function 'bool AsyncClient::operator==(const AsyncClient&)':
C:\Users\xanix\.platformio\lib\ESPAsyncTCP_ID305\src\ESPAsyncTCP.cpp:331:66: error: 'ip_addr_t {aka struct ip_addr}' has no membec
r named 'addr'
return (_pcb != NULL && other._pcb != NULL && (_pcb->remote_ip.addr == other._pcb->remote_ip.addr) && (_pcb->remote_port == other._pcb->remote_port));
^
C:\Users\x\.platformio\lib\ESPAsyncTCP_ID305\src\ESPAsyncTCP.cpp: In member function 'void AsyncClient::_dns_found(const ip_addr*)':
C:\Users\xanix\.platformio\lib\ESPAsyncTCP_ID305\src\ESPAsyncTCP.cpp:707:31: error: 'const struct ip_addr' has no member named 'addr'
connect(IPAddress(ipaddr->addr), _connect_port);
^
C:\Users\x\.platformio\lib\ESPAsyncTCP_ID305\src\ESPAsyncTCP.cpp: In member function 'uint32_t AsyncClient::getRemoteAddress()':
C:\Users\xanix\.platformio\lib\ESPAsyncTCP_ID305\src\ESPAsyncTCP.cpp:837:26: error: 'ip_addr_t {aka struct ip_addr}' has no member named 'addr'
return _pcb->remote_ip.addr;
^
C:\Users\x\.platformio\lib\ESPAsyncTCP_ID305\src\ESPAsyncTCP.cpp: In member function 'uint32_t AsyncClient::getLocalAddress()':
C:\Users\xanix\.platformio\lib\ESPAsyncTCP_ID305\src\ESPAsyncTCP.cpp:849:25: error: 'ip_addr_t {aka struct ip_addr}' has no member named 'addr'
return _pcb->local_ip.addr;
^
C:\Users\x\.platformio\lib\ESPAsyncTCP_ID305\src\ESPAsyncTCP.cpp: In member function 'void AsyncServer::begin()':
C:\Users\xanix\.platformio\lib\ESPAsyncTCP_ID305\src\ESPAsyncTCP.cpp:1122:14: error: 'ip_addr_t {aka struct ip_addr}' has no member named 'addr'
local_addr.addr = (uint32_t) _addr;
^
You're using the wrong async TCP library. The one you're using is for the ESP8266, not the ESP32.
Here's its PlatformIO library registry entry:
https://platformio.org/lib/show/305/ESPAsyncTCP
You're seeing errors because it's trying to call functions that are available on the ESP8266 and not the ESP32.
You want the AsyncTCP library:
https://platformio.org/lib/show/1826/AsyncTCP
You should update your platformio.lib file to include this library instead of ESPAsyncTCP. You may also need to remove the build or library directory to get rid of the old library.
had the same issue, downgrading the core of PlatformIO solved for me the issue.
pip install -U "platformio<4.2.0"

Rcpp not compiling with Intel MIC

I am trying to make this minimal Rcpp/Intel pragma code to work, however running into some pretty big errors which I am struggling to overcome.
Code
This is the full code that I am trying to run - it is a simple text read out showing if the target Xeon Phi device is engaged as per this website: Offload Computations from Servers with an Intel® Xeon Phi™ Processor, and this is based on a sample code found here: Lightning-Fast R Machine Learning Algorithms:
library(Rcpp)
library(inline)
# Create and register a Rcpp plugin
plug <- Rcpp:::Rcpp.plugin.maker(
include.before = "#include <stdint.h>
#include <stdio.h>
#include <omp.h>"
)
registerPlugin("daalNB", plug)
whatCPU <-
'
#pragma omp declare target
void what_cpu()
{
uint32_t eax;
const uint32_t xeon_phi_x100_id = 0x00010;
const uint32_t xeon_phi_x200_id = 0x50070;
__asm volatile("cpuid":"=a"(eax):"a"(1));
uint32_t this_cpu_id = eax & 0xF00F0;
if (this_cpu_id == xeon_phi_x100_id)
printf("This CPU is Intel(R) XeonPhi(TM) x100 Processor!");
else
if (this_cpu_id == xeon_phi_x200_id)
printf("This CPU is Intel(R) XeonPhi(TM) x200 Processor!");
else
printf("This CPU is other Intel(R) Processor.");
}
'
offloadExampleRcpp <-
'
//[[Rcpp::plugins(openmp)]]
printf("Running on host: ");
what_cpu();
#pragma offload target(mic:0)
{
printf("Running on target: ");
what_cpu();
}
'
runOffloadExample <- cxxfunction(sig = signature(), body = offloadExampleRcpp, plugin="daalNB", includes = '
//[[Rcpp::plugins(openmp)]]
#pragma omp declare target
void what_cpu()
{
uint32_t eax;
const uint32_t xeon_phi_x100_id = 0x225d;
const uint32_t xeon_phi_x200_id = 0x50070;
__asm volatile("cpuid":"=a"(eax):"a"(1));
uint32_t this_cpu_id = eax & 0xF00F0;
if (this_cpu_id == xeon_phi_x100_id)
printf("This CPU is Intel(R) XeonPhi(TM) x100 Processor!");
else
if (this_cpu_id == xeon_phi_x200_id)
printf("This CPU is Intel(R) XeonPhi(TM) x200 Processor!");
else
printf("This CPU is other Intel(R) Processor.");
}
', verbose = 2)
runOffloadExample()
What I have tried and Errors:
I have set up the software stack the the Xeon Phi properly, and this can be confirmed by when I compile the .c code (that is wrapped inside Rcpp in the above code) outside of R, using the Intel icc compiler, it is successful; namely I am able to get the exact output as show in the Intel website processor.
It seems however, that when the same .c code is wrapped inside Rcpp, the following errors arise which prevent compilation (this a sample from a much longer readout):
Compilation argument:
/usr/local/lib64/R/bin/R CMD SHLIB file306737f15222.cpp 2> file306737f15222.cpp.err.txt
/opt/intel/compilers_and_libraries_2017.1.132/linux/bin/intel64/icc -I/usr/local/lib64/R/include -DNDEBUG -I"/home/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -I/usr/local/include -fpic -qopenmp -c file306737f15222.cpp -o file306737f15222.o
file306737f15222.cpp(52): warning #2571: variable has not been declared with compatible "target" attribute
BEGIN_RCPP
^
file306737f15222.cpp(63): warning #2570: function has not been declared with compatible "target" attribute
END_RCPP
^
file306737f15222.cpp(63): warning #2570: function has not been declared with compatible "target" attribute
END_RCPP
^
Furthermore, the above error readout is followed by tonnes and tonnes of the below errors (again, I have only included a sample for the sake of brevity, however I believe that the other errors are all related to the same issue as posed in my question):
/home/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp/protection/Shelter.h(34): warning #2570: function has not been declared with compatible "target" attribute
Rcpp_unprotect(nprotected) ;
^
detected during:
instantiation of "Rcpp::Shelter<T>::~Shelter() [with T=SEXP]" at line 323 of "/home/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp/exceptions.h"
instantiation of "SEXP exception_to_condition_template(const Exception &, bool) [with Exception=Rcpp::exception]" at line 339 of "/home/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp/exceptions.h"
/home/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp/protection/Shelter.h(30): warning #2570: function has not been declared with compatible "target" attribute
return Rcpp_protect(x) ;
^
detected during:
instantiation of "SEXP Rcpp::Shelter<T>::operator()(SEXP) [with T=SEXP]" at line 326 of "/home/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp/exceptions.h"
instantiation of "SEXP exception_to_condition_template(const Exception &, bool) [with Exception=Rcpp::exception]" at line 339 of "/home/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp/exceptions.h"
/home/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp/utils/tinyformat/tinyformat.h(218): warning #2570: function has not been declared with compatible "target" attribute
static void invoke(std::ostream& /*out*/, const T& /*value*/) { TINYFORMAT_ASSERT(0); }
^
detected during:
instantiation of "void tinyformat::detail::formatValueAsType<T, fmtT, convertible>::invoke(std::ostream &, const T &) [with T=const char *, fmtT=char, convertible=false]" at line 329
instantiation of "void tinyformat::formatValue(std::ostream &, const char *, const char *, int, const T &) [with T=const char *]" at line 528
instantiation of "void tinyformat::detail::FormatArg::formatImpl<T>(std::ostream &, const char *, const char *, int, const void *) [with T=const char *]" at line 504
instantiation of "tinyformat::detail::FormatArg::FormatArg(const T &) [with T=const char *]" at line 881
instantiation of "tinyformat::detail::FormatListN<N>::FormatListN(const Args &...) [with N=1, Args=<const char *>]" at line 930
instantiation of "tinyformat::detail::FormatListN<<expression>> tinyformat::makeFormatList(const Args &...) [with Args=<const char *>]" at line 966
instantiation of "void tinyformat::format(std::ostream &, const char *, const Args &...) [with Args=<const char *>]" at line 975
instantiation of "std::string tinyformat::format(const char *, const Args &...) [with Args=<const char *>]" at line 226 of "/home/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp/exceptions.h"
instantiation of "Rcpp::not_compatible::not_compatible(const char *, Args &&...) [with Args=<const char *const &>]" at line 37 of "/home/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include/Rcpp/r_cast.h"
Wondering if anyone can help point me to what issues are resulting in the above errors? I recognise that I might be missing something fundamental owing to my in familiarity with C and the Rcpp package and so please excuse this.
Many thanks in advance,

Error when building nginx docker

I am trying to build a docker from a fork and I am getting the following error when performing docker build ./:
cc1: all warnings being treated as errors
make[1]: *** [objs/src/event/ngx_event_openssl.o] Error 1
objs/Makefile:748: recipe for target 'objs/src/event/ngx_event_openssl.o' failed
make[1]: Leaving directory '/tmp/nginx/nginx-1.8.0'
make: *** [install] Error 2
On install we run
apt-get -y install libpcre3-dev zlib1g-dev libssl-dev openssl build-essential wget
I can't find this error on google. The full error for reference as I can't find out the exact error reference I need to research:
src/event/ngx_event_openssl.c: In function 'ngx_ssl_init':
src/event/ngx_event_openssl.c:112:5: error: 'OPENSSL_config' is deprecated [-Werror=deprecated-declarations]
OPENSSL_config(NULL);
^~~~~~~~~~~~~~
In file included from /usr/include/openssl/ct.h:13:0,
from /usr/include/openssl/ssl.h:61,
from src/event/ngx_event_openssl.h:15,
from src/core/ngx_core.h:80,
from src/event/ngx_event_openssl.c:9:
/usr/include/openssl/conf.h:92:1: note: declared here
DEPRECATEDIN_1_1_0(void OPENSSL_config(const char *config_name))
^
src/event/ngx_event_openssl.c: In function 'ngx_ssl_rsa512_key_callback':
src/event/ngx_event_openssl.c:753:9: error: 'RSA_generate_key' is deprecated [-Werror=deprecated-declarations]
key = RSA_generate_key(512, RSA_F4, NULL, NULL);
^~~
In file included from /usr/include/openssl/rsa.h:13:0,
from /usr/include/openssl/x509.h:31,
from /usr/include/openssl/ssl.h:50,
from src/event/ngx_event_openssl.h:15,
from src/core/ngx_core.h:80,
from src/event/ngx_event_openssl.c:9:
/usr/include/openssl/rsa.h:193:1: note: declared here
DEPRECATEDIN_0_9_8(RSA *RSA_generate_key(int bits, unsigned long e, void
^
src/event/ngx_event_openssl.c: In function 'ngx_ssl_dhparam':
src/event/ngx_event_openssl.c:943:11: error: dereferencing pointer to incomplete type 'DH {aka struct dh_st}'
dh->p = BN_bin2bn(dh1024_p, sizeof(dh1024_p), NULL);
^~
src/event/ngx_event_openssl.c: In function 'ngx_ssl_handshake':
src/event/ngx_event_openssl.c:1164:31: error: dereferencing pointer to incomplete type 'SSL {aka struct ssl_st}'
if (c->ssl->connection->s3) {
^~
src/event/ngx_event_openssl.c: In function 'ngx_ssl_connection_error':
src/event/ngx_event_openssl.c:1913:21: error: 'SSL_R_NO_CIPHERS_PASSED' undeclared (first use in this function)
|| n == SSL_R_NO_CIPHERS_PASSED /* 182 */
^~~~~~~~~~~~~~~~~~~~~~~
src/event/ngx_event_openssl.c:1913:21: note: each undeclared identifier is reported only once for each function it appears in
src/event/ngx_event_openssl.c: In function 'ngx_ssl_session_cache':
src/event/ngx_event_openssl.c:2107:43: error: passing argument 2 of 'SSL_CTX_sess_set_get_cb' from incompatible pointer type [-Werror=incompatible-pointer-types]
SSL_CTX_sess_set_get_cb(ssl->ctx, ngx_ssl_get_cached_session);
^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/event/ngx_event_openssl.h:15:0,
from src/core/ngx_core.h:80,
from src/event/ngx_event_openssl.c:9:
/usr/include/openssl/ssl.h:637:6: note: expected 'SSL_SESSION * (*)(struct ssl_st *, const unsigned char *, int, int *) {aka struct ssl_session_st * (*)(struct ssl_st *, const unsigned char *, int, int *)}' but argument is of type 'SSL_SESSION * (*)(SSL *, u_char *, int, int *) {aka struct ssl_session_st * (*)(struct ssl_st *, unsigned char *, int, int *)}'
void SSL_CTX_sess_set_get_cb(SSL_CTX *ctx,
^~~~~~~~~~~~~~~~~~~~~~~
src/event/ngx_event_openssl.c: In function 'ngx_ssl_session_id_context':
src/event/ngx_event_openssl.c:2129:27: error: storage size of 'md' isn't known
EVP_MD_CTX md;
^~
src/event/ngx_event_openssl.c:2195:5: error: implicit declaration of function 'EVP_MD_CTX_cleanup' [-Werror=implicit-function-declaration]
EVP_MD_CTX_cleanup(&md);
^~~~~~~~~~~~~~~~~~
src/event/ngx_event_openssl.c: In function 'ngx_ssl_session_ticket_key_callback':
src/event/ngx_event_openssl.c:2864:9: error: 'RAND_pseudo_bytes' is deprecated [-Werror=deprecated-declarations]
RAND_pseudo_bytes(iv, 16);
^~~~~~~~~~~~~~~~~
In file included from /usr/include/openssl/engine.h:19:0,
from src/event/ngx_event_openssl.h:22,
from src/core/ngx_core.h:80,
from src/event/ngx_event_openssl.c:9:
/usr/include/openssl/rand.h:47:1: note: declared here
DEPRECATEDIN_1_1_0(int RAND_pseudo_bytes(unsigned char *buf, int num))
^
cc1: all warnings being treated as errors
make[1]: *** [objs/src/event/ngx_event_openssl.o] Error 1
objs/Makefile:748: recipe for target 'objs/src/event/ngx_event_openssl.o' failed
make[1]: Leaving directory '/tmp/nginx/nginx-1.8.0'
make: *** [install] Error 2
This is the docker fork I am running https://github.com/meteorhacks/mup-frontend-server
You are getting various errors and warnings here, but they aren't really about Docker or OpenSSL. If we strip away the extraneous information, here are the problems you are encountering.
error: 'OPENSSL_config' is deprecated
error: 'RSA_generate_key' is deprecated
error: dereferencing pointer to incomplete type 'DH {aka struct dh_st}'
error: dereferencing pointer to incomplete type 'SSL {aka struct ssl_st}'
error: 'SSL_R_NO_CIPHERS_PASSED' undeclared (first use in this function)
error: passing argument 2 of 'SSL_CTX_sess_set_get_cb' from incompatible pointer type
error: storage size of 'md' isn't known
error: implicit declaration of function 'EVP_MD_CTX_cleanup'
error: 'RAND_pseudo_bytes' is deprecated
The core of the problem here is probably that you are using a legacy version of Nginx in this project. From the GitHub repository you pointed to, in install-nginx.sh:
NGINX_VERSION=1.8.0
The current mainline version of Nginx is 1.13.2. I haven't combed through the changelogs for Nginx, but based on the errors you are receiving, it seems likely that between the 1.8 releases and the current ones, OpenSSL has deprecated various functions that Nginx 1.8 relied on. Most likely this can be solved by moving to a recent release of Nginx.
As of this writing, 1.13.2 is the current mainline, and 1.12.0 is the current stable. One of those may work better. Whether you can simply drop this in, I can't say. You may have to change something in the build scripts or the nginx config for a more recent version to work properly.
you are getting this error because your nginx version don't support SSL 1.1.0. Either upgrade NGINX version or use SSL 1.0.2.

Kaaproject esp8266 build conflicting types

I have installed the ESP8266 SDK and toolchain and try to build the project CDataCollectionDemo which is generated from kaa sandbox. And I get the error like this
/opt/Espressif/esp-rtos-sdk/include/espressif/c_types.h:47:29: error: conflicting types for ‘size_t’
typedef unsigned int size_t;
^
In file included from /opt/Espressif/esp-rtos-sdk/extra_include/string.h:14:0,
from /home/tung/kaa/project/CDataCollectionDemo/targets/esp8266/target.
here is the full output
tung#ubuntu:~/kaa/project/CDataCollectionDemo$ sudo ./build.sh deploy
-- The C compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
==================================
BUILD_TYPE = (Default)
KAA_PLATFORM = posix
KAA_MAX_LOG_LEVEL = 3
==================================
BOOTSTRAP ENABLED
PROFILE ENABLED
USER EXTENSION ENABLED
CONFIGURATION ENABLED
EVENTS ENABLED
LOGGING ENABLED
NOTIFICATION ENABLED
ENCRYPTION ENABLED
KAA WILL BE INSTALLED TO /usr/local
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Could NOT find cppcheck
-- WiFi AP: WiFi SSID
-- WiFi Pass:
-- Configuring done
-- Generating done
-- Build files have been written to: /home/tung/kaa/project/CDataCollectionDemo/build
Scanning dependencies of target target_support
[ 1%] Building C object targets/esp8266/CMakeFiles/target_support.dir/target.c.o
In file included from /opt/Espressif/esp-rtos-sdk/extra_include/sys/config.h:4:0,
from /opt/Espressif/esp-rtos-sdk/extra_include/_ansi.h:16,
from /opt/Espressif/esp-rtos-sdk/extra_include/string.h:10,
from /home/tung/kaa/project/CDataCollectionDemo/targets/esp8266/target.c:17:
/opt/Espressif/esp-rtos-sdk/extra_include/machine/ieeefp.h:277:2: error: #error Endianess not declared!!
#error Endianess not declared!!
^
In file included from /opt/Espressif/esp-rtos-sdk/include/espressif/esp_common.h:9:0,
from /opt/Espressif/esp-rtos-sdk/include/freertos/portmacro.h:73,
from /opt/Espressif/esp-rtos-sdk/include/freertos/portable.h:318,
from /opt/Espressif/esp-rtos-sdk/include/freertos/FreeRTOS.h:87,
from /home/tung/kaa/project/CDataCollectionDemo/targets/esp8266/target.c:19:
/opt/Espressif/esp-rtos-sdk/include/espressif/c_types.h:47:29: error: conflicting types for ‘size_t’
typedef unsigned int size_t;
^
In file included from /opt/Espressif/esp-rtos-sdk/extra_include/string.h:14:0,
from /home/tung/kaa/project/CDataCollectionDemo/targets/esp8266/target.c:17:
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stddef.h:212:23: note: previous declaration of ‘size_t’ was here
typedef __SIZE_TYPE__ size_t;
^
In file included from /opt/Espressif/esp-rtos-sdk/include/espressif/esp_common.h:10:0,
from /opt/Espressif/esp-rtos-sdk/include/freertos/portmacro.h:73,
from /opt/Espressif/esp-rtos-sdk/include/freertos/portable.h:318,
from /opt/Espressif/esp-rtos-sdk/include/freertos/FreeRTOS.h:87,
from /home/tung/kaa/project/CDataCollectionDemo/targets/esp8266/target.c:19:
/opt/Espressif/esp-rtos-sdk/include/espressif/esp_libc.h:10:7: error: conflicting types for ‘strncpy’
char *strncpy(char *dst, const char *src, size_t n);
^
/opt/Espressif/esp-rtos-sdk/include/espressif/esp_libc.h:12:5: error: conflicting types for ‘strncmp’
int strncmp(const char *s1, const char *s2, size_t n);
^
/opt/Espressif/esp-rtos-sdk/include/espressif/esp_libc.h:13:8: error: conflicting types for ‘strlen’
size_t strlen(const char *s);
^
/opt/Espressif/esp-rtos-sdk/include/espressif/esp_libc.h:16:7: error: conflicting types for ‘strncat’
char *strncat(char *dst, const char *src, size_t count);
^
/opt/Espressif/esp-rtos-sdk/include/espressif/esp_libc.h:17:8: error: conflicting types for ‘strspn’
size_t strspn(const char *s, const char *accept);
^
/opt/Espressif/esp-rtos-sdk/include/espressif/esp_libc.h:18:8: error: conflicting types for ‘strcspn’
size_t strcspn(const char *s, const char *reject);
^
/opt/Espressif/esp-rtos-sdk/include/espressif/esp_libc.h:26:6: error: conflicting types for ‘bzero’
void bzero(void *s, size_t n);
^
/opt/Espressif/esp-rtos-sdk/include/espressif/esp_libc.h:28:7: error: conflicting types for ‘memcpy’
void *memcpy(void *dst, const void *src, size_t n);
^
/opt/Espressif/esp-rtos-sdk/include/espressif/esp_libc.h:29:7: error: conflicting types for ‘memset’
void *memset(void *dst, int c, size_t n);
^
/opt/Espressif/esp-rtos-sdk/include/espressif/esp_libc.h:30:5: error: conflicting types for ‘memcmp’
int memcmp(const void *m1, const void *m2, size_t n);
^
/opt/Espressif/esp-rtos-sdk/include/espressif/esp_libc.h:31:7: error: conflicting types for ‘memmove’
void *memmove(void *dst, const void *src, size_t n);
^
/opt/Espressif/esp-rtos-sdk/include/espressif/esp_libc.h:37:5: warning: conflicting types for built-in function ‘snprintf’ [enabled by default]
int snprintf(char *buf, unsigned int count, const char *format, ...);
^
/opt/Espressif/esp-rtos-sdk/include/espressif/esp_libc.h:41:7: warning: conflicting types for built-in function ‘malloc’ [enabled by default]
void *malloc(size_t n);
^
/opt/Espressif/esp-rtos-sdk/include/espressif/esp_libc.h:43:7: warning: conflicting types for built-in function ‘calloc’ [enabled by default]
void *calloc(size_t c, size_t n);
^
/opt/Espressif/esp-rtos-sdk/include/espressif/esp_libc.h:45:7: warning: conflicting types for built-in function ‘realloc’ [enabled by default]
void *realloc(void *p, size_t n);
^
make[2]: *** [targets/esp8266/CMakeFiles/target_support.dir/target.c.o] Error 1
make[1]: *** [targets/esp8266/CMakeFiles/target_support.dir/all] Error 2
make: *** [all] Error 2
./build.sh: 52: ./build.sh: ./demo_client: not found
Everything I did follow the kaa documentation, except adding the -DKAA_PLATFORM=esp8266 argument to cmake command in build.sh file. Can you tell me what's problem here and how to fix it. Thank you!
Update
I have added some arguments to cmake command as #MrKoin suggested but still get an error
Cmake arguments
cmake .. \
-DCMAKE_TOOLCHAIN_FILE=../libs/kaa/toolchains/esp8266.cmake \
-DKAA_PLATFORM=esp8266 \
-DCMAKE_BUILD_TYPE=MinSizeRel \
Output
In file included from /home/tung/kaa/project/CDataCollectionDemo/libs/kaa/thirdparty/mbedtls/aes.c:27:0:
/opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/include/stdint.h:9:26: fatal error: stdint.h: No such file or directory
# include_next <stdint.h>
^
compilation terminated.
make[2]: *** [libs/kaa/tools/kaa_encryption/rsa_key_gen/mbedtls/CMakeFiles/mbedtls.dir/aes.c.obj] Error 1
make[1]: *** [libs/kaa/tools/kaa_encryption/rsa_key_gen/mbedtls/CMakeFiles/mbedtls.dir/all] Error 2
make: *** [all] Error 2
It seems like some libraries missing. What should I do now? Thanks!
Looks like you need to specify cmake toolchain file in cmake arguments:
cmake -DCMAKE_TOOLCHAIN_FILE=../libs/kaa/toolchains/esp8266.cmake \
-DKAA_PLATFORM=esp8266 ..
Please, refer documentation for details.
It might be related to step 5 Install ESP8266 RTOS SDK in the tutorial you referenced from the Kaa website.
Did you run the command sed -i 's:#include "c_types.h"://#include "c_types.h":' $ESP_SDK_HOME/include/lwip/arch/cc.h?
I remember I had a similar (or the same) problem and forgot to execute this command. It comments out an #include which conflicts with the declaration of types elsewhere.
You need to edit the build.sh file,
find build() and change the code:
build() {
mkdir -p "$PROJECT_HOME/build"
cd "$PROJECT_HOME/build"
cmake ..\
-DKAA_TARGET=esp8266\
-DCMAKE_TOOLCHAIN_FILE=../libs/kaa/toolchains/esp8266.cmake \
-DBUILD_TESTING=OFF \
-DKAA_PLATFORM=esp8266 \
-DBUILD_TESTING=OFF \
-DCMAKE_BUILD_TYPE=MinSizeRel
make
}

Resources