ThomasH-W / LoRa-Stopwatch

Stopwatch with countdown for multiple devices being synchronized via LoRa
https://hoeser-medien.de/2021/04/lora-stoppuhr-mit-countdown/
0 stars 0 forks source link

How to open in Arduino IDE #1

Open mogerken opened 4 weeks ago

mogerken commented 4 weeks ago

Hello, sorry if this is a dumb question, but I want to build the same project and found this code, but I can't figure out how to open it in the Arduino IDE without an .ino file. Do I have to create one by my self? Thank you!

mogerken commented 4 weeks ago

Okay I figured out I needed Visual Studio Code with the platformio add-on but when I am trying to build it I get this error message:

src/main.cpp: In function 'String encrypt(const char*, byte*)':
src/main.cpp:1190:20: error: invalid conversion from 'const char*' to 'const byte*' {aka 'const unsigned char*'} [-fpermissive]
   aesLib.encrypt64(msg, msgLen, encrypted, aes_key, sizeof(aes_key), iv);
                    ^~~
In file included from src/main.cpp:61:
.pio/libdeps/Stopwatch/AESLib/src/AESLib.h:51:36: note:   initializing argument 1 of 'uint16_t AESLib::encrypt64(const byte*, uint16_t, char*, const byte*, int, byte*)'
     uint16_t encrypt64(const byte *input, uint16_t input_length, char *output, const byte key[],int bits, byte my_iv[]); // base64 encode, encrypt and base64 encode again; will deprecate
                        ~~~~~~~~~~~~^~~~~
src/main.cpp: In function 'String decrypt(const char*, byte*)':
src/main.cpp:1204:38: error: invalid conversion from 'char*' to 'byte*' {aka 'unsigned char*'} [-fpermissive]
   aesLib.decrypt64(original, msgLen, decrypted, aes_key, sizeof(aes_key), iv);
                                      ^~~~~~~~~
In file included from src/main.cpp:61:
.pio/libdeps/Stopwatch/AESLib/src/AESLib.h:54:66: note:   initializing argument 3 of 'uint16_t AESLib::decrypt64(char*, uint16_t, byte*, const byte*, int, byte*)'
     uint16_t decrypt64(char *input, uint16_t input_length, byte *output, const byte key[],int bits, byte my_iv[]); // decode, decrypt and decode
                                                            ~~~~~~^~~~~~
*** [.pio\build\Stopwatch\src\main.cpp.o] Error 1
src/myWiFiAP.cpp: In function 'void wsSendMode(int, int, int)':
src/myWiFiAP.cpp:117:8: error: 'class AsyncWebSocket' has no member named 'printfAll_P'; did you mean 'printfAll'?
     ws.printfAll_P("sys_mode=%d", sys_mode);
        ^~~~~~~~~~~
        printfAll
src/myWiFiAP.cpp:118:8: error: 'class AsyncWebSocket' has no member named 'printfAll_P'; did you mean 'printfAll'?
     ws.printfAll_P("sw_mode=%d", sw_mode);
        ^~~~~~~~~~~
        printfAll
src/myWiFiAP.cpp:119:8: error: 'class AsyncWebSocket' has no member named 'printfAll_P'; did you mean 'printfAll'?
     ws.printfAll_P("mod_mode=%d", mod_mode);
        ^~~~~~~~~~~
        printfAll
src/myWiFiAP.cpp: In function 'void wsSendTimer(unsigned int, unsigned int, unsigned int*)':
src/myWiFiAP.cpp:134:8: error: 'class AsyncWebSocket' has no member named 'printfAll_P'; did you mean 'printfAll'?
     ws.printfAll_P("sw_timer=%u", sw_timer);
        ^~~~~~~~~~~
        printfAll
src/myWiFiAP.cpp:135:8: error: 'class AsyncWebSocket' has no member named 'printfAll_P'; did you mean 'printfAll'?
     ws.printfAll_P("sw_laps_used=%u", timerUsed);
        ^~~~~~~~~~~
        printfAll
