WizFi250?

Status
Not open for further replies.
Hi Sumotoy
Thanks for the adafruit infos, btw it doesn't work anymore since was designed for IDE 1.6.3.
The link I gave was for IDE 1.6.4. I use it without any mods.
 
It might be pulled down internally. I'll check on my board tonight. I think it might be easier to just redesign it. But I'd like to know how to properly configure the GPIOs. Maybe I will have to tie GPIO15 to GND. I can always green wire it on my board to test it.
 
Hi,
Ian, maybe I've missed something or in the link you gave there's only the official 1.6.4 IDE from Arduino? Actually the Adafruit proxy don't work with 1.6.4, since was designed for 1.6.3, so I cannot install the extra boards as described.
So adding the ESP support can be done only manually or by compiling the Arduino 1.6.1 ESP.
Update:
At the end I dowloaded the addon boards from Adafruit using IDE 1.6.3 https://adafruit.github.io/arduino-board-index/package_adafruit_index.json for checking purposes and unfortunatly they using an early beta with many broken stuff that was recently fixed (SPI, I2C, DNS, server, etc. etc... all related to ESP chip of course) and actually it's designed for 1.6.1, Ivan https://github.com/igrr kindly updating https://github.com/esp8266/Arduino almost every 8 hours and he's doing a great work!
Maybe I've missed the link to the IDE 1.64 with ESP support, so sorry if I misunderstood!

Frank, I've checked my chinese board with tester and 'microscope' and pin 13 (GPIO15, right?) looks tied to ground, I'm 96% sure since I haved some trouble to use the gigantic tip of my tester with ESP tiny chip legs! I've ordered some olimex, thanks again for the link!
Onehorse, did you are talking about the blank.bin of the link I gived you? I just downloaded again and worked, it's just filled by one char repeated by 4k. Btw you must have really good eyes to design such tiny stuff!
I just have a question, did you design the ESP board as wifi to serial only or you provided the ability to reprogram freely (by exposing all the needed pins)?
When I got the board I was thinking that works as wifi<-->serial only, but later I've discovered that there's much power under the chip so I had to provide pins and jumpers, also a space for the header of the USB->serial for programming it. But now I'm sure there's a way to use Teensy to do that (once the ESP has the bootloader).
 
Last edited:
When I click on "RAW" for all the other .bin files, they are downloaded to my browser. When I do the same for blank.bin it just shows a bunch of characters in a file, no download. How do i get the files? Just copy and past?

I guess I will have to redesign the board via Frank's suggestion. But I will connect pin 13 to GND if it is not already pulled down and try to follow the flashing script above. I'll let you know what happens.

Oh, and I have an illuminated 5x magnified lamp, not good eyesight!
 
Just to note, the ESP8266 finally support the 'board' install option from IDE version 1.6.4.
Just go in 'preferences' and add this path:
http://arduino.esp8266.com/package_esp8266com_index.json
No need to install manually stuff. I strongly suggest to avoid the Adafruit solution for the ESP8266 since it's outdated and based from an un-officially ESP8266 community version.
 
Are you saying I can avoid all the manual firmware loading and just use an Arduino IDE version 1.6.4? I am using 1.0.6 for some reason now with teensiduino.
 
Are you saying I can avoid all the manual firmware loading and just use an Arduino IDE version 1.6.4? I am using 1.0.6 for some reason now with teensiduino.
Yes and no, your ESP should have at list the bootloader, once you have that you can program it as an Arduino with IDE.
 
Thanks for your help sumotoy. I ordered some ESP12E from China just so I have something that "should" work and I can get more familiar with the tools, etc. I also redesigned my board to add more GPIOs including IO15 which I didn't realize needed to be GND during firmware uploading. I suppose I could just redesign the first board with IO15 pulled to ground but I went ahead and pinned out the ESP8266 just in case this could actually enable another hardware SPI port while attached to the Teensy. It also allows access to the CTS/RTS for hardware serial flow control. In fact, on the new design (which is a bit clunky, I admit) every IO is broken out except ADC, Reset and IO5. While I wait for the new boards from OSH Park and the ESP12Es to arrive, I will have a go at uploading the firmware to the one board I put together by greenwiring IO15 to GND if I have to. I'll let you know if I make any progress getting it to work. Here is the new board design:

