ESP8266 how to (on custom board)


#1

I have many esp8266 custom boards, and would like to try zerynth on them. I’ve seen that it’s possible to use an nodemcu v2, which means esp8266 is supported, right? But is it possible to use a custom board, with another serial to usb adapter, or maybe just building an image that i can later flash by myself?
Thanks for the help
Daniele


#2

Hello @iH8c0ff33 

The esp8266 chip and architecture are supported. However a pinmap definition and a way to flash an esp8266 device are needed in order to add Zerynth support for it. Also, Usb serial adapters support is coming in the next update of Zerynth.

As for your question, you can get the VM binaries for nodemcu and try to use them on your modules (provided they features 4 MB of spi flash). If you search under zerynth/env/core/official/nest/nodemcu2 you can find a .vm file. It is a big json file with many fields, the important one is “bin”. It is an array with 3 long base64 strings: the first one is the eagle.flash.bin (goes to 0x00000), the second is 
eagle.irom0text.bin (goes to 0x20000) and the third is esp_init_data_default.bin (goes to 0x3fc000). This way you will have a working VM that thinks it is running on a NodeMcu2 with the following pinmap:

D0 = GPIO16
D1 = GPIO5
D2 = GPIO4
D3 = GPIO0
D5 = GPIO14
D6 = GPIO12
D7 = GPIO13
D8 = GPIO15
D9 = GPIO3

If you prefer, you can PM me the details of your modules and find a way to support them.


#3

Hi,

I have a nodemcu v2 board but I can not virtualized it, it is not recognized by the studio. May it be related to the usb serial (ch340 ?). Can you help me virtualise this board? If it can be usefull, I am working on linux.

Mike


#4
mike said:
Hi,

I have a nodemcu v2 board but I can not virtualized it, it is not recognized by the studio. May it be related to the usb serial (ch340 ?). Can you help me virtualise this board? If it can be usefull, I am working on linux.

Mike
yes, I also have a ch340g and it's not working, but you could succeed using linux probably.
edit the nodemcu2.py file (inside `~/Documents/Zerynth/env/core/official/boards/nodemcu2/ide/`) and change the last frozenset to `"1A86":frozenset(("7523",))`, where 1a86 is the vendor id and 7523 the product id (the should already be correct since I also own a ch340g). Then you may be able to get it working

#5

Thanks, I saw the other thread after. I tried, but with no luck, still not recgnized.