====== Un serveur web / ftp pour ESP8266 ====== un ESP8266 , une micro SD et hop un serveur à 5 balles ;-) La première idée n'est pas de faire une simple page qui montre l'état de l'objet connecté , mais bien de faire un 'vrai' serveur web http 1 qui pourrait héberger un site statique voir un wiki sur une carte SD. Donc de pouvoir non pas poser des objets dans Internet( l'Internet des objets ...) mais de créer des zones et des serveurs internet nomades, qu'on pourrait laisser dans un arbre un certain temps, oublier quelque part ou donner à quelqu'un, comme on donne un livre, on donnerait accès à une bibliothèque localement. La deuxième idée est d'utiliser un protocole ftp a la place de l'http, cela simplifie grandement la mise en place au détriment de la présentation des pages elles même, on partagera des fichiers des listes de fichiers présents sur la SD, plutôt que de jolies pages... pistes lua : * http://lua-users.org/wiki/LuaWebserver * http://keplerproject.github.io/xavante/ pistes arduino-ide et donc en dur: www: * lighthttpd ? * [[http://www.acme.com/software/thttpd/|thttpd ]] * [[http://www.mathopd.org/|mathodpd ]] * [[http://monkey-project.com/|/monkey]] * http://www.ladyada.net/learn/arduino/ethfiles.html * https://github.com/ovidiucp/TinyWebServer ftp: * https://github.com/gallegojm/Arduino-Ftp-Server/tree/master/FtpServeur * http://forum.arduino.cc/index.php?PHPSESSID=iq2srfmd7r0krp3n9k03l1n8u6&topic=182382.60 Bonnepiste: L'IDE arduino 1.6.4 avec l'installation du support ESP8266 montre un serveur SD: SDWebServer ... tout ce qu'il faut pour commencer :-) ... ===== pour info : ===== WiFi(ESP8266WiFi library) This is mostly similar to WiFi shield library. Differences include: WiFi.mode(m): set mode to WIFI_AP, WIFI_STA, or WIFI_AP_STA. call WiFi.softAP(ssid) to set up an open network call WiFi.softAP(ssid, password) to set up a WPA2-PSK network (password should be at least 8 characters) WiFi.macAddress(mac) is for STA, WiFi.softAPmacAddress(mac) is for AP. WiFi.localIP() is for STA, WiFi.softAPIP() is for AP. WiFi.RSSI() doesn't work WiFi.printDiag(Serial); will print out some diagnostic info WiFiUDP class supports sending and receiving multicast packets on STA interface. When sending a multicast packet, replace udp.beginPacket(addr, port) with udp.beginPacketMulticast(addr, port, WiFi.localIP()). When listening to multicast packets, replace udp.begin(port) with udp.beginMulticast(WiFi.localIP(), multicast_ip_addr, port). You can use udp.destinationIP() to tell whether the packet received was sent to the multicast or unicast address. Also note that multicast doesn't work on softAP interface. WiFiServer, WiFiClient, and WiFiUDP behave mostly the same way as with WiFi shield library. Four samples are provided for this library. Connexion SD microSD direct sur la bête {{:esp8266:sd_connexion.jpeg?200|}} SD 9 x 1 CS 2 Data In 3 GND 4 3,3+ 5 CLK 6 GND 7 Data Out 8 x