Support for esp8266

Hey, guys, I want to provide support for esp8266.
A typical esp8266 board is WeMos D1 WiFi UNO R3

If you are interested in the topic ,please post your thoughts.

1 Like

I am so excited to hear this news. As a beginner of simplefoc, I have tried several MCU ( Arduino mega, Arduino nano, ESP32, STM32F103C8T6).
Arduino-series MCU is not the best choice for simplefoc because of their low speed. ESP32 series are quite suited because of their low price and high process speed. However, the ADC accuracy of ADC is a little unsatisfactory.
Today I was unintentionally found the esp8266 WeMos D1 in Taobao, the same interfaces comparing with the Arduino Uno, which means it will be quietly easy to connect with simplefoc broad like Arduino Uno. It’s a very very painful thing for me to use ESP32 connect simplefoc drive broad. Besides, the processor speed of ESP8266 is quite fast comparing with the Arduino series MCU.

Hey @Axe and @Cabbage_White,

If you guys would be interested to contribute to the simplefoc and support the esp8266 that would be awesome :smiley:
At the moment we are not planning to support it, mostly due to the lack of time. But we would love to support you in any way necessary!

I found the ESP8266 only have one ADC interface, which means it cannot be used in the current sense detect, a very bad news. Maybe you have a good idea to solve this problem?
To be honest, the ESP32 is ideal for simplefoc controller (Low price and high process speed). Share you two very good open-source simplefoc project by using esp32 (;

Hey @Cabbage_White,

yep it seems so.

I dont really think esp8266 is the best possible solution for the simplefoc but I think it would be cool to have it supported. And to enable people to use it at least. I would not do the current sensing with this board but in voltage mode it seems perfectly capable of running one bldc or stepper motor.

ESP32 is the ideal controller I agree 100%. And I hope to spend much more time on this platform in the future.

OK so I’ve quickly gone through the esp8266 implementation of the arduino API
And maybe it will even work out of the box for BLDCDriver3PWM, StepperDriver2PWM and StepperDriver4PWM.

If someone can test it it would be great :smiley:

The only thing that you might need to add is the high-frequency pwm setting.
Call the analogWriteFreq(25000); //for 25khz somewhere after driver.init()

A post was split to a new topic: Can we use L6234 SENSE1/2 outputs for FOC and avoid using curent sensing amps

Hey Guys,

I’ve added a very simple untested initial support for the esp8266. I’ve made it to compile and with the info in the docs it should be working.
Basically you’d be able to use all drivers except 6pwm and no current sensing.

The support is in the dev branch:

Hi there @Antun_Skuric, I have an esp8266 I can attempt to try this out with! What do I have to do to attempt this with the dev branch?

Hi @cheppy44 ,

The post you’re replying to is quite old, and the esp8266 support is now part of the main library.
Just add SimpleFOC library in the normal way, and you should be good to go.

I tried to set it up the library just to read in SPI encoder values. After attempting to compile, it seems it error out. Did I do something wrong?

Hi, I am also working on it, to run simpleFOC on an ESP8266.
I did it on a ESP32 and played a lot with it. Works like a charm.

But for a project, I am stuck to an ESP8266. I got the same Error as @cheppy44. Seems like it just needs to be pinA, pinB, pinC, pinD ?

Other then that, I am trying to run it with the TMC6300 BOB which has 6 Control Pins. U H/L, V H/L, W H/L.

Is there any chance, I can make it run? I tried with 3PWM but connected all 6 as EN Pin etc. The Motor makes noises but doesn’t really work.

Hi, did you get it working? I think this problem has been fixed on our dev branch, and will be part of the next release of the library… in the meantime you can git clone the library from GitHub, or adapt the one file to fix the error.

I think I faced another problem in my setting.
I am using the TMC6300 BOB. I don’t think that I can run it in 3PWM or I didn’t figured it out.
As far as I understood, the ESP8266 support does not include 6pwm mode.

So If anyone knows about a BLDC Driver for small Motors (3-5V), let me know :smiley:
Or if someone knows how to run a TMC6300 in 3PWM Mode, that would be great!

no, unfortunately not.

No, you are right, this chip needs 6-PWM control…

How about a SimpleFOCMini? SimpleFOCMini | Arduino-FOC
It’s available in the SimpleFOC shop… :slight_smile: