Run the Vertices SDK on the ESP32 using the ESP-IDF build system.
The Espressif documentation is great to get started. We advise you to read it if you are not familiar with the ESP-IDF. If you've got any issue setting up the example, the solution can probably be found in the ESP-IDF documentation.
Sourcing export.sh will set important environment variables that will be used when compiling the example. Make sure to use the same terminal window afterwards.
Compile the example
Go to examples/esp32 and run:
idf.py build
Flash onto the Device
From examples/esp32, run:
idf.py [-p PORT] flash
Monitor
Print the logs:
$ idf.py [-p PORT] monitor
[...]
I (4676) example_connect: Got IPv6 event: Interface "example_connect: sta" address: fe80:0000:0000:0000:260a:c4ff:fe00:3a50, type: ESP_IP6_ADDR_IS_LINK_LOCAL
I (6176) esp_netif_handlers: example_connect: sta ip: 192.168.1.26, mask: 255.255.255.0, gw: 192.168.1.254
I (6176) example_connect: Got IPv4 event: Interface "example_connect: sta" address: 192.168.1.26
I (6186) example_connect: Connected to example_connect: sta
I (6186) example_connect: - IPv4 address: 192.168.1.26
I (6196) example_connect: - IPv6 address: fe80:0000:0000:0000:260a:c4ff:fe00:3a50, type: ESP_IP6_ADDR_IS_LINK_LOCAL
I (6206) vertices_example: Connected to AP, begin http example
I (6216) vertices_example: ๐ณ Alice's account E3PGTXKDOODVQ3E2ZB5PMJF2W3YOKIPUPLFDTESSP6562QE4GTLAKO4VXY
I (6226) http_esp: HTTP init: https://api.testnet.algoexplorer.io
I (9006) http_esp: HTTP GET Status = 200, content_length = 5
I (9276) http_esp: HTTP GET Status = 200, content_length = 232
I (9286) vertices_example: ๐ Running on testnet-v1.0 v.2.5.0
๐ข [/Users/cyril/Documents/work/vertices/c-vertices-sdk/src/account.c:42] ๐ Added account to wallet: #0
I (9486) http_esp: HTTP GET Status = 200, content_length = 27
I (9496) vertices_example: ๐ค 10.974142 Algos on Alice's account (E3PGTXKDOODVQ3E2ZB5PMJF2W3YOKIPUPLFDTESSP6562QE4GTLAKO4VXY)
๐ข [/Users/cyril/Documents/work/vertices/c-vertices-sdk/src/account.c:42] ๐ Added account to wallet: #1
I (9736) http_esp: HTTP GET Status = 200, content_length = 27
I (10536) http_esp: HTTP POST Status = 200, content_length = 64
๐ข [/Users/cyril/Documents/work/vertices/c-vertices-sdk/src/algorand/algorand_transaction.c:307] ๐งพ Transaction executed, ID: HRSIHDSQIZWXELQIORV2OX72TXQM2PZ7BMGVBK6WCZMEUZH4CWRQ
W (10556) vertices_example: Unhandled event: 2
I (10566) vertices_example: ๐ธ Alice sent 0.000100 algo to Bob
๐ข [/Users/cyril/Documents/work/vertices/c-vertices-sdk/src/account.c:89] ๐ Deleted account from wallet: #0
๐ข [/Users/cyril/Documents/work/vertices/c-vertices-sdk/src/account.c:89] ๐ Deleted account from wallet: #1