Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unishox3 not working for ESP32 #54

Open
capedra opened this issue Mar 17, 2023 · 8 comments
Open

Unishox3 not working for ESP32 #54

capedra opened this issue Mar 17, 2023 · 8 comments

Comments

@capedra
Copy link

capedra commented Mar 17, 2023

Hello. Where's the marisa.h file that's required in unishox3.h file? It's not there in Unishox3_Alpha directory. Thanks!

@siara-cc
Copy link
Owner

Hi, you just caught me trying to commit changes. I am in the process of making some improvements so there are some CI issues to be fixed.

You can proceed with older commits such as:
git checkout afb341b3ce99d20f7515707e07294475248ac450

@capedra
Copy link
Author

capedra commented Mar 17, 2023

@siara-cc
I guess you also need trie.h file besides marisa.h file in the Unishox3_Alpha directory

@siara-cc
Copy link
Owner

@capedra It is done now if you wish to try. This is not compatible with data compressed with previous version. So you may need to compress again if you have been using previous versions.

trie.h is included in marisa.h so now issue is fixed after installing sudo apt install libmarisa-dev. Thanks!

@capedra
Copy link
Author

capedra commented Mar 17, 2023

@siara-cc
Friend, I will be testing it on an ESP32 board, so I need these files to be included there, so, where may I find all of them? Thanks again!

@capedra
Copy link
Author

capedra commented Mar 17, 2023

In file included from src/main.cpp:4:
lib/Unishox/src/unishox3.h:86:10: fatal error: marisa.h: No such file or directory
#include "marisa.h"
          ^~~~~~~~~~
compilation terminated.

@siara-cc
Copy link
Owner

@capedra Unishox3 is not available for esp32 yet. Please use Unishox2 at the main folder.

@capedra
Copy link
Author

capedra commented Mar 17, 2023

@siara-cc
As I was trying to make it work for ESP32, these are the errors that I'm facing now while trying:

lib/Unishox/src/unishox3.cpp: In constructor 'unishox3::unishox3()':
lib/Unishox/src/unishox3.cpp:336:18: error: 'trie_dumps' was not declared in this scope
     tries[i].map(trie_dumps[i], predict_trie_sizes[i]);
                  ^~~~~~~~~~
lib/Unishox/src/unishox3.cpp:336:18: note: suggested alternative: 'tries'
     tries[i].map(trie_dumps[i], predict_trie_sizes[i]);
                  ^~~~~~~~~~
                  tries
lib/Unishox/src/unishox3.cpp:336:33: error: 'predict_trie_sizes' was not declared in this scope
     tries[i].map(trie_dumps[i], predict_trie_sizes[i]);
                                 ^~~~~~~~~~~~~~~~~~
lib/Unishox/src/unishox3.cpp: In member function 'usx3_dict_find unishox3::match_predef_dict(const char*, int, int)':
lib/Unishox/src/unishox3.cpp:401:12: error: 'predict_max_lens' was not declared in this scope
   char key[predict_max_lens[LATIN_DICT_LVL_MAX]+1];
            ^~~~~~~~~~~~~~~~
lib/Unishox/src/unishox3.cpp:401:29: error: 'LATIN_DICT_LVL_MAX' was not declared in this scope
   char key[predict_max_lens[LATIN_DICT_LVL_MAX]+1];
                             ^~~~~~~~~~~~~~~~~~
lib/Unishox/src/unishox3.cpp:405:13: error: 'key' was not declared in this scope
     strncpy(key, in + l, key_len);
             ^~~
lib/Unishox/src/unishox3.cpp:405:13: note: suggested alternative: 'key_t'
     strncpy(key, in + l, key_len);
             ^~~
             key_t
lib/Unishox/src/unishox3.cpp: In member function 'int unishox3::encode_dict_matches(const char*, int, int, char*, int, int*, uint8_t*, uint8_t*)':   
lib/Unishox/src/unishox3.cpp:574:28: error: 'predict_count_bits' was not declared in this scope
       int bits_to_append = predict_count_bits[dict_find.lvl];
                            ^~~~~~~~~~~~~~~~~~
lib/Unishox/src/unishox3.cpp: In member function 'int unishox3::decompress(const char*, int, char*)':
lib/Unishox/src/unishox3.cpp:1354:32: error: 'predict_count_bits' was not declared in this scope
             int bits_to_read = predict_count_bits[pos_lvl];
                                ^~~~~~~~~~~~~~~~~~
*** [.pio\build\m5stack-core2\libb06\Unishox\unishox3.cpp.o] Error 1

@capedra capedra changed the title marisa.h file Unishox3 not working for ESP32 Mar 17, 2023
@siara-cc
Copy link
Owner

I am not sure how you are trying to integrate, but it looks like you are trying to compile Unishox3 on esp32. Unishox3 is not available for ESP32 yet.

Please include Unishox2 unishox2.h and unishox2.c in the main folder along with your .ino or esp-idf project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants