-->
Page 2 of 3

Re: Learning the espressif's API - where to start?

PostPosted: Tue Jan 06, 2015 4:38 am
by nicoverduin
ystrem wrote:What is the system in esp? It's some rtos? I never wrote for this type of microcontroller. Only 8bit atmega, so I know only main loop. Can someone help me where to begin. Thx
From a conceptview it is not that much different from the Arduino. The best way to start is to try both examples they give. And study them.
The ESP8266 environment basically consists of:
a) public available API which make the hardware available to the user
b) a folder "user" containing your source code
In the user folder the starting point is user_main.c. Which in concept is actually no different that on the Arduino which has a file main.c. There you don't see that file but all it contains in general is this:
Code: Select allint main(){
   setup();     // call the Arduino setup() function
   while(1) {
      loop();   // call the Arduino loop() function
   }
   return 0;   // this is never called
}

The biggest difference with the Arduino is that all source is availabel to the user including all basic hardware functions in source code. On the ESP this is in the form a a compiled library. If you do your best you will find that source also probably, but why bother. Right now it seems (based on your question) that you are still in the discovery phase. So start learning I'd say. Try to get the examples to work. Add for example your own AT command. Get the nag of it. And of course you will find all kinds of unfamiliar function calls. Trace them, see what they do. Even add your own comments. I have reverse engineerd many legacy systems this way just to find out what they were doing :mrgreen: No documentation, just source code.

A saying I use sometimes (a bit as a gimmick) "You can't learn s e x through the play boy"

Re: Learning the espressif's API - where to start?

PostPosted: Tue Jan 06, 2015 5:32 am
by ystrem
nicoverduin wrote:A saying I use sometimes (a bit as a gimmick) "You can't learn s e x through the play boy"

:)
Thanks, I tried and here is result https://github.com/ystrem/esp8266-node-mqtt

Re: Learning the espressif's API - where to start?

PostPosted: Tue Jan 06, 2015 6:11 am
by gwizz
Hey Ystrem- you went from never going beyond the arduino environment to publishing ESP code on github in 2 days?!! :shock:

Wow - that's impressive. And thanks for sharing!!

I hope this helps the effort to bind mqqt into lua - that would really make my month!

Re: Learning the espressif's API - where to start?

PostPosted: Tue Jan 06, 2015 6:23 am
by ystrem
gwizz wrote:Hey Ystrem- you went from never going beyond the arduino environment to publishing ESP code on github in 2 days?!! :shock:

Wow - that's impressive. And thanks for sharing!!

I hope this helps the effort to bind mqqt into lua - that would really make my month!


It took me week to figure out how to install SDK and then how to use makefiles. :)