esp8266.v02.front.png esp8266back.v02.png

If I can get it to work it will provide wifi capability so the Teensy can stream data to a laptop remotely and another hardware SPI port to drive a display or flash memory, sensors, etc. I'll also work to make it smaller and a little more convenient to use, later...
 
Last edited:
I might as well join in the hijack of my thread :p

I got a couple of the Adafruit HUZZAH ESP8266 boards, wired one up and setup the board in the Arduino IDE. In no time I had a simple UDP temp server...

Code:
/*
 * 29 May 2015
 * This sketch displays a DS18B20 temp as a UDP packet coming from an UDP client.
 *
 * Configuration : Enter the ssid and password of your Wifi AP. Enter the port number your server is listening on.
 *
 */

#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
#include <OneWire.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>

int status = WL_IDLE_STATUS;
const char* ssid = "yourssid";  //  your network SSID (name)
const char* pass = "yourpasswd";       // your network password

uint16_t localPort = 2652;      // local port to listen for UDP packets

char packetBuffer[512]; //buffer to hold incoming and outgoing packets

int16_t fahrenheit, celsius, packetCnt;

// A UDP instance to let us send and receive packets over UDP
WiFiUDP Udp;

// A OneWire instance to test a DS18B20
OneWire  ds(2);  // on pin 2 (a 4.7K resistor is necessary)

void setup()
{
  // Open serial communications and wait for port to open:
  Serial.begin(115200);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }

  // setting up Station AP
  WiFi.begin(ssid, pass);
  
  // Wait for connect to AP
  Serial.print("[Connecting]");
  Serial.print(ssid);
  int tries=0;
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
    tries++;
    if (tries > 30){
      break;
    }
  }
  Serial.println();


printWifiStatus();

  Serial.println("Connected to wifi");
  Serial.print("Udp server started at port ");
  Serial.println(localPort);
  Udp.begin(localPort);
}

void getTemp(void) {
  byte i;
  byte present = 0;
  byte type_s;
  byte data[12];
  byte addr[8];
  
  if ( !ds.search(addr)) {
    Serial.println("No more addresses.");
    Serial.println();
    ds.reset_search();
    delay(250);
    return;
  }
  
  Serial.print("ROM =");
  for( i = 0; i < 8; i++) {
    Serial.write(' ');
    Serial.print(addr[i], HEX);
  }

  if (OneWire::crc8(addr, 7) != addr[7]) {
      Serial.println("CRC is not valid!");
      return;
  }
  Serial.println();
 
  // the first ROM byte indicates which chip
  switch (addr[0]) {
    case 0x28:
      Serial.println("  Chip = DS18B20");
      type_s = 0;
      break;

    default:
      Serial.println("Device is not a DS18x20 family device.");
      return;
  } 

  ds.reset();
  ds.select(addr);
  ds.write(0x44, 1);        // start conversion, with parasite power on at the end
  
  delay(1000);     // maybe 750ms is enough, maybe not
  // we might do a ds.depower() here, but the reset will take care of it.
  
  present = ds.reset();
  ds.select(addr);    
  ds.write(0xBE);         // Read Scratchpad

  Serial.print("  Data = ");
  Serial.print(present, HEX);
  Serial.print(" ");
  for ( i = 0; i < 9; i++) {           // we need 9 bytes
    data[i] = ds.read();
    Serial.print(data[i], HEX);
    Serial.print(" ");
  }
  Serial.print(" CRC=");
  Serial.print(OneWire::crc8(data, 8), HEX);
  Serial.println();

  // Convert the data to actual temperature
  // because the result is a 16 bit signed integer, it should
  // be stored to an "int16_t" type, which is always 16 bits
  // even when compiled on a 32 bit processor.
  int16_t raw = (data[1] << 8) | data[0];
  
  byte cfg = (data[4] & 0x60);
  
  // at lower res, the low bits are undefined, so let's zero them
  if (cfg == 0x00) raw = raw & ~7;  // 9 bit resolution, 93.75 ms
  else if (cfg == 0x20) raw = raw & ~3; // 10 bit res, 187.5 ms
  else if (cfg == 0x40) raw = raw & ~1; // 11 bit res, 375 ms
  //// default is 12 bit resolution, 750 ms conversion time
  
  celsius = raw / 16;
  fahrenheit = ((celsius * 9)/5) + 32.0;
  
  Serial.print("  Temperature = ");
  Serial.print(celsius);
  Serial.print(" Celsius, ");
  Serial.print(fahrenheit);
  Serial.println(" Fahrenheit");
}

void loop()
{
  int noBytes = Udp.parsePacket();
  if ( noBytes ) 
  {
    Serial.print(millis() / 1000);
    Serial.print(":Packet of ");
    Serial.print(noBytes);
    Serial.print(" received from ");
    Serial.print(Udp.remoteIP());
    Serial.print(":");
    Serial.println(Udp.remotePort());
    
    // We've received a packet, read the data from it
    Udp.read(packetBuffer,noBytes); // read the packet into the buffer

    // display the packet contents in HEX
    for (int i=1;i<=noBytes;i++)
    {
      Serial.print(packetBuffer[i-1],HEX);
      if (i % 32 == 0)
      {
        Serial.println();
      }else Serial.print(' ');
    } // end for
    Serial.println("Getting Temp");
    getTemp();
    Udp.beginPacket(Udp.remoteIP(), Udp.remotePort());
    packetCnt = sprintf(packetBuffer, "Temperature is %d degrees C, %d degrees F\n", celsius, fahrenheit);
    Udp.write(packetBuffer, packetCnt);
    Udp.endPacket();
  } // end if

}

void printWifiStatus() {
  // print the SSID of the network you're attached to:
  Serial.print("SSID: ");
  Serial.println(WiFi.SSID());

  // print your WiFi shield's IP address:
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");
  Serial.println(ip);
}
 
Yesterday I've finish the RA8875 stable beta (works beautiffully with Teensy 3 and 3.1, a bit slow on Teensy LC even using SPI1 but I'm sure I will find why) and received an ESP8266 MOD12 module, had a crazy idea and added support for ESP8266 to my RA8875 library. 10 minutes ago I have connected an 7" 800x480 RA8875 drived display to ESP8266 and...Tadaaa... It turns on! It's amazing to see such a large display drived directly from a WiFi module!
 
I can confirm that this works, as long as you're not using a 'recent' Apple device to connect. It seems they reserve the '.local' suffix for bonjour devices now. This confused me as it wouldn't work on my iphone but works on my (ancient) ipad.
 
I can confirm that this works, as long as you're not using a 'recent' Apple device to connect. It seems they reserve the '.local' suffix for bonjour devices now. This confused me as it wouldn't work on my iphone but works on my (ancient) ipad.

Thanks for the feedback. I maintain the current Arduino Bonjour library so the .local for Bonjour /devicesservices is fine by me ;-)
I use this in conjunction with TouchOSC on my iPhone. TouchOSC can discover _osc._udp services. So if you have a device that can register an OSC service it is very easy to connect to without any network configuration (hence the namwe ZeroConf). I am hoping that I can get this to work on the ESP8266.
 
Yes Paul, thanks! Haved tested with Teensy 3, Teensy 3.1, Teensy LC works as it should, Only on Teensy LC I noticed that (using standard hardware SPI) it's a bit slower than I expected, but I'm investigating.
Working with all Raduino's 8bit and DUE as well.
 
I've looked at the mDNSresponder code a little closer and it appears that its a copy of what was used on the CC3000 from TI. It really only implements a small subset of mDNS to resolve link local addresses so you can talk to your Arduino with a clear text address e.g. arduino.local, but it does to allow service registration and discovery (DNS-SD), which are the essential parts of ZeroConf/Bonjour.

I'll dig little deeper into this when I have time as I have the feeling that this little esp8622 beast is certainly up to the task. Just some software has yet to be written ;-)
 
Status
Not open for further replies.
Back
Top