Real time Litecoin Ticker (GDAX)


This is going to be a short one for my friends on /r/litecoin who asked for a tutorial after this post. So here it is.

There are many variants of the esp8266 micro controller with an oled, all of which will work for this application (possibly without any code tweaks) but I chose this one from ali express due to its compact size, and the fact that it was only $6.

Because this tutorial is aimed more at the good people of /r/litecoin I will try to be verbose because there is a good possibility this will be there first venture into embedded development.

For the rest of you, skim over most of this but pay attention to the platformio customization and proceed directly to the code.

Step the first – get platformio
Install platformio <- this guide is better then anything I could write, so please just follow that.

Step 2 – install base esp8266 support
open a command prompt or terminal and run the following command

pio platform install espressif8266

Step 3 – get the code
Download the code from github either in zip form or by cloning it

Step 4 – add new board support
Open the folder from github and open the wifikit8 folder,
copy the innards from wifikit8/platformio into the PLATFORMIO_HOME_DIR merging all the folders.

Open the PLATFORMIO_HOME_DIR/packages/framework-arduinoespressif8266/boards.txt file and append the contents of wifikit8/boards.txt

if you did this correctly running

pio boards wifiki8t

will return with

Platform: espressif8266
------------------------------------------------------------
ID                    MCU            Frequency  Flash   RAM    Name
------------------------------------------------------------
wifikit8              ESP8266        80Mhz     4096kB  80kB   Wifi Kit 8 (oled 128x32)

The only real difference between this board and the nodemcuv2 boards is the pin mapping, the i2c bus is on different pins

 SDA = 2;
 SCL = 14;
 D0   = 16;
 D1   = 5;
 D2   = 4;
 D3   = 0;
 D6   = 12;
 D7   = 13;
 D8   = 15;
 RX   = 3;
 TX   = 1;

Step 5 – upload the code
Due to being short on time, this code is pretty rough, yet functional, as a side effect of this being rough code I have not had time to bring in WifiManager to set up the wireless network as I usually would. I will leave this as an exercise to the reader, and I am accepting pull requests!

Open src/main.cpp from the github download and edit

const char *WIFI_NETWORK = "*****";
const char *WIFI_PASSWORD = "*****";

So that they contain your wifi network name and password

From the terminal run

pio run --target=upload

If it uploads successfully you should be done!
You might have to press the RST button on the bottom right a few times (not sure why)

Litecoin Tip Jar as requested LgKtLbpyQQmmnACTHyEk9SrLzPnLKMJZTZ

If there is any interest in purchasing one of these pre flashed and ready to go please let me know! It might take a bit because I’ll need to order more boards but I’ll 3d print a simple case for it to make it alittle more robust!

Notes
If you know how I can submit this board variation to platformIO please let me know, I have not been able find any info.

2 thoughts on “Real time Litecoin Ticker (GDAX)”

  1. Great work there. Really interesting. I want to ask if this particular board can display more than one line of text. I want the display the price of more than one coin. Do you know if it is possible to do this ?

  2. You can definitely fit multiple lines of text. You will have to make the font smaller. The oled is 128×32 pixels. Right now I have it hooked up to gdax so with alittle work you can get btc and eth easily enough.

Leave a Reply