wifi keyboard

Piader meets ESP and events

Some time ago we made a WiFi keyboard on ESP 8266. Long time ago we made a Piader game. From their combined powers comes Piader controlled by WiFi keyboard 😀

We need to change Piader a little, to be precise, event listener and keyboard server needs to use JSON packet not string. Why ? Because wifi keyboard is using it.

Piader will also move from TCP to UDP and this allows us to use broadcast.

What about keyboard changes ? Yey! No changes!

Piader source code


NodeMCU, broadcast and an event

Goal for this post: program ESP to send event. We will broadcast an event packet into network and read it. But lets start from beginning. What is broadcast?
Broadcast is a method of transferring a message to all recipients simultaneously [Wikipedia].
Contrary to unicast when you send data to one and only one recipient. But how to send something everywhere? Broadcast address are IP one that ends with 255, for a base network broadcast address is
One important aspect is that broadcast use UDP not TCP.  In short words, TCP connect and provide reliability and UDP send packet and forget but is faster.

First we will write simple server and client application. Of course in Python 🙂