Hi! I'm trying to upload code from ESP-1ch-Gateway . This is error what I have and I can't figure out what is the problem. I did it before from my laptop with same Wemos D1 mini and all libraries and this code without any problems. Everithing works fine. But this time from other computer it won't to work.
C:\Users\y.heninsh\Documents\Arduino\ESP-1ch-Gateway-master\ESP-sc-gway\_utils.ino: In function 'int getNtpTime(time_t*)':
_utils:474:2: error: reference to 'byte' is ambiguous
474 | byte packetBuffer[NTP_PACKET_SIZE];
| ^~~~
In file included from c:\users\y.heninsh\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.4-gcc10.3-1757bed\xtensa-lx106-elf\include\c++\10.3.0\cmath:42,
from c:\users\y.heninsh\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.4-gcc10.3-1757bed\xtensa-lx106-elf\include\c++\10.3.0\math.h:36,
from C:\Users\y.heninsh\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266/Arduino.h:34,
from sketch\ESP-sc-gway.ino.cpp:1:
c:\users\y.heninsh\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.4-gcc10.3-1757bed\xtensa-lx106-elf\include\c++\10.3.0\bits\cpp_type_traits.h:404:30: note: candidates are: 'enum class std::byte'
404 | enum class byte : unsigned char;
| ^~~~
In file included from sketch\ESP-sc-gway.ino.cpp:1:
C:\Users\y.heninsh\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266/Arduino.h:160:17: note: 'typedef uint8_t byte'
160 | typedef uint8_t byte;
| ^~~~
_utils:475:9: error: 'packetBuffer' was not declared in this scope
475 | memset(packetBuffer, 0, NTP_PACKET_SIZE); // Set buffer contents to zero
| ^~~~~~~~~~~~
exit status 1
reference to 'byte' is ambiguous
I solved my problem with not the best way I think, but it's works. I uninstaled esp8266 board meneger latest varsion 3.0.2 and instaled 2.7.4. Added few libraries and it's work right now.
This is a nonsolution. Newer versions of the Core include bug fixes and use better compilers. You'll have to update eventually, so you might as well fix your code now.
Multiple solutions have been given: use uint8_t instead of byte and avoid using namespace std.
This is not my code. I'm using ESP-1ch-Gateway-v5.0--OLD. I don't have a time right now to change every byte and to avoid using namespace std. But of course You are right! Thank You!
In the past, jobs like that have taken me only a minute or two, using global search and replace. If it's not as unique as "byte", I do a find and replace, with visual confirmation.