How to find the MAC address using NodeMCU when connecting to WiFi?
I don't believe you have an Wiznet Ethernet module connected to your NodeMcu. Ethernet library is for the Wiznet chips for wired LAN. You want to use the WiFi of the NodeMcu. For that the esp8266 core has the ESP8266WiFi library. It has the same API as other WiFi libraries based on Arduino WiFi library. So you can modify the WiFi examples of the Arduino pubnub library. Only change #include &lt;WiFi101.h&gt; to #include &lt;ESP8266WiFi.h&gt;. (And remove #include &lt;SPI.h&gt;.)