Giter Club home page Giter Club logo

esp-signer's Introduction

Mobizt's GitHub stats

I'm engineer from Thailand.

I'm working on machine condition monitoring and vibration analysis.

The Industrial IoTs, data processing and data acquisition are the fields that I focused.

I develop and maintain the Arduino C++ opensource libraries for embedded devices.

One of my projects Firebase Arduino Client Library for ESP8266 and ESP32 wins the Google Open Source Peer Bonus Program.

The E-mail client library for Arduino project is the first E-mail client library in the Arduino platform that allows the embedded device to send and receive E-mail.

I'm ready to support and help for fixing the issues and answering the questions related to my libraries

esp-signer's People

Contributors

domingguss avatar mobizt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

esp-signer's Issues

Guidance on how to use

This is a useful library and I was able to get the Basic example code running with my own Service Account details very quickly. However, the example just demonstrates the refresh of Auth Tokens not their usage. I have struggled using it to build my own client to access Google Cloud Storage and Google Vision.

The library instantiates a global Signer object, which I therefore presume is the intended means of access to the functionality. However, the ESP_Signer class has access specifiers that prevent access to the TCP client (authClient.tcpClient) from outside.

Looking at your earlier work such as ESP-Google-Forms-Client the client class GFormsClass (picks up the authMan TCP Client and uses that to run the API but in that design the GAuthManager object grants explicit friend class access so it can bypass the protected and private access specifiers.

I have made it work by making my own client class inherit from ESP_Signer and by granting friend class access to my own class within GAuth_OAuth2_Client but I'm sure this is not how you intended it to be used. Should I perhaps be using a different TCP client object and not try to obtain the one used by Signer itself?

It would be helpful to see an example of how to use ESP_Signer within the context of a simple API client as you intend it should work e.g. one that just uploads a GCS storage file.

Alternatively, it would be great to see ESP_Signer refactored into, say, your ESP-Google-Forms-Client however I appreciate you have moved on since that work. I did try using your Firebase-ESP-Client but it won't compile for XIAO_ESP32S3 if I disable the bits I don't need such as OTA and Firestore. It compiles fine for ESP32.

BUG - Misspelled file capitalization breaks include in PlatformIO

Describe the bug
A clear and concise description of what the bug is.
ESP_Signer.h and GAuth_OAUth2_Client.cpp includes the file "auth/GAuth_OAuth2_Client.h"
However the file is actually named GAuth_OAUth2_Client.h
Note the capital U.
At least on PlatformIO, this causes compile to fail because it can't find the include.
To Reproduce
Steps to reproduce the behavior:
Try to compile example in PlatformIO (Note - using arduino-pico)

Expected behavior
A clear and concise description of what you expected to happen.
Should compile the library correctly.

Compile Errors in FirebaseJson.h

I am getting the following compiler errors when trying to compile the Basic.ino example:

Compiling .pio\build\esp32dev\lib06f\ESP Signer\bearssl\i31_decred.c.o
In file included from .pio/libdeps/esp32dev/ESP Signer/src/SignerCommon.h:39:0,
                 from .pio/libdeps/esp32dev/ESP Signer/src/SignerUtils.h:37,
                 from .pio/libdeps/esp32dev/ESP Signer/src/ESPSigner.h:41,
                 from src/main.cpp:8:
.pio/libdeps/esp32dev/ESP Signer/src/./json/FirebaseJson.h:2223:13: error: expected ';' at end of member declaration
     Stream *toStream(File *file)
             ^
.pio/libdeps/esp32dev/ESP Signer/src/./json/FirebaseJson.h:2223:22: error: 'Stream* FirebaseJsonBase::toStream' conflicts with a previous declaration
     Stream *toStream(File *file)
                      ^
.pio/libdeps/esp32dev/ESP Signer/src/./json/FirebaseJson.h:2212:13: note: previous declaration 'Stream* FirebaseJsonBase::toStream(HardwareSerial*)'
     Stream *toStream(HardwareSerial *ser)
             ^
.pio/libdeps/esp32dev/ESP Signer/src/./json/FirebaseJson.h:2223:27: error: expected ')' before '*' token
     Stream *toStream(File *file)
                           ^
.pio/libdeps/esp32dev/ESP Signer/src/./json/FirebaseJson.h: In member function 'bool FirebaseJsonArray::readFrom(fs::File&)':
.pio/libdeps/esp32dev/ESP Signer/src/./json/FirebaseJson.h:2442:73: error: no matching function for call to 'FirebaseJsonArray::toStream(fs::File*)'
     bool readFrom(FILE_SYSTEM &file) { return mReadStream(toStream(&file), -1); }
                                                                         ^
.pio/libdeps/esp32dev/ESP Signer/src/./json/FirebaseJson.h:2212:13: note: candidate: Stream* FirebaseJsonBase::toStream(HardwareSerial*)
     Stream *toStream(HardwareSerial *ser)
             ^
.pio/libdeps/esp32dev/ESP Signer/src/./json/FirebaseJson.h:2212:13: note:   no known conversion for argument 1 from 'fs::File*' to 'HardwareSerial*'
.pio/libdeps/esp32dev/ESP Signer/src/./json/FirebaseJson.h: In member function 'bool FirebaseJson::readFrom(fs::File&)':
.pio/libdeps/esp32dev/ESP Signer/src/./json/FirebaseJson.h:2914:73: error: no matching function for call to 'FirebaseJson::toStream(fs::File*)'
     bool readFrom(FILE_SYSTEM &file) { return mReadStream(toStream(&file), -1); }
                                                                         ^
.pio/libdeps/esp32dev/ESP Signer/src/./json/FirebaseJson.h:2212:13: note: candidate: Stream* FirebaseJsonBase::toStream(HardwareSerial*)
     Stream *toStream(HardwareSerial *ser)
             ^
.pio/libdeps/esp32dev/ESP Signer/src/./json/FirebaseJson.h:2212:13: note:   no known conversion for argument 1 from 'fs::File*' to 'HardwareSerial*'
Compiling .pio\build\esp32dev\lib06f\ESP Signer\bearssl\i31_encode.c.o
Compiling .pio\build\esp32dev\lib06f\ESP Signer\bearssl\i31_fmont.c.o
Compiling .pio\build\esp32dev\lib06f\ESP Signer\bearssl\i31_iszero.c.o
Compiling .pio\build\esp32dev\lib06f\ESP Signer\bearssl\i31_moddiv.c.o
*** [.pio\build\esp32dev\src\main.cpp.o] Error 1

Please can you help me understand what I'm doing wrong?

I've tried updating the FirebaseJson files with the latest from that GitHub project, but that just resulted in many more (different) compile errors, so I'm fundamentally missing something.

MB_String appendNum not functioning correctly on Arduino UNO R4 WiFi

Describe the bug
When appendNum is called on an MB_String, the string "ld" or "lu" is appended instead of the actual number

To Reproduce
Make an MB_String and try to append a number to it on the UNO R4 WiFi

Expected behavior
The number (base 10 ascii) should be appended

Screenshots
image
I think there should be an extra "|| defined(ARDUINO_UNO_R4)" (not the real macro, i dont know what it is) here to check for the UNO, because I think it is assuming it's a 64-bit processor which it isn't and thus does not understand "%lld" and "%llu" in the 64 bit toStr functions.

Additional context
I fixed it by modifying the int64Str and uint64Str to "%ld" and "%lu" instead of "%lld" and "%llu". But I don't think it should be calling those functions anyway. I can't find the macro used to determine if the board is the UNO R4. It's also possible that there are other spots in the code where the UNO is assumed to have 64 bit architecture. This is the only problem I've run into that causes the library to fail for my purposes though.

ENHANCEMENT

Is your feature request related to a problem? Please describe.
In my project I must use Adafruit Fork of SdFat library, but it conflicts with the the SdFat from greiman.

Describe the solution you'd like
Please add Adafruit Fork of SdFat support to your library.

Describe alternatives you've considered

  1. SdFat is already activated and mounted for other purposes in my project, so it would be great if I could skip Sd initialization and just pass the already activated SdFat object to ESP-Signer

  2. I could use Flash file system, but cannot have both SdFat and Flash FS as they define conflicting File classes.

  3. Or PSRAM? But see below.

Additional context
I also tried disabling all file systems and just leave PSRAM parameters in FS_Config.h, but then I get these errors, so as I understand file system is a must:

ESP_Signer_TCP_Client.cpp:98:9: error: 'fs' has not been declared
         fs::File file = mbfs->getFlashFile();

...

ESP_Signer_TCP_Client.cpp:99:25: error: 'file' was not declared in this scope
         wcs->loadCACert(file, len);

...

ESP_Signer_TCP_Client.cpp:99:25: note: suggested alternative: 'pipe'
         wcs->loadCACert(file, len);

error: field '_host' has incomplete type 'std::string' {aka 'std::__cxx11::basic_string<char>'}

E:\Documents\Arduino\libraries\ESP-Signer-main\src\wcs\esp8266\ESP_Signer_HTTPClient.h:97:15: error: field '_host' has incomplete type 'std::string' {aka 'std::__cxx11::basic_string'}
97 | std::string _host = "";
| ^~~~~

Error when compiling the files itself.

To Reproduce
Steps to reproduce the behavior:

Update to arduino core 3.0.0
Open any example from library
Compile
Expected behavior
Was compiling flawlessly previously in Arduino core 2.7.4

IDE and its version:

Arduino, 1.8.14
ESP8266 Arduino Core SDK version

3.0.0

ESP12E keeps throwing exceptions whenever Token needs to be refreshed

Hi Mobizt,
now I am using oauth2.0 tokens with google analytics 4 API, it seems that the token never gets refreshed successfully, whenever it expires it keeps throwing -4 error connection lost repeatedly until the ESP crashes, sometimes it's OOM exception this time it's exception 29 which is storeprohibitedcause.

I use the token every 30mins, I relied earlier on the fact that it's refreshed automatically but it gave me errors, then added a call to the refresh token function but still the same problem

Am I not having enough memory for my ESP12E?, does the library require anything I am not aware of ?
my code is attached, Arduino IDE
Board: Node MCU V1.0 ( ESP12E )
Core: latest

Please help asap
Serial monitor output
Code.txt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.