Debugging ESP8266 units remotely using Jeelabs esp-link firmware…

December 6, 2018 | ESP8266 | By: Mark VandeWettering

I was hoping to be a little further on writing up and making video of my solar energy project, but a blown power steering pup in my Expedition left me stranded for a couple of hours on Tuesday night, and I’m still scrambling to get some of my intermediate goals up to date. But I did get some time to at least accomplish one of my goals for the week, and I thought I would share.

If you are “old school” like me (which is really just a nicer way to say “old”) you probably do a lot of your debugging with simple print statements. In the case of embedded systems, this are usually routed to a serial output, perhaps that is used only for that purpose. My solar satellite project is no exception: it spews a fair amount of informational data to its serial port as it goes about its business, mostly help me incrementally develop and test modules in the system.

But in the case of my solar project, I eventually want to deploy this system in a location where I won’t have any simple way to monitor the serial output. For a month, it sat on my patio, and being entirely powered by a small solar panel and battery setup, it didn’t seem like stringing a long serial cable out there was a good idea. I could of course rewrite the core of my system to include the ability to log serial data to a socket, and then listen for connections. But this adds a lot of complexity to my relatively simple application, and none of it is very interesting. I’ve also been thinking of experimenting with using other micro-controllers which may not have wireless capabilities of their own, and being able to debug (or reflash) those via wireless, and then perhaps removing the wireless logging once the system is working seemed valuable.

So, the solution would be to use a second separate wireless module that could monitor the controller’s serial port, and then do all the magic itself. And luckily, somebody has already done all the hard lifting, so there is already firmware out there to do it (and a lot more).

JeeLabs esp-link Wifi-Serial Bridge

For my test, I dug a second WEMOS D1 Mini module out of my pile, and flashed it using the directions for the 32Mbit module. I then configured it to use station mode, attached it to my home network, and then did the bare minimum set of connections: connected 5V and GND from the first module to the same on the esp-link module, and then connected RX/TX to TX/RX. And booted the system.

Worked like a charm. I could either use telnet or nc to connect directly to port 23 on the module, and you’ll be able to interact with the serial port on the target board. It also hosts a small webpage with an embedded terminal module (much like the Arduino Monitor from the Arduino IDE). This enables you to (for instance) toggle the reset on the target board (which I didn’t connect, but which could be enormously useful).

I’ve barely scratched the surface of the functionality provided by this software. It can be used (for instance) to provide WiFi services to microcontrollers without any WiFi hardware of their own, at a very inexpensive price. And of course I could choose to remove the module once I’m done with the need for debugging. Very versatile.

If any of this sounds good, check out their page.