I'm trying to import base64 on the SEEED Xiao ESP32-C3 which is running circuitpython version 8 beta 6. However, when I use import base64 or import ubase64 I see the error ImportError: no module named 'base64' which is the same for ubase64. The only option was to use !pip install circuitpython-base64 which does not include b32decode. I read that base64 comes with Python by default which does not seem to be the case here. Is there any workaround?
base64 library for circuitpython on SEEED Xiao ESP32-C3
157 views Asked by Aditya Desai At
2
There are 2 answers
1
Dacoolinus
On
circuitpython-base64 does include b32decode! If you want to take a look at the source it is here. After running pip install circuitpython-base64, the following script should work.
import circuitpython_base64 as base64
bytes_to_encode = b"Aladdin:open sesame"
print(repr(bytes_to_encode))
base32_string = base64.b32encode(bytes_to_encode)
print(repr(base32_string))
decoded_bytes = base632.b32decode(base32_string)
print(repr(decoded_bytes))
Related Questions in BASE64
- How to use custom font during html to pdf conversion?
- Converting img src data to octet-stream
- System.FormatException: Entry is not valid Base64 string
- GitLab "Upload a File" API returns "file is invalid" after POST
- Adding a reset button for my digital signature
- I have a problem with decoding from base64
- Facing decryption error while decrypting encrypted payload using RSA Cipher Algorithm for GST and E-Way Bill authentication
- Base 64 : Illegal base64 character 3 Exception
- Media Recorder API encoding audio/mp4 stream to base64 string
- React Native preview Base64 encoded files
- Decoding base64 img in react getting error
- Trouble with HMAC Signature Verification Between Go and PHP for Encrypted URL
- How to read a .bin file and display the extact content of it in a table cell?
- Unable to decrypt Zoom AppContext - InvalidTag Error
- I cannot get Gmail to Base64decode correctly
Related Questions in ESP32
- Watchdog Timer Reset on ESP32 using Webservers
- How to solve compiler error: no matching function for call to 'dmhFS::dmhFS()' in my case?
- trouble with creating a project for Pymakr in vscode
- I get error message "Invalid ESP-IDF" when I configure the ESP-IDF extension
- ESP32 Consequtive Interrupt WDT Timeout Exception
- Encountering Core panic'ed when trying to use FreeRTOS queue in esp32
- Some noise when attempting to produce sound wia external DAC for esp323
- How to correctly read POST REQUEST body on ESP32?
- Need the decoded data while from server esp32 send and Receiving in react native cli
- How to make sure only one client connect to the BLE server on ESP32?
- I'm Trying to Connect Internet with ESP32 using Cavlii C16Qs. but ESP32 is not Getting Internet Connectivity
- Wifi Csi Using TinyML in Esp32
- ESP32 device Isn't being powered by external power supply unless it has a serial port
- INMP441 audio data not correctly saved by flask server, why?
- How to use WiFi and Ethernet at same time?
Related Questions in MICROPYTHON
- trouble with creating a project for Pymakr in vscode
- Micropython: _thread module imported but not showing methods
- Using MAX 9814 PCM data to create a .WAV file
- X is not defined but x has been defined
- Does any wasm runtime has a support for micropython (For RPI_PICO board)
- Is there a way to read serial input and run multple functions while retaining memory?
- OSError: [Errno 1] EPERM connecting to WLAN on Raspberry Pi Pico W
- Printing an exception that works on Micropython/CircuitPython AND desktop python
- Buffersize to small
- MicroPython Socket sends strings without encoding
- How to extract access token from redirect URL without full libraries?
- Is utime.ticks_diff() safe to run in a ISR?
- How can I fix that my variable goes into the formatted string of my html code in python
- Typing a class decorator
- Problem in connecting esp32 to local MQTT broker
Related Questions in ADAFRUIT-CIRCUITPYTHON
- Ringing noise overpowering voice / Recording audio with Max 9814 microphone on Raspberry pi pico using ADC Pin / Circuitpython
- Example of BLE client using circuitpython on an esp32 s3
- Printing an exception that works on Micropython/CircuitPython AND desktop python
- Asyncio on CircuitPython doesn't runs two functions concurrently
- Raspberry Pi Zero 2 W automatically disconnects after editing and saving new code in the `code.py` file
- Running circuit python on one esp32 core and C++ on the other
- Circuitpython servo not rotating full 180 degrees with Raspberry Pi Pico
- simple Server using socketpool on a pico w with Circuitpython
- How can I successfully install and import the "adafruit_servokit" python library using Ubuntu?
- The issue about sending the second calling using `Adafruit_requests`
- ImportError: No module named setuptools on Raspbian OS
- Can't disable USB on QT Py CircuitPython
- How to disable Roll reading backwards from a bno055 sensor when it is out of the angle range?
- Getting abnormally high negative temperature even though rtd is at room temperature using adafruit_max31865
- Changing advertisement ID in adafruit_ble for Circuit Playground Bluefruit
Related Questions in SEEEDUINO
- Arduino board with StandardFirmata doesn't respond to C# client
- Seeeduino xiao assembly programming
- Run a program on XIAO SAMD21 + LoRa-E5 via serial with external power supply
- base64 library for circuitpython on SEEED Xiao ESP32-C3
- Logging Data to Onboard Flash Memory of Seeed XIAO BLE Sense
- Arduino error: 'I2C_MODE' was not declared in this scope
- How To Pass Functions To Class In C++?
- not compiling... NarrowBand Twillio T-Mobile
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Reffering to: https://learn.adafruit.com/circuitpython-totp-otp-2fa-authy-authenticator-friend/software
I found that I can use the defined base 32 decoding function to decode a given base32 encoded value: