Git Product home page Git Product logo

iota_esp32_wallet's Introduction

This repo has been moved to iotaledger/esp32-client-sdk

IOTA ESP32 Wallet

This is an IOTA Wallet application using IOTA CClient library on ESP32 microcontroller.

Commands

System commands

  • help: Show help
  • version: Show version info
  • restart: Restart ESP32
  • free: Show remained heap size
  • stack: Show stack info
  • node_info: Show IOTA node info
  • node_info_set: Set IOTA node URL and port number

IOTA Client commands

  • seed: Show IOTA seed
  • seed_set: Set IOTA seed
  • balance: Get balance from given addresses
  • account: Get balances from current seed
  • send: Send valued or data transactions
  • transactions: Get transactions from a given address
  • gen_hash: Generate hash from a given length
  • get_addresses: Generate addresses from given index.
  • get_bundle: Get a bundle from a given transaction tail.
  • client_conf: Show current MWM, Depth, and Security level
  • client_conf_set: Set MWM, Depth, and Security level.

Block Diagram

Demonstration video

Requirements

ESP32 build system setup

Please follow documentations to setup your toolchain and development framework.

Linux:

Windows:

Notice: We use the ESP-IDF v4.0.1, make sure you clone the right branch of ESP-IDF

git clone -b v4.0.1 --recursive https://github.com/espressif/esp-idf.git
./install.sh
source ./export.sh

Update esp-idf from previous version

cd esp-idf
git fetch 
git checkout v4.0.1 -b v4.0.1
git submodule update --init --recursive
./install.sh
source ./export.sh

Now, you can test your develop environment via the hello_world project.

cd ~/esp
cp -r $IDF_PATH/examples/get-started/hello_world .
idf.py menuconfig
idf.py build
idf.py -p /dev/ttyUSB0 flash && idf.py -p /dev/ttyUSB0 monitor

The output would be something like:

I (0) cpu_start: App cpu up.
I (184) heap_init: Initializing. RAM available for dynamic allo
cation:
I (191) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (197) heap_init: At 3FFB2EF8 len 0002D108 (180 KiB): DRAM
I (204) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (210) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (216) heap_init: At 40089560 len 00016AA0 (90 KiB): IRAM
I (223) cpu_start: Pro cpu start user code
I (241) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
Hello world!
This is ESP32 chip with 2 CPU cores, WiFi/BT/BLE, silicon revision 1, 4MB external flash
Restarting in 10 seconds...
Restarting in 9 seconds...

You can press Ctrl + ] to exit the monitor and ready for the next setup.

Building and flashing Wallet application to ESP32

Step 1: cloning wallet repository

git clone --recursive https://github.com/oopsmonk/iota_esp32_wallet.git

Or (if you didn't put the --recursive command during clone)

git clone https://github.com/oopsmonk/iota_esp32_wallet.git
cd iota_esp32_wallet
git submodule update --init --recursive

Step 2: initializing components

The init.sh helps us to generate files and switch to the right branch for the components.

Linux:

cd iota_esp32_wallet
bash ./init.sh

Windows: TODO

Step 3: Wallet Configuration

In this step, you need to set up the WiFi, SNTP, IOTA node, and SEED.

idf.py menuconfig

# WiFi SSID & Password
[IOTA Wallet] -> [WiFi]

# SNTP Client
[IOTA Wallet] -> [SNTP]

# Default IOTA node
[IOTA Wallet] -> [IOTA Node]

# Default IOTA SEED 
[IOTA Wallet] -> [IOTA Node] -> () Seed

You can check configures in sdkconfig file.

Please make sure you assigned the seed(CONFIG_IOTA_SEED), Here is an example for your wallet configuration:

CONFIG_SNTP_SERVER="pool.ntp.org"
CONFIG_SNTP_TZ="CST-8" 
CONFIG_IOTA_SEED="YOURSEED9YOURSEED9YOURSEED9YOURSEED9YOURSEED9YOURSEED9YOURSEED9YOURSEED9YOURSEED9"
CONFIG_IOTA_NODE_DEPTH=3
CONFIG_IOTA_NODE_MWM=14
CONFIG_IRI_NODE_URL="nodes.iota.cafe"
CONFIG_IRI_NODE_PORT=443
CONFIG_IOTA_NODE_ENABLE_HTTPS=y
CONFIG_WIFI_SSID="MY_SSID"
CONFIG_WIFI_PASSWORD="MY_PWD"

The CONFIG_SNTP_TZ follows the POSIX Timezone string

Step 4: Build & flash

idf.py build
idf.py -p /dev/ttyUSB0 flash && idf.py -p /dev/ttyUSB0 monitor

Output:

I (5149) tcpip_adapter: sta ip: 192.168.11.149, mask: 255.255.255.0, gw: 192.168.11.1
I (5149) esp32_main: Connected to AP
I (5149) esp32_main: IOTA Node: nodes.thetangle.org, port: 443, HTTPS:True

I (5159) esp32_main: Initializing SNTP: pool.ntp.org, Timezone: CST-8
I (5169) esp32_main: Waiting for system time to be set... (1/10)
I (7179) esp32_main: Waiting for system time to be set... (2/10)
I (9179) esp32_main: The current date/time is: Mon Jun 15 17:25:08 2020
IOTA> 
IOTA> node_info
=== Node: nodes.thetangle.org:443 ===
appName IRI 
appVersion 1.8.6 
latestMilestone: HQKJKH9QFEILIVFRVKINXDURQHPRZGWEXCQXIDZURDCAHWHYIIVSGSXMVYAAVNAGQJDDIDSLMMPIA9999
latestMilestoneIndex 1445037 
latestSolidSubtangleMilestone: HQKJKH9QFEILIVFRVKINXDURQHPRZGWEXCQXIDZURDCAHWHYIIVSGSXMVYAAVNAGQJDDIDSLMMPIA9999
latestSolidSubtangleMilestoneIndex 1445037 
neighbors 24 
packetsQueueSize 0 
time 1592213225856 
tips 6153 
transactionsToRequest 0 
IOTA> 

help for more details.
Ctrl + ] to exit.

Troubleshooting

CONFIG_IOTA_SEED is not set or is invalid:

I (329) esp32_main: iota wallet system starting...
E (329) esp32_main: please set a valid seed in sdkconfig!
I (329) esp32_main: Restarting in 30 seconds...
I (1329) esp32_main: Restarting in 29 seconds...

CONFIG_MAIN_TASK_STACK_SIZE is too small, you need to enlarge it:

***ERROR*** A stack overflow in task main has been detected.
abort() was called at PC 0x4008af7c on core 0

iota_esp32_wallet's People

Contributors

junwei0117 avatar valerio-vaccaro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

iota_esp32_wallet's Issues

Error building

When I build: idf.py build I receive the following error:

../components/iota_cclient/entangled/utils/containers/hash/hash27_queue.c:10:10: fatal error: utils/containers/hash/hash{SIZE}_queue.h: No such file or directory
#include "utils/containers/hash/hash{SIZE}_queue.h"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
[38/823] Building C object esp-idf/http_parser/CMakeFiles/__idf_http_parser.dir/http_parser/http_parser.c.obj
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
โžœ iota_esp32_wallet git:(master) โœ—

How can I solve this?

Add ESP-IDF to submodule

Pro: easy to maintain the idf for different projects.
Con: need more storage for the source code.

Iota wallet build error

Hi Sam,

We are creating iota wallet application with a help form your blog.
During the process, we are facing issue while running "idf.py build" command.
Error screenshot attached for your reference.
please help us how to solve this issue
Screenshot from 2019-11-15 16-32-35

m5stack support

It would be great to have some tutorial to use the m5stack devices for iota transactions

argtable option data need to reset.

frist, we set a message on the transaction

IOTA> send ADDRESS -v=0 -t=thisaa -m=Hi,\ there.
sending 0 to ADDRESS
security 2, depth 3, MWM 9, tag [THISAA999999999999999999999] 
remainder [empty] 
message [Hi, there.] 

2nd, send again without the message parameter.

IOTA> send ADDRESS -v=0 -t=thisaa
sending 0 to ADDRESS
security 2, depth 3, MWM 9, tag [THISAA999999999999999999999] 
remainder [empty]
message [Hi, there.]

the message is not purged.

Update terminology

Since we now have Hornet nodes and we will soon have Bee nodes, I think the configuration fields should be renamed to IOTA node instead of IRI node.

I'm unsure whether this app supports Hornet nodes, which is why I haven't made the change.

If it does, I'm happy to do it ๐Ÿ˜„

Hornet API

We need support for wallet API.
I would love to help, just give me directions @oopsmonk .

I tried running on my ESP32-Ethernet-Kit.

IOTA> node_info
[iota_client_get_node_info:12]
[json_get_node_info_serialize_request:30]
[json_get_node_info_deserialize_response:100] <!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,user-scalable=no"><link href="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.0/Chart.min.js" rel="&#x201D;prefetch&#x201D;" as="script"><link href="/static/js/vivagraph353207b.min.js" rel="&#x201D;prefetch&#x201D;" as="script"><link rel="preload" href="/static/fonts/KFOlCnqEu92Fr1MmSU5fChc4AMP6lbBP.woff2" as="font" crossorigin><link rel="preload" href="/static/fonts/KFOlCnqEu92Fr1MmSU5fBBc4AMP6lQ.woff2" as="font" crossorigin><link rel="preload" href="/static/fonts/KFOmCnqEu92Fr1Mu7GxKKTU1Kvnz.woff2" as="font" crossorigin><link rel="preload" href="/static/fonts/KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2" as="font" crossorigin><link rel="stylesheet" href="/static/css/gfonts.css"><link rel="search" type="application/opensearchdescription+xml" title="TheTangle.org" href="https://thetangle.org/opensearch.xml"><title>IOTA Tangle Explorer and Statistics - TheTangle.org</title><link href="/static/css/select2.df09a7da.css" rel="prefetch"><link href="/static/js/select2.41222bba.js" rel="prefetch"><link href="/static/css/app.277cef55.css" rel="preload" as="style"><link href="/static/js/app.3d4d8b0c.js" rel="preload" as="script"><link href="/static/js/chunk-vendors.af876c22.js" rel="preload" as="script"><link href="/static/css/app.277cef55.css" rel="stylesheet"><meta property="og:type" content="website"><meta name="twitter:card" content="summary"><meta name="twitter:site" content="@thetangleorg"><meta property="og:description" content><meta name="twitter:description" content></head><body><div id="app"></div><script src="/static/js/chunk-vendors.af876c22.js"></script><script src="/static/js/app.3d4d8b0c.js"></script></body></html>
[json_get_node_info_deserialize_response:110] JSON parsing failed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.