wifi keyboard

NodeMCU WiFi keyboard update

With release of boilerplate v0.2.0 I updated WiFi keyboard. Changes are rather small, import module network_message and instead of manually creating table this is used:

data = network_message.prepareMessage()
data.event = event 

Get new code from GitHub.

Advertisements

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

(more…)

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 192.168.1.0/24 broadcast address is 192.168.1.255.
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 🙂

(more…)