Writing My First Driver
• Diego Hernández Herrera
This last semester I took a course called Internet of Things, which introduced us to coding for microcontrollers. We used ESP-8266 boards, the usual classroom sensors (temperature & humidity, photoresistance, etc…) and the standard Arduino IDE (code editor).
When prompted to think about ideas for our final project, I thought about how to involve my hobbies. I’ve found out that intertwining my academic projects with my passions is a great way of keeping me engaged. And, because hiking is one of the things I enjoy most, I decided to create a tracking device that I could take with me during my hikes.
It turned out to be harder than expected. For some reason, I couldn’t get any GPS library to work with my ESP board, and they didn’t provide a way to debug. So even finding out why my GPS module was not working was impossible. So after a couple of weeks without success, I decided to debug the issue manually and start peeking into the serial communication between the GPS module and the ESP board. That was the start of what ended being my first driver.


I had to learn about the NMEA protocol, about how to read the serial communications from a GPS module, how to parse the data, and how to think of strings in terms of an array of characters. About how to best modularize my logic into diferent files and how to design the data flow.
I even ended up ditching the Arduino IDE and figuring out how to configure the VS Code editor to flash microcontrollers. It was a lot of work, but in the end I managed to get it working.
I’m honestly proud of my code and the grit it took to make it happen. Plus, writing a set of classes to interact with a hardware module through serial communication technically means writing a driver. And that’s cool.
The code is availabe here on my GitHub.
Do you want to know more about C++ IoT