This is a basic Arduino C++ demo application using a unique blockchain authenticated MQTT access to receive Solar.org blockchain events. This project is designed to run on any ESP32 microcontroller. Blockchain event packets are sent to the serial port as ASCII text for display on terminal program running on PC. Onboard LED is toggled at every blockchain event.
1. Create Testnet wallet using Desktop Wallet.
2. Request Testnet tokens using telegram bot.
4. Create a unique 8 character message and then sign the message using the desktop wallet.
#define MQTT_CLIENT_NAME "random or unique value"
#define MQTT_USERNAME "Your Solar Testnet wallet public key" // Insert your wallet's public key (not the address)
#define MQTT_PASSWORD "8 character message + Message Signature" // Sign any 8 character message to generate signature
//WiFi Credentials
#define WIFI_SSID "Your WiFi SSID"
#define WIFI_PASS "Your WiFi Password"
//Time Zone Configuration
int8_t TIME_ZONE = -7; //set timezone: Offset from UTC
int16_t DST = 3600; //To enable Daylight saving time set it to 3600. Otherwise, set it to 0.
- EspMQTTClient by Patrick Lapointe Version 1.13.3
- ArduinoJson by Benoit Blanchon Version 6.19.4
- PubSubClient by Nick O'Leary Version 2.8
You need to increase max packet size from 128 to 4096 via this line in \Arduino\libraries\PubSubClient\src\PubSubClient.h #define MQTT_MAX_PACKET_SIZE 4096 //default 128
I am using a Heltec Wireless Stick however any ESP32 board will work.
You should see WiFi / MQTT connection messages followed by blockchain events.