src/myWiFiAP.cpp:143:8: error: 'class AsyncWebSocket' has no member named 'printfAll_P'; did you mean 'printfAll'?
     ws.printfAll_P(buf);
        ^~~~~~~~~~~
        printfAll
src/myWiFiAP.cpp: In function 'void wsSendCountdown(int)':
src/myWiFiAP.cpp:151:8: error: 'class AsyncWebSocket' has no member named 'printfAll_P'; did you mean 'printfAll'?
     ws.printfAll_P("sw_count=%d", count);
        ^~~~~~~~~~~
        printfAll
src/myWiFiAP.cpp: In function 'void wsSendAdmin(byte, unsigned int, int, int, float, unsigned int, unsigned int, unsigned int, unsigned int)':
src/myWiFiAP.cpp:169:8: error: 'class AsyncWebSocket' has no member named 'printfAll_P'; did you mean 'printfAll'?
     ws.printfAll_P("admin_firmware=%s", FIRMWARE_VERSION);
        ^~~~~~~~~~~
        printfAll
src/myWiFiAP.cpp:170:8: error: 'class AsyncWebSocket' has no member named 'printfAll_P'; did you mean 'printfAll'?
     ws.printfAll_P("admin_deviceID=%2x", localAddress);
        ^~~~~~~~~~~
        printfAll
src/myWiFiAP.cpp:171:8: error: 'class AsyncWebSocket' has no member named 'printfAll_P'; did you mean 'printfAll'?
     ws.printfAll_P("admin_connected=%d", loraConnected);
        ^~~~~~~~~~~
        printfAll
src/myWiFiAP.cpp:172:8: error: 'class AsyncWebSocket' has no member named 'printfAll_P'; did you mean 'printfAll'?
     ws.printfAll_P("admin_RSSI=%d", incomingRSSIlevel);
        ^~~~~~~~~~~
        printfAll
src/myWiFiAP.cpp:173:8: error: 'class AsyncWebSocket' has no member named 'printfAll_P'; did you mean 'printfAll'?
     ws.printfAll_P("admin_RSSIlevel=%d", incomingRSSIlevel);
        ^~~~~~~~~~~
        printfAll
src/myWiFiAP.cpp:174:8: error: 'class AsyncWebSocket' has no member named 'printfAll_P'; did you mean 'printfAll'?
     ws.printfAll_P("admin_SNR=%2.1f", incomingSNR);
        ^~~~~~~~~~~
        printfAll
src/myWiFiAP.cpp:175:8: error: 'class AsyncWebSocket' has no member named 'printfAll_P'; did you mean 'printfAll'?
     ws.printfAll_P("admin_roundtrip=%d", swRoundtrip);
        ^~~~~~~~~~~
        printfAll
src/myWiFiAP.cpp:176:8: error: 'class AsyncWebSocket' has no member named 'printfAll_P'; did you mean 'printfAll'?
     ws.printfAll_P("admin_lbactive=%d", lightBarrierActive);
        ^~~~~~~~~~~
        printfAll
src/myWiFiAP.cpp:177:8: error: 'class AsyncWebSocket' has no member named 'printfAll_P'; did you mean 'printfAll'?
     ws.printfAll_P("admin_beam=%d", lightBarrierBeam);
        ^~~~~~~~~~~
        printfAll
src/myWiFiAP.cpp:178:8: error: 'class AsyncWebSocket' has no member named 'printfAll_P'; did you mean 'printfAll'?
     ws.printfAll_P("admin_buzzer=%d", buzzerActive);
        ^~~~~~~~~~~
        printfAll
*** [.pio\build\Stopwatch\src\myWiFiAP.cpp.o] Error 1

Does anybody know how I can solve this?

ThomasH-W commented 6 days ago

I tried to rebuild the program but failed as well. Unfotunately there have been changes in the core library preventing using libraries like wifi manager. This is a fundamental issue which I haven't found a solution yet. As I am too busys whith other things, I need to approach this in a few months again.