Multipurpose USB Stick "EncroPi" is super compact and handy and it allows you to perform customized security to secure your data through symmetric, asymmetric encryption type also EncroPi is built for Real-time clock which can be used in maintaining accurate timekeeping when the main power to the device is interrupted.
EncroPi comes with a built-in Raspberry Pi RP2040 microcontroller With two fast cores, plenty of on-chip RAM, and a port of TensorFlow Lite, Dual ARM Cortex-M0+ @ 133MHz, Support for up to 16MB of off-chip Flash memory via dedicated QSPI bus.
EncroPi Official Page to learn more, let's talk about how to program EncroPi? don't worry I'll cover it for you, you don’t have to be a tech wiz to use ENcroPi. You can easily create custom encryption and a real-time clock, and more using simple programming, After the Kickstarter campaign ends SB Components the manufacturer behind the project will provide all these codes and the steps on how to use these codes. You can also customize code accordingly as EncroPi uses MicroPython & Circuitpython which is easy now a day to understand you can also find the learning page easily to get started with programming, till now let's get started with creating a Real-time clock on EncoPi
Intro - EncroPiEncroPi is compatible with multiple hardware single-board computers ( Raspberry Pi Board, Jetson Nano, etc), Windows, Mac, etc. so you don't have to worry about programming.
EncroPi Reviews- Introducing EncroPi - Explore Data Logging with Security Encryption & Real-time Clock
- EncroPi, a smart RP2040 Based Device with a variety of additional functions, has been introduced
- EncroPi - Create USB Encryption & Customize Encryption Algorithm with Real-time Data using @CircuitPython
Steps:
- Install Thonny on your system here we're using Raspberry Pi 400 Computer you can use any Single-board computer, Mac, or Windows PC
- Connecting EncroPi on Raspberry Pi 400 via USB as you can see in the image above.
- Installing Thonny you can download it from here
- Run the codes below on Thonny using micropython:
from machine import I2C
import time
import utime
from machine import Pin, UART,SPI
import time
import st7789
import vga1_8x16 as font1
import vga1_16x32 as font
import vga1_16x16 as font2
address = 0x68
register = 0x00
#sec min hour week day month year
CurrentTime = b'\x00\x50\x14\x05\x21\x06\x22' #00:00:10 friday 03/03/2022
week = ["Sun","Mon","Tues","Wed","Thur","Fri","Sat"];
bus = I2C(1) # i2c 1
spi = SPI(1, baudrate=40000000, sck=Pin(10), mosi=Pin(11))
tft = st7789.ST7789(spi,135,240,reset=Pin(12, Pin.OUT),cs=Pin(9, Pin.OUT),dc=Pin(8, Pin.OUT),backlight=Pin(13, Pin.OUT),rotation=1)
def PicoRTCSetTime():
bus.writeto_mem(int(address),int(register),CurrentTime)
def PicoRTCReadTime():
return bus.readfrom_mem(int(address),int(register),7);
def info():
tft.init()
utime.sleep(0.2)
tft.text(font,"RP2040 RTC", 15,20)
tft.fill_rect(15, 60, 210,10, st7789.RED)
tft.text(font,"Real Time", 15,70,st7789.YELLOW)
tft.text(font,"Clock", 15,100,st7789.YELLOW)
tft.fill_rect(15, 140, 210, 10, st7789.BLUE)
time.sleep(2)
tft.fill(0) #clear screen
info()
PicoRTCSetTime() #You can remove this line once time is set
while 1:
data = PicoRTCReadTime()
a = data[0]&0x7F #sec
b = data[1]&0x7F #min
c = data[2]&0x3F #hour
d = data[3]&0x07 #week
e = data[4]&0x3F #day
f = data[5]&0x1F #month
g = data[6]&0x3F #year
#dt = "20%x/%02x/%02x %02x:%02x:%02x %s" %(g,f,e,c,b,a,week[d-1])
t = "%02x:%02x:%02x %s" %(c,b,a,week[d-3])
d = "%02x/%02x/20%x"%(e,f,g)
print(t) #year,month,day,hour,min,sec,week
print(d)
tft.text(font,d, 15,20,st7789.WHITE)
tft.fill_rect(15, 60, 210,10, st7789.RED)
tft.text(font,t, 15,80,st7789.YELLOW)
time.sleep(1)
- You will get the output as you can see in the video below:
- Save these files on EncroPi renaming them to "main.py"
now every time you connect EncroPi to USB you'll get the current date & time as long as Coin cells work. : )
Enjoy!
Comments