-->
Page 1 of 2

Help request, viability of 'control system contained on bot'

PostPosted: Wed Aug 05, 2015 4:01 pm
by Tired2
Hi,

I've gotten to spend just a bit of time on my ESP8266 (NodeMCU Dev Kit)... I was able to load an http server, serve files, send GET request to turn on outputs, etc.

What led me to this platform is that I've been looking for a cheap solution to wirelessly control a small differential steering robot from a phone or browser, and I thought this chip could make a great all in one solution.

What I'm shooting for is a "no client installed software needed" solution where the user connects up to the wifi AP on the ESP (or optionally through the station mode connection), and can bring up the robot's web interface.

Then, the user gets virtual "sticks" in their browser to control the robot. I've seen examples of people doing similar things already, but they seem to always need an external client to send the data to the ESP.

I've just started looking into MQTT, and it seems like either that or web sockets or a combination of both are what I need, but I'm not yet sure how it all fits together. It seems like Phao might be close to what I want to serve up from the ESP, and use it to connect to the MQTT broker.

So my questions:

Does the ESP have enough horsepower and RAM to run a web server, and have a client connected via mqtt or sockets streaming updates, and simultaneously controlling a few motors (PWM) and LEDs? I would think so.

I've run into a message about only one server being allowed... is that a limitation of the SDK? Since HTTP and MQTT are both on TCP/IP, does that mean I can't run them both at once?

Can anyone point me in the right direction or give me some warnings / pitfalls as I'm getting going on this?

Thank you.

Re: Help request, viability of 'control system contained on

PostPosted: Fri Aug 07, 2015 7:58 am
by emvee
I believe you may need to use a ESP-12 which should support PWM on all of the pins. I'm assuming the client would be connecting from a touchscreen interface, if so I would try and use some javascript like this: http://learningthreejs.com/blog/2011/12 ... -joystick/

I haven't really spent alot of time using NodeMCU but have been having a lot of luck using the Arduino IDE.

Re: Help request, viability of 'control system contained on

PostPosted: Fri Aug 07, 2015 8:07 am
by GigAHerZ
I actually made a RC car, that serves a webpage, that has joystick mechanism built in javascript (custom written, but analogical to the virtualjoystick mentioned before) and motors are controlled through motor controller with 4 pins - 2 pins for pwm and 2 for direction. Together, i can control two motors exactly as i want to - forward, backward, speed and as the motor driver support, even hardstop.

I've read somewhere that while ESP8266 can produce PWM signal through any GPIO (except the 16), then it is only able to produce 3 simultaneous PWM signals. Keep that in mind and if needed, search for i2c PWM extenders. ;)

Re: Help request, viability of 'control system contained on

PostPosted: Fri Aug 07, 2015 9:18 am
by Tired2
Thanks for the responses.

I am aware of the 3xPWM limit, which is fine. One minor problem is that they can't run different frequencies, but that is not a huge deal. I'll be using 1 for a piezo speaker, and one for each motor. I've sourced a motor controller IC that takes PWM and a direction pin as you describe to only need one PWM per wheel.

GigAHerZ, do you have a link to the code or any additional information? Did you use NodeMCU or Ardunio, or C to get it all going?

Thanks.