Wiznet makers

iveth38

Published October 28, 2022 © Mozilla Public License 2.0 (MPL -2.0)

0 UCC

0 VAR

1 Contests

0 Followers

0 Following

Cryptoconcurrency wallet

The goal of the Crypto-Beacon is to provide a multi-purpose device that handles various task associated with cryptocurrency and blockchain.

COMPONENTS Hardware components

Raspberry Pi - Raspberry Pi Pico

x 1

Raspberry pi

Software Apps and online services

Raspberry Pi - Raspberry Pi OS

x 1

Raspbian


PROJECT DESCRIPTION

CryptoDreams - Hardware Wallet

Hardware components

Wanboard Pico Pi IMX6UL

Nextion NX3224K024

Jumper wires 

Software apps

google Android of Things

google Firebase

Nextion GUI

The Cryptoconcurrency wallet is a proof-of-concept prototype showcasing Android Things running on the very nice PICO-PI-IMX6UL. It uses a combination of built in java code as well as Firebase functions and real time databases to provide a custom cryptocurrency hardware wallet.

Dashboard Screen UI

Using the supplied code and google services the wallet can receive transactions using an API. We can simulate a device-to-device transfer by using Postman and crafting an API call to our Firebase function. The function stores the transaction and the amount into a Real-Time database. The CryptoWallet has a call-back that checks if there is a new item added to the database. When it detects the new transaction record, it displays the result on the screen for the user to acknowledge.

This is what the Firebase function looks like:

const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp(functions.config().firebase);
exports.addTransaction = functions.https.onRequest((req, res) => {
    const transaction = req.query.transaction;
    admin.database().ref('/new-transaction').push({ transaction: transaction }).then(snapshot => {
 var message = `${transaction} received`
        res.status(201).send( transaction );
    });
}); 
mDatabaseRef = FirebaseDatabase.getInstance().getReference().child("new-transaction"); 
mDatabaseRef.addChildEventListener(new ChildEventListener() { 
 @Override 
 public void onChildAdded(DataSnapshot dataSnapshot, String s) { 
        Log.d(TAG,"something added: " + s); 
 Log.d(TAG,"as a string: " + dataSnapshot.getValue().toString()); 
 String str = dataSnapshot.getValue().toString(); 
 //JSONObject jsonObj = new JSONObject(); 
       // jsonObj.getJSONArray() 
 try { 
            String result = str.substring(str.indexOf("=") + 1, str.indexOf("}")); 
//Change the UI 
 sendCommand("page 2"); 
 sendCommand("t1.txt=\"" +  result + "\""); 
 } catch (IOException e) { 
            Log.e(TAG, "Error", e); 
 } 
   } 
@Override 
 public void onChildChanged(DataSnapshot dataSnapshot, String s) { 
        Log.d(TAG,"something changed"); 
 } 
@Override 
 public void onChildRemoved(DataSnapshot dataSnapshot) { 
        Log.d(TAG,"something removed"); 
 } 
@Override 
 public void onChildMoved(DataSnapshot dataSnapshot, String s) { 
        Log.d(TAG,"something moved"); 
 } 
@Override 
 public void onCancelled(DatabaseError databaseError) { 
        Log.d(TAG,"something broke"); 
 } 
}); 
Postman to simulate a transaction

Some Java Code (processCommand function)

The User Interface was designed in Photoshop and then programmed onto the Nextion HMI display using the Nextion GUI Editor.

Different Screens From the UI

Supplied code showcases the ability of the wallet to respond to various touch events. During the application initialization, various callbacks are registered to the serial interface of the screen. This allows us to capture the events and parse the incoming data. Depending on the data received, a different function is called. You can lock the screen, initiate a balance refresh, and check on current market prices for various crypto currencies.

This project is built from the UART Loopback example in the Android Things example project. It provides a great starting point for interfacing with serial devices.

Areas to Expand On

The project is just the beginning. I plan to fully develop this to support many currencies and markets. A few items that need to be worked on include true cryptographic security, a web based portal or companion app that allows you to manage the device remotely. The functions need to be polished for cleanup and archival reasons. All-In-All, I feel that the Android Things platform running on the PICO-PI would make a great overall stack for something like a crypto hardware wallet.

code javascrip index.js

const functions = require('firebase-functions');
const admin = require('firebase-admin');

admin.initializeApp(functions.config().firebase);
exports.addTransaction = functions.https.onRequest((req, res) => {
    const transaction = req.query.transaction;
    admin.database().ref('/new-transaction').push({ transaction: transaction }).then(snapshot => {
        var message = `${transaction} received`
        res.status(201).send( transaction );
    });
});
// // Create and Deploy Your First Cloud Functions
// // https://firebase.google.com/docs/functions/write-firebase-functions
//
// exports.helloWorld = functions.https.onRequest((request, response) => {
//  response.send("Hello from Firebase!");
// });

 

Documents
  • PICO-PI-IMX6UL

    Wanboard

  • Wandboard PICO-PI-IMX6UL

    The Wandboard i.MX6 is a low power complete computer with high performance multimedia capabilities based around the NXP i.MX6 Cortex-A9 processor.

  • Code programming

    The Wandboard i.MX6 is a low power complete computer with high performance multimedia capabilities based around the NXP i.MX6 Cortex-A9 processor.

  • Code programming

    The Wandboard i.MX6 is a low power complete computer with high performance multimedia capabilities based around the NXP i.MX6 Cortex-A9 processor.

Comments Write

Similar projects you might like

PCB that provides power and connectivity for the Raspberry Pi Pico, including Ethernet capabilities compatible with the W5100S or W5500.

Multifunctional power and distribution board for Raspberry Pi Pico and Wiznet W5100S/W5500

Benjamin
  • 528

  • 0

This is a demonstration of two Wiznet W5500s running a micropython script that sets one unit as a server, and the other as a client, with a small data packet go

Pico Pi Wiznet W5500 Two-way comms via Ethernet with Micropython

scarlet
  • 487

  • 0

RaspberryPi Zero W, W5100S-EVB-Pico, AWS IoT Core, MQTT

LTE CATM1 Mini Router with W5100S-EVB-Pico

taylor
  • 405

  • 0

Implementing IoT remote device control on Raspberry Pi's RP2040 + W5500

Implementing IoT remote device control on Raspberry Pi's RP2040 + W5500

simons
  • 232

  • 0

With your voice, you can control light, temperature, and bed gradient!!

[Recuration] Smart Bed System Using webOS

josephsr
  • 195

  • 0

일부 제조업체는 LLM Steak Classifier AIOT Bot 으로 알려진 Pi 기반 AI 고기 요리 모니터를 만든 개발자 Simon처럼 맛볼 수 있는 Raspberry Pi 프로젝트 를 만드는 방법을 확실히 알고 있습니다. 이 프로젝트는 실제 센서와 함께 ChatGPT를 사용하

Raspberry Pi 프로젝트가 잘 완료되었습니다. AI를 사용하여 고기를 완벽하게 요리합니다.

simons
  • 125

  • 0

This basic GPIO input/output testing provides foundational knowledge for using the Raspberry Pi Pico in various electronics projects.

[Recuration] Using Raspberry Pi Pico(W5100S-EVB-Pico) ADC

Benjamin
  • 228

  • 0

Do not Miss the IoT Module by Wiznet with RP2040 and Ethernet

Do not Miss the IoT Module by Wiznet with RP2040 and Ethernet

simons
  • 109

  • 0