Basic functions/libraries for ESP32 running MicroPython
Switch branches/tags
Nothing to show
Clone or download


Basic functions/libraries for ESP32/ESP8266 and WiPy2.0/3.0 running MicroPython.

More info:

Small FTP server


  • Passive mode only
  • A single data connection at a time
  • Data transfer is assumed to be in binary mode (ascii setting is ignored)
  • Operation blocks the thread
  • No authentication support


  • Changing directories (cd/CWD)
  • Directory listing (ls/LIST with no parameters)
  • File retrievals (get/RETR)
  • File uploads (put/STOR)

Get the epoch time from

Implements machine.RTC() with ntp_sync(), gmtime() and formatdate() -RFC 2822 date format- as functions

Encode a string using an MD5 algorithm.

>>> import md5
>>> md5.digest('foo')

Encode a string using an MD5 algorithm.

>>> from md5hash import md5
>>> m = md5()
>>> m.update('foo')
>>> m.hexdigest()

Simple AES cipher implementation in pure Python following PEP-272 API

import maes
import ubinascii

class AESCipher():
    def __init__(self, key): = 16
        self.key = key

    def encrypt(self, raw):
        raw = self._pad(raw)
        cipher =, maes.MODE_ECB)
        crypted_text = cipher.encrypt(raw)
        crypted_text_b64 = ubinascii.b2a_base64(crypted_text)
        return crypted_text_b64

    def decrypt(self, enc):
        enc = ubinascii.a2b_base64(enc)
        cipher =, maes.MODE_ECB)
        raw = cipher.decrypt(enc)
        return self._unpad(raw).decode('utf-8')

    def _pad(self, s):
        padnum = - len(s) %
        return s + padnum * chr(padnum).encode()

    def _unpad(dec):
        s = bytes(bytearray(dec))
        return s[:-ord(s[len(s)-1:])]

>>> key = b'0cc103aaf3df5dff'
>>> cypher = AESCipher(key)
>>> enc = cypher.encrypt(b'foo')
>>> print(enc)
>>> cypher.decrypt(enc)


Revision 0.3


Check files