How to use Firmata Builder (Wi-Fi) with ESP8266…
If you want to communicate with micro-controllers from a PC especially via Wi-Fi, Firmata is very interesting. And Firmata Builder makes things easier.
What is Firmata?
Firmata is a generic protocol for communicating with micro-controllers from software on a host computer. It is intended to work with any host computer software package.
Trying not to go off on a tangent, I really like the simplicity of Firmata. You just simply edit the script and run to instantly see the results. Great for remote control, robotics, etc.
But back to the subject at hand.
What you will need.
ESP8266 Development Board.
Windows 10 PC with internet connection.
Arduino IDE installed and working with the ESP8266.
Create a Firmata Builder script.
OK, what is going to happen is that the Firmata Builder will take all our input and make a ZIP file. This zip file will contain a single, ‘ino’ file, which you will compile and upload with Arduino-IDE to your ESP8266. This then makes the ESP8266 listen for commands sent via Wi-Fi from our Windows PC, for example, a Node.js script sending Johnny Five JS commands to make an LED blink.
So, lets do it..
Open your favourite Web Browser, navigate to:
NB: take note of the information about installing the latest version on Configurable Firmata into the Arduino-IDE.
And, as we are going to be setting up our device for Wi-Fi, note the comment about Wi-Fi being available.
Select & Configure your client.
First thing is to select and configure your client. I entered the following settings –
→ Connection type Wi-Fi
→ Board ESP8266
→ Security WPA
→ SSID Your Wi-Fi SSID (You can enter this now)
→ WPA passphrase Your Wi-Fi Password (Add this later in the Arduino IDE)
Leave the remainder as they are for now, you can investigate these when you are ready.
Just check all the boxes, and go to the next step.
All of these features are optional.
I suggest you leave them all unselected until you know you need them and how they affect the performance of Firmata.
Name Package, Build & Download.
Enter a name for your file, in this case I used ‘iotxfirmata’ ; Click → Build and Download. You will receive a file called iotxfirmata.zip (or whatever you named your file).
Create a Directory (say c:\iotxfirmata), unzip the .ino file to that directory.
Open the Arduino IDE; make sure you have the latest version of the Configurable Firmata library installed and your ESP8266 board is connected.
Now open the .ino file
Make sure you edit the wpa_passphrase
char ssid = “Your Wi-Fi SSID”;
char wpa_passphrase = “Your Wi-Fi Password”;
Uncomment (remove //) to enable debugging over Serial (9600 baud)
// #define SERIAL_DEBUG should be
Save your work, compile the code and upload.
Open the Serial Monitor, in the Arduino-IDE.
Make sure to set it for 9600 baud.
If all went well this is what you should see, remember you will see your ssid.
Note the IP Address, you will need that for scripting.
Should you not get this outcome, try leaving the Serial Monitor open. Then press the RST Button on your ESP8266 Development Board.
If it’s just not working it means something has gone screwy, and you need to find it (oh. what fun)… go back to the beginning and start again.
How to use Firmata Builder (Wi-Fi) with ESP8266
By AL McDivitt.
I hope this guide helps anyone who may need it.