Is there a good esp8266 simulator software that can be used to automate testing? Is it possible to get code written on Arduino IDE to run on these simulators?
-
2I have made enough research before posting the question. I was not able to find any clear answer for this on the internet. None of my colleagues had a good answer for this. – ambassallo Dec 10 '19 at 09:26
2 Answers
I think that you could simulate esp8266 using the xtensa-esp8266 branch of OSLL/qemu-xtensa which you have to compile yourself.
Compiled binary can be called with the command:
qemu-system-xtensa -machine esp8266 -nographic -kernel <your-project>/sketch/app.out -S -s

- 38,276
- 70
- 174
- 242

- 91
- 1
-
1I am not sure how to do this. If someone in the community can check this out we can probably mark this as an answer for anybody who comes here with the same query. – ambassallo Jul 24 '20 at 08:36
-
@ambassallo I tried to compile this but got an error, so it may need someone to fix the code so that it compiles on more recent OS versions. You could always try compiling yourself to see if it works on your OS. Good luck. – Nick Bolton Jan 23 '23 at 11:45
-
@NickBolton the very reason I have not marked this as the answer. Thank you for trying. alfen Can you shed some light on it if you can. – ambassallo Jan 24 '23 at 12:05
-
1I might fork the repo and see if I can get it to build, but depends how deep the rabbit hole goes. – Nick Bolton Jan 24 '23 at 20:24
As of Jan 2023...
The docs for the RIOT OS (an IoT OS) explain how to compile and use an ESP8266 version of QEMU for Xtensa. The docs contain the compile instructions:
cd /my/source/dir
git clone https://github.com/gschorcht/qemu-xtensa
cd qemu-xtensa/
git checkout xtensa-esp8266
export QEMU=/path/to/esp/qemu
./configure --prefix=$QEMU --target-list=xtensa-softmmu --disable-werror
make
make install
Actually, the gschorcht/qemu-xtensa
repo (last updated 2018) is a fork of the original OSLL/qemu-xtensa
project, so you could use the original repo:
cd /my/source/dir
git clone https://github.com/OSLL/qemu-xtensa
cd qemu-xtensa/
git checkout xtensa-esp8266
export QEMU=/path/to/esp/qemu
./configure --prefix=$QEMU --target-list=xtensa-softmmu --disable-werror
make
make install
Unfortunately, that branch hasn't been updated since 2019 so it may not compile on very recent OS versions. For instance, I got an error: expected unqualified-id
error while trying to compile on macOS 12.14. So, someone probably needs to fix those compile errors.

- 38,276
- 70
- 174
- 242
-
If somebody can try this on linux please let us know. If this works give us details of the OS and version of OS where it worked. – ambassallo Jan 24 '23 at 12:07
-
2I succeeded in building the gschorcht clone on Linux Mint 20.2, kernel version 5.4.0-137 using the following configure command: `configure --disable-werror --target-list=xtensa-softmmu --python=python2.7 --prefix=$QEMU`. – ccrause Jan 28 '23 at 16:12