The source for OneIoT can be found at https://github.com/lirwin3007/OneIoT
A series of development boards aimed at making IoT development a breeze!
To make the experience fit your profile, pick a username and tell us what interests you.
We found and based on your interests.
The source for OneIoT can be found at https://github.com/lirwin3007/OneIoT
After a fair bit of troubleshooting, I now have a major part of this project complete:
The ESP32 can now be programmed remotely from a web interface
I'm still working on the UI, but for now it's okay:
At the top is a code editor, with full syntax highlighting. Shown is a simple example of a capacitive touch sensor program for the ESP32
Once code has been written, the Upload button triggers the compilation of code to include a lightweight web server, connects to the ESP32 via WebREPL and transfers all the required files.
To test the code, the page also has a testing area where the user can pass in any values that the function requires, and get an output from the ESP32:
There are a few UI changes that need making to tidy things up a bit, and at the moment it struggles a bit knowing they type of any values a user gives in the test area, but I'm very happy with the progress that's being made
One thing that must be good for a successful IoT system is it's user interface. For OneIoT, I have chosen the google assistant.
The google assistant will sit on the central raspberry pi, listening out for the phrase 'OK Google'. When it hears this, it will be able to trigger a user defined action on any connected ESP32 device, or respond as the Google assistant normally would, for example, to answer a question that it is given.
I'll shortly be putting out instructions on how to install the assistant and manage the phrases that it responds to.
With a breakout assembled, I now have to install Micropython.
There's a great set of instruction here, but I found I needed to take some additional steps.
Below, I will outline what worked for me. I was working on Ubuntu with Python 3 installed.
Required:
Steps:
dmesg | grep tty
In my case, running this gave
[ 0.000000] console [tty0] enabled
[ 167.73492] usb 1-6: FTDI USB Serial Device converter now attached to ttyUSB0
So I can see that it is attached to ttyUSB0 from line 2
Then run the following, replacing 'ttyUSB0' with the port the previous step gave
sudo python3 esptool.py --port /dev/ttyUSB0 erase_flash
Finally, run the following, again replacing 'ttyUSB0' and the location of where you downloaded the .bin file ('esp32-201 ... 9.4.bin)
sudo python3 esptool.py --chip esp32 --port /dev/ttyUSB0 write_flash -z 0x1000 esp32-20180511-v1.9.4.bin
With this completed, I can now use that serial port to access micropython's REPL python prompt and run commands!
Today the ESP32 arrived, and I was surprised by how small it was! I was both pleasantly surprised by the small form factor, as well as horrified of what soldering I had ahead of me...
The ESP32 has 38 pads surrounding it, on 3 sides. It is far from breadboard friendly!
To make it more breadboard compatible, I created this breakout board:
It breaks out all 37 (One is NC) pads into a breadboard friendly format. The breakout sits nicely on a breadboard, and the top header can be used with female to male jumper cables.
This was by far the most fiddly bit of making I have done in a long time! I started by hot gluing the ESP32 to the centre of the board, then, with the headers seated in a breadboard I began the painful process of connecting each pad to it's corresponding pin.
Whilst it's not the neatest thing in the world, it works. Each pad is connected to a pin that plugs into a breadboard.
There are many languages that could be chosen for this project. It could be programmed in C, the Arduino variation of C etc...
However for this project, I chose MicroPython. The reason being that one of the main aims of this project is to make IoT easily accessible to makers, just as the Raspberry Pi made computing accessible and Arduino made microcontrollers accessible.
MicroPython is super simple to write, and is very powerful. Also, MicroPython is available on the ESP32, the microcontroller I have chosen to use for this project.
Quick update on that ESP32 I ordered - It hasn't arrived yet 😔, I assume the postal service has been really busy over the Easter weekend
In order to meet my first objective, I need a method of communicating with other devices on the network. There are a number of technologies that could allow this:
Given all of these, WiFi seems the best and most reliable. RF communication is prone to noise, whilst Bluetooth is more suited to a one to one relationship between master and slave.
WiFi allows for one device to act as an access point, with others connecting to that access point to allow communication to take place.
With all this in mind, the ESP32 looks like a good IC to use. It can act as a WiFi access point, or connect to another access point - exactly what is required.
As an extra bonus, it has Bluetooth built in - it'll be interesting to see if that becomes useful at a later point.
Finally, the entire IC is a microprocessor, negating the need for an external one such as an Arduino or raspberry Pi.
With this decided, I have purchased an ESP32 module - it should arrive in 3 days!
I thought it would be good to start by outlining the main aims of this project. That way I can have a clear objective of what I'm working towards.
This project can be summarised into 3 aims:
In terms of specific details of how the devices will connect, or what the devices will do to interact with the outside world, I have yet to decide. I want to approach this project with no preconceptions of what IoT means, and how it can be implemented.
Instructable coming soon!
Create an account to leave a comment. Already have an account? Log In.
Become a member to follow this project and never miss any updates