Low cost wifi module ESP8266

1568101118

Comments

  • Heater.Heater. Posts: 21,213
    edited 2015-06-15 - 02:20:46
    Amazing. WIFI and all that processing and memory in a tiny module for 5 quid that could be glued to the top of a DIP Propeller.
    http://www.ebay.com/itm/ESP8266-ESP-12E-WIFI-Transceiver-Wireless-Module-NODEMCU-LUA-PRE-INSTALLED-/171807517162?pt=LH_DefaultDomain_3&hash=item280086a9ea
    Complete with latest nodemcu pre-installed.

    All we need is for some clever soul to write a Prop loader in Lua so that we can have a wirelessly programmable Propeller!
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2015-06-15 - 06:58:33
    @heater, that looks interesting.

    Looks like there is an ADC pin on the board. Ok, something really simple - measure one voltage and upload it somewhere on the internet? Xively or anywhere really. Once you have real world data on the internet, then you can manipulate it, other nodes can read it etc.

    Right now I have an arduino reading a voltage and talking to a usb to serial port, talking to a laptop talking to the internet. It crashes once a week and I have no idea why. There has *got* to be a cheaper way that uses less power - you might have just found it!

    Oh, yes, a wirelessly programmable propeller. Hmm - need to go back to the original source code in the obex from ?2006 which has the details of how the downloader protocol works.
    Answers: 1) A quadcopter. 2) Very high. 3) The internet. 4) A lot. 5) No.
  • MJBMJB Posts: 1,119
    edited 2015-06-15 - 08:13:40
    Dr_Acula wrote: »
    @heater, that looks interesting.

    Looks like there is an ADC pin on the board.
    In addition you can measure the supply voltage - great to know when the battery gets empty.
  • Heater.Heater. Posts: 21,213
    edited 2015-06-15 - 08:23:23
    Dr_A,

    If you are into the Prop Loader in Lua challenge everything you need to know about the protocol is in this C file https://github.com/ZiCog/pi-propeller-load/blob/master/src/PLoadLib.c and it's associated header file.
  • TorTor Posts: 1,981
    edited 2015-06-15 - 08:54:33
    So my old esp-12 modules are already obsolete? But I only just got them..! :)
    I should be able to network my Altair Clone with the old version anyway I hope.
  • yetiyeti Posts: 587
    edited 2015-06-15 - 09:37:36
    ThingSpeak?
    Seems to be easy... I'm 100% new to this topic and after some searching for NodeMCU and ThingSpeak and some minutes of shameless ctrl-c and ctrl-v from https://github.com/ok1cdj/ESP8266-LUA:

    This fragment assumes the node already having WiFi up and running...
    tmr.alarm(0,600000,1,
      function()
        conn=net.createConnection(net.TCP,0)
        conn:on("receive",function(conn,str) print(str) end)
        conn:connect(80,'184.106.153.149') -- api.thingspeak.com
        conn:send(
          "GET /update?key=###ThingSpeakKey###"..string.format("&field1=%d&field2=%d&field3=%d&field4=%d&ignore=%d",tmr.now(),node.heap(),file.fsinfo()).." HTTP/1.1\r\nHost: api.thingspeak.com\r\nAccept: */*\r\n\r\n")
        conn:on("sent",function(conn) print("Closing connection") conn:close() end)
        conn:on("disconnection",function(conn) print("Got disconnection...") end)
      end
    )
    
    I tried to keep this compact and not to waste space...

    Watch my brave Lua-WiFi-Minion's uptime, heap and filesystem info at: https://thingspeak.com/channels/42511

    Ok... he will not be connected permanently...

    ...and I definitely need to learn more Lua... ;-)
    ◁ propeller-wiki ▷ ◁ FastSpin ▷ ◁ Help Spin at RosettaCode.org ▷ ◁ No Source – No Go! ▷ ◁ DK-E ▷ ◁ :-D ▷ ◁ Stay OmmmmmmPtimistic! ▷ ◁ Why Asimov's Laws of Robotics Don't Work ▷ ◁ DNA is a four letter word. ▷ ◁ Stop slavery! Free all mitochondria! ▷
  • Bill HenningBill Henning Posts: 6,445
    edited 2015-06-16 - 08:11:11
    My ESP-12e modules arrived Friday! This weekend I installed the SDK, I have to wire up an ESP-01 prototyping board, with a TTL-USB adapter (or PropPlug) and load Lua.

    I am still waiting for:

    - ESP-12 style 2mm-2.54mm dip adapter pcb's I ordered.... I hope they arrive soon.
    - some ESP-07's, the external antennas I ordered for them have already arrived :)

    These little modules look like a LOT of fun.
    www.mikronauts.com / E-mail: mikronauts _at_ gmail _dot_ com / @Mikronauts on Twitter
    RoboPi: The most advanced Robot controller for the Raspberry Pi (Propeller based)
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2015-06-16 - 16:52:16
    Weakened just now and bought one of the larger esp8266 modules with a USB socket and lots of I/O pins.
    Answers: 1) A quadcopter. 2) Very high. 3) The internet. 4) A lot. 5) No.
  • xanaduxanadu Posts: 3,282
    edited 2015-06-16 - 17:18:34
    Dr_Acula wrote: »
    Weakened just now and bought one of the larger esp8266 modules with a USB socket and lots of I/O pins.

    The best way to develop is on the larger board, save the smaller ones for applications. Unless you happen to use all of that GPIO, then you'll need it!
  • yetiyeti Posts: 587
    edited 2015-06-17 - 00:15:32
    Dr_Acula wrote: »
    Weakened just now and bought one of the larger esp8266 modules with a USB socket and lots of I/O pins.
    I've had some ESP-01, -02, -05 and Olimex-ish 8266ers on my table for months but the real fun started when I got the 1st NodeMCU-Dev-Board (version 0.9)...
    The only drawback: There's only one UART and it is needed for the USB connection...

    But for getting started, these Minions (I got the yellow flavour of these boards) are great!

    I'm trying to get used to working over Telnet with NodeMCU and when I feel safe enough with it, I'll try to connect an ESP-07/-12/-12e directly to a Propeller...
    (yeti@aurora:1)/home/tmp/nodemcu$ telnet nodemcu0
    Trying 192.168.2.105...
    Connected to nodemcu0.
    Escape character is '^]'.
    Welcome to NodeMcu world.
    stdin:1: unexpected symbol near '
    > -- this error does not show when using "nc nodemcu 23" instead of telnet
    > =node.heap()
    14920
    > _
    

    ...or...
    (yeti@aurora:4)/home/tmp/nodemcu$ nc nodemcu0 23
    Welcome to NodeMcu world.
    
    > for n,s in pairs(file.list()) do print(string.format("%7d %s",s,n)) end
         88 init.lua
       1012 thingspeak.lc
        369 ircclient.lua
        228 init-sta.lc
        300 telnetd.lua
        128 init.lc
        652 ircclient.lc
        590 thingspeak.lua
        680 telnetd.lc
         97 init-sta.lua
    > _
    

    This is the Minion which is connected to https://thingspeak.com/channels/42511 and I'm telnetting to it while it is doing that self-monitoring...

    Another thing on my ever growing to do list is merging web and telnet access because NodeMCU does not allow two servers at once... but 1st some more Lua practice is definitely needed.

    http://www.esp8266.com/wiki/doku.php?id=nodemcu-unofficial-faq has some hints on making "stuff" loadable/loaded on demand... this seems the way to go...

    Lots of fun, lots of things to learn... that's the way the world is meant to be... \o/
    ◁ propeller-wiki ▷ ◁ FastSpin ▷ ◁ Help Spin at RosettaCode.org ▷ ◁ No Source – No Go! ▷ ◁ DK-E ▷ ◁ :-D ▷ ◁ Stay OmmmmmmPtimistic! ▷ ◁ Why Asimov's Laws of Robotics Don't Work ▷ ◁ DNA is a four letter word. ▷ ◁ Stop slavery! Free all mitochondria! ▷
  • MJBMJB Posts: 1,119
    edited 2015-06-17 - 02:00:38
    yeti wrote: »
    But for getting started, these Minions (I got the yellow flavour of these boards) are great!
    would love to see a dev board with the 12e (all pins exposed) + USB powered + uSD card slot + stacking headers



    !!! please adapt a habit to change your post titles to reflect the content - makes it much better when searching / browsing !!!
  • yetiyeti Posts: 587
    edited 2015-06-17 - 05:09:07
    MJB wrote: »
    would love to see a dev board with the 12e (all pins exposed) + USB powered + uSD card slot + stacking headers
    http://www.electrodragon.com/product/nodemcu-lua-amica-r2-esp8266-wifi-board are using the ESP-12e and instead of stacking shields above these boards, you could place them below... so you already are halfway there...
    ◁ propeller-wiki ▷ ◁ FastSpin ▷ ◁ Help Spin at RosettaCode.org ▷ ◁ No Source – No Go! ▷ ◁ DK-E ▷ ◁ :-D ▷ ◁ Stay OmmmmmmPtimistic! ▷ ◁ Why Asimov's Laws of Robotics Don't Work ▷ ◁ DNA is a four letter word. ▷ ◁ Stop slavery! Free all mitochondria! ▷
  • Clock LoopClock Loop Posts: 1,603
    edited 2015-08-08 - 04:10:54
    This post i messed up on and couldn't delete it so i....

    voted it down.
    1.Silicon gel filled square. <-2.Sonics(ultra even). 3.Lazers. 4.?
    https://hackaday.io/project/162734-a-trillion-year-clock
    54 propeller chips connected, One to rule them all.
    https://forums.parallax.com/discussion/127983/55-parallax-propeller-s-parallells-processing-of-permanent-perturbations/p1
    Seriously contemplating removing ALL my content from the net completely, FREEDOM OF SPEECH IS DEAD.
  • Clock LoopClock Loop Posts: 1,603
    edited 2018-12-06 - 13:57:16
    Dealing with GPIO15 and booting.

    https://github.com/esp8266/esp8266-wiki/wiki/Boot-Process
    ESP Boot Modes
    
    The Espressif code can boot in different modes, selected on power-up based on GPIO pin levels. (MTDO is equivalent to GPIO15).
    MTDO 	GPIO0 	GPIO2 	Mode 	Description
    L 	L 	H 	UART 	Download code from UART
    L 	H 	H 	Flash 	Boot from SPI Flash
    H 	x 	x 	SDIO 	Boot from SD-card
    
    In the bootup message 'boot mode:(x,y)' three low bits of x are {MTDO, GPIO0, GPIO2}.
    


    To flash a ESP-04
    Put your ESP-04 into programming mode by applying power while GPIO is held low with a 1k resistor.
    GPIO15 must be tied low for both normal operation and programming. (I use a 1k resistor)
    CH_PD must also be tied high, again I use a 1k resistor.
    YOU CAN USE A PROP-PLUG for TX-RX-GND (instead of the CH34OCG)
    https://www.parallax.com/product/32201
    32201b.png?itok=SzAXTSlH

    wirings.png

    No antenna is needed if you are within 10feet of your wifi.
    Reset doesn’t need to get wired if you just power cycle the unit after making GPIO0 low for programming.
    GPIO0 can be allowed high after the unit has booted (1second or so)
    So I wire a momentary button to reset.
    And another button to GPIO0, this allows me to hold the GPIO0 button down while pressing reset.
    This puts the unit into programming mode once reset button is released while still holding the GPIO0 button on (low)
    If you have a LED wired to the units GPIO13, the LED will be lit DIM while IN programming mode.
    In regular booting, GPIO13 led is not on, unless your program turns it on.


    This link shows you how to flash the esp.
    https://www.allaboutcircuits.com/projects/flashing-the-ESP-01-firmware-to-SDK-v2.0.0-is-easier-now/
    Or you can flash with the parallax code.
    https://forums.parallax.com/discussion/comment/1453097/#Comment_1453097

    You will see the flasher either start to upload data, or give you a com port error.
    Make sure you configure flasher for the right serial port.
    You can use a standard FTDI usb com port adapter, TX and RX and ground are the only things needed.
    DO NOT power this unit using the FTDI usb power line, people have had problems with the usb hub providing enough current.
    THIS UNIT IS 3.3v ONLY. DO NOT CONNECT ANY 5v DEVICE TO IT. Use a 1A 3.3v power supply. (it seems the TX line of a Ftdi device is 5v, perhaps you should use 2k resistor in series?.)


    This is the microcenter.com device ESP04 $6.95
    a.k.a. ai-thinker.com
    esp8266-04_pinout_big.jpg

    esp04.png

    ESP8266_Schematic.jpg


    This one as no antenna, smt board without dip spacing, no reset pin or gpio16 side pads.

    ***EVERYONE WHO HAS A ESP8266 would benefit from a full .bin flash, due to the updating of internal wifi code that only gets updated with this bin file complied from the sources in linux ( freely available)
    I did some things... here...

    You can also flash the esp to ParallaxESP firmware now. (Recommended 2018)
    https://forums.parallax.com/discussion/comment/1452980/#Comment_1452980

    OLD INFO!!!!!(PRE ParallaxESP )

    The sketch file, /discussion/download/114963/WebSvrHTML.zip
    https://www.allaboutcircuits.com/projects/flashing-the-ESP-01-firmware-to-SDK-v2.0.0-is-easier-now/
    (the newer versions break code due to needing a larger flash chip size)(larger than 512k)
    I don't know if 2.0 breaks 512k chips, but all the older version flash file links are gone.
    (this code dumps info about your mem chip out the serial port, while running webserver to switch led using web browser.)

    I found that running the latest bin file(https://www.allaboutcircuits.com/projects/flashing-the-ESP-01-firmware-to-SDK-v2.0.0-is-easier-now/) with the above code heavily resolves ESP timeout problems and crashes that the above code caused in older firmware.
    So heres more info and how you can test if your old firmware is an issue.

    Attached is the .ino code to program the esp using sketch once you properly install the board files for sketch(do that here) http://learn.adafruit.com/downloads/pdf/adafruit-huzzah-esp8266-breakout.pdf

    Once you update the firmware with the latest, you can then reprogram the unit using sketch.
    IF you program using sketch, the AT command interface is wiped. You will need to reprogram the firmware to get it back. The sketch program doesn’t overwrite all the code in this chip, only the main program code, other code that runs the wifi stack is untouched by the sketch upload. Those firmware areas are only updated by the bin files from the ESP-8266 manufacturers SDK.

    ESP8266 IC internals
    ESP8266-internals.jpg

    Technology is exponential.

    OMG look at this image of the internals sOOOOPER HI RES!
    http://s.zeptobars.ru/ESP8266-HD.jpg
    #include <ESP8266WiFi.h>
    #include <ESP8266WebServer.h>
     
    const char* ssid = "........";
    const char* password = ".......";
    
    // This is a png file (ledoff.png)
    const char imageoff[] = {
      0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00, 0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x08, 0x06, 0x00, 0x00, 0x00, 0x73, 0x7A, 0x7A,
      0xF4, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, 0x42, 0x00, 0xAE, 0xCE, 0x1C, 0xE9, 0x00, 0x00, 0x00, 0x04, 0x67, 0x41, 0x4D, 0x41, 0x00, 0x00, 0xB1, 0x8F, 0x0B, 0xFC, 0x61, 0x05, 0x00, 0x00,
      0x00, 0x20, 0x63, 0x48, 0x52, 0x4D, 0x00, 0x00, 0x7A, 0x26, 0x00, 0x00, 0x80, 0x84, 0x00, 0x00, 0xFA, 0x00, 0x00, 0x00, 0x80, 0xE8, 0x00, 0x00, 0x75, 0x30, 0x00, 0x00, 0xEA, 0x60, 0x00, 0x00,
      0x3A, 0x98, 0x00, 0x00, 0x17, 0x70, 0x9C, 0xBA, 0x51, 0x3C, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0E, 0xC4, 0x00, 0x00, 0x0E, 0xC4, 0x01, 0x95, 0x2B, 0x0E, 0x1B, 0x00,
      0x00, 0x00, 0x18, 0x74, 0x45, 0x58, 0x74, 0x53, 0x6F, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x00, 0x50, 0x61, 0x69, 0x6E, 0x74, 0x2E, 0x4E, 0x45, 0x54, 0x20, 0x76, 0x33, 0x2E, 0x33, 0x36, 0xA9,
      0xE7, 0xE2, 0x25, 0x00, 0x00, 0x00, 0xA5, 0x49, 0x44, 0x41, 0x54, 0x58, 0x47, 0xDD, 0x94, 0x59, 0x0A, 0x80, 0x30, 0x0C, 0x05, 0x53, 0xEF, 0x7F, 0xE7, 0x6A, 0xC4, 0x07, 0x2E, 0xC4, 0xA4, 0xD0,
      0xF2, 0x9A, 0x0E, 0x88, 0x3F, 0x2E, 0x9D, 0xE9, 0x52, 0x44, 0xA4, 0x1E, 0x17, 0x8D, 0xED, 0xBA, 0xD3, 0x18, 0x56, 0xA0, 0xD6, 0xE7, 0x67, 0x4B, 0xD1, 0x5F, 0x7D, 0xA1, 0x17, 0x18, 0x36, 0x00,
      0x35, 0xB6, 0xAC, 0xEF, 0xAC, 0xB7, 0x06, 0x30, 0xF7, 0x11, 0x7B, 0x65, 0x9D, 0x02, 0x96, 0xB9, 0xB7, 0x1B, 0xD6, 0x3D, 0x07, 0xDE, 0x58, 0x85, 0xE6, 0x2F, 0xE0, 0xAD, 0x6A, 0x6F, 0xEE, 0xAD,
      0xF7, 0x00, 0xBD, 0x40, 0x78, 0x00, 0x6A, 0x04, 0xAB, 0x3F, 0xF0, 0x9C, 0x9A, 0x7B, 0xF6, 0x4A, 0x9E, 0x02, 0xC0, 0x2B, 0x11, 0x35, 0x07, 0xF9, 0x0A, 0x00, 0xAF, 0x44, 0x14, 0x7A, 0x01, 0x9D,
      0xAC, 0x53, 0xA3, 0x87, 0x4D, 0x0B, 0x58, 0x27, 0xF3, 0x14, 0xB0, 0x88, 0x96, 0x69, 0x59, 0xF9, 0x77, 0xF2, 0xEE, 0x82, 0xD6, 0xFD, 0x6E, 0x91, 0xAF, 0x40, 0x2F, 0x73, 0x90, 0xA7, 0x40, 0x6F,
      0x73, 0x40, 0x2F, 0xE0, 0x9E, 0x03, 0xA3, 0x21, 0x17, 0x10, 0xD9, 0x01, 0x9C, 0xED, 0x3F, 0x3B, 0x51, 0x3E, 0xBA, 0x9B, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60, 0x82
      };
    
    // This is a png file (ledon.png)
    const char imageon[] = {
      0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00, 0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x08, 0x06, 0x00, 0x00, 0x00, 0x73, 0x7A, 0x7A,
      0xF4, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, 0x42, 0x00, 0xAE, 0xCE, 0x1C, 0xE9, 0x00, 0x00, 0x00, 0x04, 0x67, 0x41, 0x4D, 0x41, 0x00, 0x00, 0xB1, 0x8F, 0x0B, 0xFC, 0x61, 0x05, 0x00, 0x00,
      0x00, 0x20, 0x63, 0x48, 0x52, 0x4D, 0x00, 0x00, 0x7A, 0x26, 0x00, 0x00, 0x80, 0x84, 0x00, 0x00, 0xFA, 0x00, 0x00, 0x00, 0x80, 0xE8, 0x00, 0x00, 0x75, 0x30, 0x00, 0x00, 0xEA, 0x60, 0x00, 0x00,
      0x3A, 0x98, 0x00, 0x00, 0x17, 0x70, 0x9C, 0xBA, 0x51, 0x3C, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0E, 0xC4, 0x00, 0x00, 0x0E, 0xC4, 0x01, 0x95, 0x2B, 0x0E, 0x1B, 0x00,
      0x00, 0x00, 0x18, 0x74, 0x45, 0x58, 0x74, 0x53, 0x6F, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x00, 0x50, 0x61, 0x69, 0x6E, 0x74, 0x2E, 0x4E, 0x45, 0x54, 0x20, 0x76, 0x33, 0x2E, 0x33, 0x36, 0xA9,
      0xE7, 0xE2, 0x25, 0x00, 0x00, 0x00, 0xAA, 0x49, 0x44, 0x41, 0x54, 0x58, 0x47, 0xE5, 0x94, 0x6D, 0x0A, 0x80, 0x20, 0x0C, 0x86, 0x67, 0x47, 0xE9, 0x3C, 0x41, 0x67, 0x0D, 0x3A, 0x4F, 0x57, 0xB1,
      0x86, 0x0E, 0x6C, 0x31, 0xFC, 0x40, 0x99, 0xDA, 0x03, 0xA1, 0xA0, 0x3F, 0x7C, 0x9F, 0xB6, 0x19, 0x00, 0xB0, 0xCF, 0xA7, 0xC6, 0xE2, 0x57, 0x35, 0x9A, 0x19, 0x58, 0x8F, 0xCD, 0xEF, 0x1C, 0xD7,
      0x7E, 0xFA, 0xDD, 0x1B, 0x75, 0x03, 0xCD, 0x1E, 0x80, 0x89, 0xA5, 0xD4, 0x21, 0xF3, 0xD5, 0x00, 0xFD, 0xFB, 0x94, 0xF4, 0xC8, 0x3C, 0x06, 0xA4, 0xE4, 0xB1, 0x6E, 0x98, 0x77, 0x0E, 0x70, 0x24,
      0x43, 0xFD, 0x1B, 0xB0, 0xD6, 0x1D, 0x1B, 0x83, 0x57, 0xBF, 0x48, 0xE7, 0xA9, 0xDD, 0x30, 0x8E, 0x01, 0x82, 0x27, 0xE5, 0x06, 0xE6, 0x9B, 0x03, 0xDC, 0x00, 0x41, 0x89, 0x63, 0x35, 0x12, 0x43,
      0xDD, 0x40, 0xF1, 0x03, 0x30, 0xB9, 0x64, 0x27, 0x87, 0x7E, 0x6A, 0xA0, 0x46, 0x9A, 0x1C, 0xA8, 0x66, 0xC6, 0xED, 0x02, 0xCE, 0xFF, 0xBA, 0x00, 0x13, 0x97, 0xA6, 0x0E, 0x19, 0xCF, 0x40, 0xAD,
      0xE4, 0xC4, 0x38, 0x06, 0x6A, 0x27, 0x27, 0xD4, 0x0D, 0x44, 0xE7, 0x40, 0x6B, 0x94, 0x0D, 0x00, 0xDC, 0x53, 0x9F, 0x41, 0xF9, 0x5F, 0x18, 0x18, 0x06, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E,
      0x44, 0xAE, 0x42, 0x60, 0x82
      };
      
    // HTTP server will listen at port 80
    ESP8266WebServer server(80);
    
    const long FlashID[3]     =  {0x1640EF,0x1340C8,0x1340EF}; // Little Endian
    const String FlashDesc[3] =  {"WINBOND W25Q32: 32M-bit / 4M-byte","GIGADEVICE GD25Q40 4M-bit / 512K-byte","WINBOND W25Q40 4M-bit / 512K-byte"};
    
    const int led = 13;
    int state = 0;
    String one = "";
    String two = "checked"; 
    int stuff = 0;
    
    void handle_imageoff() {
      server.send(200, "image/png", "");
      WiFiClient client = server.client();
      client.write(imageoff, sizeof(imageoff));
    }
    
    void handle_imageon() {
      server.send(200, "image/png", "");
      WiFiClient client = server.client();
      client.write(imageon, sizeof(imageon));
    }
    
    void print_info()
    {
      Serial.println("------------------------------------");
      
      // ESP.getFreeHeap() returns the free heap size.
      Serial.print("FreeHeap : ");
      Serial.println(ESP.getFreeHeap());
    
      //ESP.getChipId() returns the ESP8266 chip ID as a 32-bit integer.
      Serial.print("Chip ID : ");
      Serial.println(ESP.getChipId());
    
      //ESP.getFlashChipId() returns the flash chip ID as a 32-bit integer.
      Serial.print("Flash Chip ID : 0x");
      Serial.print(ESP.getFlashChipId(),HEX);
      Serial.print(" - ");
    
      for(int i=0 ; i < 3 ; i++)
      {
        if (ESP.getFlashChipId() == FlashID[i])
        {
          Serial.println(FlashDesc[i]);
          goto next_val;
        }
      }
      Serial.println("Unknown flash chip");
      
      next_val:
      //ESP.getFlashChipSize() returns the flash chip size, in bytes, as seen by the SDK (may be less than actual size).
      Serial.print("Flash Chip Size : ");
      Serial.println(ESP.getFlashChipSize());
    
      //ESP.getFlashChipSpeed(void) returns the flash chip frequency, in Hz.
      Serial.print("Flash Chip Speed : ");
      Serial.println(ESP.getFlashChipSpeed());
    
      //ESP.getCycleCount() returns the cpu instruction cycle count since start as an unsigned 32-bit. This is useful for accurate timing of very short actions like bit banging.
      Serial.print("Cycle Count : ");
      Serial.println(ESP.getCycleCount());
    }
    
    
    void logo()
      {  
      Serial.println("\x1b");   //Set command mode
      Serial.println("[0m");    //reset all attributes
      
      Serial.println("\x1b");   //Set command mode
      Serial.println("[2J");    //clear screen 
      
      Serial.println("\x1b");   //Set command mode
      Serial.println("[35m");   //Purple color text 
      
      Serial.println("\x1b");   //Set command mode
      Serial.println("[6;3H");  //position
      
      Serial.println("ESP8266\n");
      
      Serial.println("\x1b");   //Set command mode
      Serial.println("[0m");    //reset all attributes
      }   
     
    void keepinfo()
    {
      logo();
      Serial.println("");
      Serial.print("Connected to ");
      Serial.println(ssid);
      Serial.print("IP address: ");
      Serial.println(WiFi.localIP());  
      Serial.println("HTTP server started");
      print_info();
    }
    
    void setup(void) {
      Serial.begin(115200);
      Serial.println("");
      logo();
      pinMode(led, OUTPUT);
        
      state = server.arg("state").toInt();
      digitalWrite(led, state);
      
      // Connect to WiFi network
      WiFi.begin(ssid, password);
      
      // Wait for connection
      while (WiFi.status() != WL_CONNECTED) {
        delay(500);
        Serial.print(".");
      }
      Serial.println("");
      Serial.print("Connected to ");
      Serial.println(ssid);
      Serial.print("IP address: ");
      Serial.println(WiFi.localIP());
      delay(250); 
        
      // Set up the endpoints for HTTP server
      //
      // Endpoints can be written as inline functions:
      server.on("/", [](){                 
        state = server.arg("state").toInt();
        digitalWrite(led, state);
        if (state == 1)
            {
            one = "checked";
            two = "";
            }    
        if (state == 0)
            {
            one = "";
            two = "checked";
            }
        server.send(200, "text/html", String("<!DOCTYPE html><html><meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1'><body BGCOLOR='black' text='white'><center><p><b>Led is ") + ((state)?"<font color = 'green' size='20'>ON</font>.":"<font size='20'>OFF</font>.") + ("</b></p> <p><img src='/led") + ((state)?"on":"off") + (".png'></p><form action=''><input type='radio' name='state' value='1'") + (one) + (">On<input type='radio' name='state' value='0'") + (two) + (">Off<p><input type='submit' value='Submit'></p></form></center></body></html>"));       
      });
        
      // And as regular external functions:
      server.on("/ledon.png", handle_imageon);
      server.on("/ledoff.png", handle_imageoff);
      
      // Start the server 
      server.begin();
      Serial.println("HTTP server started");
      print_info();  
    }
     
    void loop(void) {
      // check for incomming client connections frequently in the main loop:
      server.handleClient(); 
     
      while( stuff > 10 )
        {
        keepinfo();    
        stuff = 0; 
        }   
      ++stuff;
        
      // Delays allow the ESP8266 to perform critical tasks
      // defined outside of the sketch. These tasks include
      // setting up, and maintaining, a WiFi connection.
      delay(100);
      // Potentially infinite loops are generally dangerous.
      // Add delays -- allowing the processor to perform other
      // tasks -- wherever possible.
    }
    

    300 x 290 - 45K
    625 x 493 - 224K
    597 x 455 - 39K
    1111 x 658 - 152K
    1000 x 1053 - 2M
    1.Silicon gel filled square. <-2.Sonics(ultra even). 3.Lazers. 4.?
    https://hackaday.io/project/162734-a-trillion-year-clock
    54 propeller chips connected, One to rule them all.
    https://forums.parallax.com/discussion/127983/55-parallax-propeller-s-parallells-processing-of-permanent-perturbations/p1
    Seriously contemplating removing ALL my content from the net completely, FREEDOM OF SPEECH IS DEAD.
  • What you can't add attachments to a post?
    So a new reply needs to be created to add or fix attachments.



    The sketch file is ripped from others code and fixed/upgraded.
    When you put the IP address of the ESP8266 into your browser, you get this.
    ESP8266%20server%20result.jpg


    I was trying to add this to the previous post but good luck trying to manage attachments with this heavily unchanged as of yet, POS, forum..
    575 x 406 - 25K
    1.Silicon gel filled square. <-2.Sonics(ultra even). 3.Lazers. 4.?
    https://hackaday.io/project/162734-a-trillion-year-clock
    54 propeller chips connected, One to rule them all.
    https://forums.parallax.com/discussion/127983/55-parallax-propeller-s-parallells-processing-of-permanent-perturbations/p1
    Seriously contemplating removing ALL my content from the net completely, FREEDOM OF SPEECH IS DEAD.
  • Clock LoopClock Loop Posts: 1,603
    edited 2015-08-08 - 05:45:20
    Not being able to add attachments is really lame.

    These kind of things complete make this forum useless due to the bloat and total confusion that these VOTES also do.

    Talented guys who expect logic, will never go with that.

    There is no order to this voting madness, and ARE YOU KIDDING ME?
    Plus if you act now content producers (like the nice picture and link and info filled content) won't do this anymore, due to a lack of conversation flow.


    I guess its time to switch to C? And move along, nothing to see here?
    This forum made the prop, and currently, its completely breaking it now.

    And can't delete your own posts? And no way to edit attachments? <---- 2 REALLY BIG ISSUES

    It feels like a circus came to town and set up shop in you're backyard.

    Time to move? I kinda like the prop, spin and all. But i suppose it may be time to move along. (which is perhaps the true point to these forum changes, or if its not, its the result for many technical people who desire order in converations and discussion lists. (a.k.a forum, not chaos thru popularity.)
    1.Silicon gel filled square. <-2.Sonics(ultra even). 3.Lazers. 4.?
    https://hackaday.io/project/162734-a-trillion-year-clock
    54 propeller chips connected, One to rule them all.
    https://forums.parallax.com/discussion/127983/55-parallax-propeller-s-parallells-processing-of-permanent-perturbations/p1
    Seriously contemplating removing ALL my content from the net completely, FREEDOM OF SPEECH IS DEAD.
  • Clock LoopClock Loop Posts: 1,603
    edited 2015-08-08 - 05:10:17
    See I forgot to attach the image and now I can't edit it to add an attachment or delete the post.

    My look into the esp8266 device, and im quite impressed.

    Looking at code, if we can get PROP TOOL (or another spin compiler) to send the bin file via telnet, would coding a prop programmer in c on SKETCH be all that hard?

    Doesn't the c code to program the prop already exist? Where?

    The sketch file is ripped from others code and fixed/upgraded.
    When you put the IP address of the ESP8266 into your browser, you get this.

    Result.gif




    Oh yea, i do this stuff like make this animated gif, just so it can get lost in the post flow?

    Or perhaps i should just give it more time? I guess I worry that some may get used to the simplicity of the server and keep it as such.

    Simple means nonfunctional for most technical people.

    So what? now we have voting wars?

    If I could edit attachments, and delete posts, voting wars might become ok, because posts will be encouraged to be edited to be the best post ever.

    But old posts need to be removed to stop confusion, and down voted.

    So technically everyone could have a single comment on a thread, the comment is subject to voting.
    But we can't edit attachments so editing a single comment per user on each thread won't work, thus voting cannot be made orderly.
    800 x 600 - 63K
    1.Silicon gel filled square. <-2.Sonics(ultra even). 3.Lazers. 4.?
    https://hackaday.io/project/162734-a-trillion-year-clock
    54 propeller chips connected, One to rule them all.
    https://forums.parallax.com/discussion/127983/55-parallax-propeller-s-parallells-processing-of-permanent-perturbations/p1
    Seriously contemplating removing ALL my content from the net completely, FREEDOM OF SPEECH IS DEAD.
  • Thanks for the good info clockloop.

    Yep, shame about the forum, and no one seems to care either :(
    My Prop boards: P8XBlade2, RamBlade, CpuBlade, TriBlade
    Prop OS (also see Sphinx, PropDos, PropCmd, Spinix)
    Website: www.clusos.com
    Prop Tools (Index) , Emulators (Index) , ZiCog (Z80)
  • Since I can't edit posts to add attachments, I must make a new comment. and then upvote it?

    So I was thinking, one could be ap, one could do smtp, one could do ntp, and one could do webserver.

    Dell servers, here i come, death by 1,000 esp's.

    4%20-%208266.jpg

    4%20Breadboarded%208266s.jpg
    1920 x 1080 - 543K
    1920 x 1080 - 501K
    1.Silicon gel filled square. <-2.Sonics(ultra even). 3.Lazers. 4.?
    https://hackaday.io/project/162734-a-trillion-year-clock
    54 propeller chips connected, One to rule them all.
    https://forums.parallax.com/discussion/127983/55-parallax-propeller-s-parallells-processing-of-permanent-perturbations/p1
    Seriously contemplating removing ALL my content from the net completely, FREEDOM OF SPEECH IS DEAD.
  • MJBMJB Posts: 1,119
    Wireless transmission of water level with TACHYON +ESP8266/NodeMCU/Lua to ThingSpeak.com

    see here:
    forums.parallax.com/discussion/comment/1339689/#Comment_1339689
  • Heater.Heater. Posts: 21,213
    edited 2015-08-08 - 13:36:48
    Clock Loop,

    Thanks for all the ESP8266 info and links. Hopefully I will find time to play along with this at some point.

    Love that hi-res die photo. All those intriguing "mobius" inductors in there.

    Yes, the forum is broken, no deleting own post, silly voting system, we all know the ills by now. I live in hope that it will be fixed soon enough. Before this place becomes a ghost town.

    However: You can add attachments! See attachment :)
    Edit: Scratched out the above. Turns out the "add attachment" thing just stuffs the content in line. As below.

    Problem is the button to do that is nowhere near the edit box as you edit. Oh no, it's way down at the bottom of the page, underneath another redundant edit box that you are not using.

    Why for goodness sake?


    stanfordbrea.png
  • MJBMJB Posts: 1,119
    edited 2015-08-08 - 15:51:38
    wonder how this works ....
    warm water IN
    and hot and cold OUT .. ???
    Heater. wrote: »
    stanfordbrea.png



  • PublisonPublison Posts: 10,963
    edited 2015-08-08 - 16:52:16
    MJB wrote: »
    wonder how this works ....
    warm water IN
    and hot and cold OUT .. ???
    Heater. wrote: »



    Or is it a simple mixer? Hot/Cold in..warm out?

    But we take away from the thread. Starting a new thread to test attachments.

    Infernal Machine
  • I've been itching to start another project with these. I've made a few things and they have all worked great. None of them were Propeller based so I haven't posted much.

    Sending AT commands from the Prop was easy enough. I need to dig into LUA and Propeller serial before going any further.

    Unless someone has a nice working example of SPIN talking to LUA I could use to start with...


  • Heater.Heater. Posts: 21,213
    edited 2015-08-08 - 20:27:51
    wonder how this works ....
    warm water IN
    and hot and cold OUT .. ???
    Close. That is not water going in, that is two colours of light entering a block of silicon from the left. The weird holes in the square block defract the different light frequencies differently so that red exits by one port and blue the other.

    The shapes of weird holes were arrived at by some algorithm developed at Stanford.
    http://fvforums.com/showthread.php?2529-Breakthrough-Brings-Optical-Data-Transport-Closer-To-Reality&s=31c5f3d76cc627d1300c74427cc589ea

    Now, it's odd you should mention water. A standard physics demo in school is to set up a vibrator in a shallow tank of water and show how water waves propagate and are reflected and defracted by obstacles.

    I was pondering setting up a water tray with obstacles in it of the shape of those holes. Then have two vibrators sending two frequencies down the input "pipe". If we scale it correctly we should see the same frequency discrimination on the outputs.
  • MJBMJB Posts: 1,119
    xanadu wrote: »
    I've been itching to start another project with these. I've made a few things and they have all worked great. None of them were Propeller based so I haven't posted much.

    Unless someone has a nice working example of SPIN talking to LUA I could use to start with...
    you can take my LUA example from the Tachyon thread and send the strings from SPIN.
  • MJBMJB Posts: 1,119
    Heater. wrote: »
    wonder how this works ....
    warm water IN
    and hot and cold OUT .. ???
    Close. That is not water going in, that is two colours of light entering a block of silicon from the right. The weird holes in the square block defract the different light frequencies differently so that red exits by one port and blue the other.

    The shapes of weird holes were arrived at by some algorithm developed at Stanford.
    http://fvforums.com/showthread.php?2529-Breakthrough-Brings-Optical-Data-Transport-Closer-To-Reality&s=31c5f3d76cc627d1300c74427cc589ea

    Now, it's odd you should mention water. A standard physics demo in school is to set up a vibrator in a shallow tank of water and show how water waves propagate and are reflected and defracted by obstacles.

    I was pondering setting up a water tray with obstacles in it of the shape of those holes. Then have two vibrators sending two frequencies down the input "pipe". If we scale it correctly we should see the same frequency discrimination on the outputs.

    Heater - you write 'entering from the right' but it is actually really entering from the LEFT.
    So the mixture is seperated !!!
    So a dual high / low pass device for light.
    great !!

    about water wave tank simulations:
    there are some great applets on the net where you can build your own obstacle paterns and see the waves passing through. google helps.
  • Igor_RastIgor_Rast Posts: 357
    edited 2015-08-08 - 20:03:51
    OK , in the spirit of finaly having a working data logger with the esp8266 + propeller. here is the code I used

    esp is running lua firmware.
    I have 7x K30 co2 sensors and one sht-11 wired to an repurpose pcb
    propeller reads the sensors out , then does a get request to a php page on my local server.
    this page gets the data and runs a query to place them in the database.
    Sounds simple , but had have quite some time to get it working . Anyways

    source is attached. esp8266.spin is the main code. index2.php is the page hosted on my local server

    Ill be making a blog post when I get some time ,and also a webpage to display the data.
    Ill post the link here once its done

    I.C.E.C
    Love The Life you Live, Live The Life you Love,
  • MJB,

    Well spotted. Mixed frequencies enter from the left, separated frequencies leave on the right. It's a demultiplexer. Apparently the smallest in the world.

    Mind, you, it's in the nature of these things to be reversible so pumping two frequencies into the right should give the multiplexed result on the left.

    I'll have to look for some wave tank simulations. Mind you there is no way Java Applets are ever running here.
Sign In or Register to comment.