meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
esp8266:nodemcu [2015/09/22 16:26] niziakhome_automation:esp8266:nodemcu [2016/12/29 20:35] niziak
Line 28: Line 28:
  
   * Current API: [[https://github.com/nodemcu/nodemcu-firmware/wiki/nodemcu_api_en]]   * Current API: [[https://github.com/nodemcu/nodemcu-firmware/wiki/nodemcu_api_en]]
 +
 +===== Saving memory =====
 +  * Avoid upvalues for context passed between event callbacks, as its very difficulat to get a handle on memory leaks created by these. Only use globals for this usecase.
 +  * Nil globals once they are no longer needed so that they can be properly GCed.
 +  * Allocate resources and create closures on a just-in-time basis.
 +  * The cost of require or dofile is relatively small, so break your program into overlays one per event and use a small stub function as a callback to load each.
 +    * Use compiled .lc files and load using dofile().
  
 ===== Scan WiFi ===== ===== Scan WiFi =====
Line 51: Line 58:
 print (ow.reset(1)) -- print 1 if device found print (ow.reset(1)) -- print 1 if device found
 </code> </code>
 +
 +===== Resolving DNS =====
 +It is not so easy. It need socket instance which will be used only for one DNS request, then socket will be destroyed. Response is performed by callback.
 +There is sth about easier API: [[https://github.com/nodemcu/nodemcu-firmware/issues/189]]
  
 ===== Compile to byte code ===== ===== Compile to byte code =====
Line 62: Line 73:
   * [[http://techfreak.pl/bezprzewodowe-czujniki-temperatury-ds18b20-na-esp8266/]]   * [[http://techfreak.pl/bezprzewodowe-czujniki-temperatury-ds18b20-na-esp8266/]]
   * Control 2 GPIO from Web [[http://randomnerdtutorials.com/esp8266-web-server/]]   * Control 2 GPIO from Web [[http://randomnerdtutorials.com/esp8266-web-server/]]
-  * +  * Http server [[https://github.com/marcoskirsch/nodemcu-httpserver]] 
 +  * Remote update [[http://www.instructables.com/id/ESP8266-WiFi-File-Management/]] [[https://github.com/breagan/ESP8266_WiFi_File_Manager]]
  
-==== Free Cloud/Server services ====+===== Free Cloud/Server services =====
   * Thingspeak: [[http://thingspeak.com/]]   * Thingspeak: [[http://thingspeak.com/]]
   * Telit: [[http://www.telit.com/products-and-services/iot-platforms/iot-portal]]   * Telit: [[http://www.telit.com/products-and-services/iot-platforms/iot-portal]]
Line 72: Line 84:
 todo todo
   * https://www.google.com/search?q=ai+cloud+esp8266&ie=utf-8&oe=utf-8   * https://www.google.com/search?q=ai+cloud+esp8266&ie=utf-8&oe=utf-8
 +