Javadoc link

I think Arduino is trying to do macro's with D1...D13 mappings.  The pin numbers are different from what is "usually used" as int values for pins.

Here are the mappings for the Esp8226 board

For mine LED which is usually pin 13 == 14 on my D1 board

                       8266 Series 12 GPIO Table
 IO index   ESP8266 pin  IO index ESP8266 pin
      0    GPIO_16      7    GPIO_13
      1    GPIO_05      8    GPIO_15
      2    GPIO_04      9    GPIO_03
      3    GPIO_00     10    GPIO_01
      4    GPIO_02     11    GPIO_09
      5    GPIO_14     12    GPIO_10
      6    GPIO_12    

 

Websockets would be fun - but this https://github.com/morrissinger/ESP8266-Websocket
Did not work for me ... with compiling error 
 

 

 

References :

Example code (from branch develop):
#file : Esp8266.py (github)
# Initiate the Esp8266-01
esp = runtime.start("esp","Esp8266_01")
oled = runtime.start("oled","OledSsd1306")
oled.attach(esp,"0","0x3C")
# Demo to show how to write images
# Images arrays are created using the LCDAssistance as described here:
# https://learn.adafruit.com/monochrome-oled-breakouts/arduino-library-and-examples
# and downloaded from here:
# http://en.radzio.dxp.pl/bitmap_converter/
#