I bought an ESP IoT phat a while ago, soldered the header on and spent some time working with it. All was fine.
It then sat in a drawer for a while and I’ve just pulled it out again to try something new with it. However, now it doesn’t seem to work.
Running the minicom -b 115200 -o -D /dev/ttyAMA0 command from the Getting started guide brings up the text which says “Welcome to minicom 2.7”, a few details and then that special command key help will be shown using Ctrl-A Z, but no REPL appears even after hitting return several times. The terminal becomes unresponsive.
If I try to flash new firmware to it using the scripts in the Pimoroni/espiotphat/firmware directory the firmware LED flashes for about half a second, and then the LED on the ESP8266 itself flashes once. The terminal says “The chip is in write mode/ Erasing flash/ esptool.py v1.3/ Connecting…” and then just sits there (I’ve tried this with the mp, at and no firmware flash scripts, all with or without erasing the board first).
There isn’t any noticeable problem with the board, I’ve it plugged in to a Pi 3B running a fresh install of the latest NOOBS Raspbian, and nothing is connected to the GPIO pins on the phat. The metal can on the ESP8266 itself gets warm but not worryingly so. Everything else about the Pi seems to work fine. I’ve tried both the one-line curl install of the IoT phat library and the Pimoroni Dashboard version.
TLDR, the IoT phat doesn’t seem to respond to anything, so I’d appreciate any suggestions for reviving it.
UPDATE: On a whim I moved the same IoT phat and the same microSD from my Pi 3B to my old Pi 2B, and it works perfectly well on the 2B. Moving it back to the 3 gives the same issues as before. Are there any known reasons why the IoT phat works on the 2B but not the 3B?
OK, after hoking around for a while I found the issue. I noticed that the IoT Phat works fine on the 2B, Zero 1.2 and Zero 1.3 but not the 3B or Zero W. That made me think it was related to the on-board WiFi chip, and it seems that is correct: the main UART connection at ttyAMA0 is now used for the WiFi chip, so to connect using the 3B or Zero W you have to connect to ttyS0 as pointed out here.
Modifying the library scripts for flashing firmware to include this change means the scripts to reflash work just fine.
The UART switch is for Bluetooth communication, not WiFi. You can temporarily move Bluetooth functionality to UART1 by adding dtoverlay=pi3-miniuart-bt to your /boot/config.txt file, or disable it altogether with dtoverlay=pi3-disable-bt.
I’m surprised you could flash targetiing the mini-UART, as noted in the topic you link, it is not particularly suited for flashing firmware… granted it is not likely you would brick an ESP8266, I would expect mishaps. I certainly would recommend using UART0 for that purpose. YMMV.
You can temporarily move Bluetooth functionality to UART1 by adding dtoverlay=pi3-miniuart-bt to your /boot/config.txt file, or disable it altogether with dtoverlay=pi3-disable-bt.
Ah, good to know. When you say temporarily move the BT, would you expect issues if I kept it on UART1 permanently? I’d prefer to not have to move it every time I want to do something with the IoT phat.
I’m surprised you could flash targetiing the mini-UART
It worked without any issues and controlling the phat over the mini-UART was fine too, but maybe that was just luck. I’ll try UART1 when I get home from work.
I don’t use Bluetooth very often so I can’t tell you how cripping moving it to the mini-UART is… I suspect that apart from BT audio the performance loss is no big deal.
The problem of using the mini-UART for timing critical operation is that, as noted in the link you pasted, the baudrate is dictated by the CPU clock. So if your CPU is throtteld during flashing, and that can easily happen if your CPU is running a bit hot at that point, the process will fail.
… like I said, YMMV, you could flash firmware all day long over this baud-variable bus and never have any trouble. Or you might brick your next microprocessor. As Boris would say, you could crash out of the EU without a deal and you’d be fine… I’m rather less of a gambler than he is ;-)