attiny85 and esp8266, big question

Hi, i’m trying to get work the esp8266 with an attiny85. This is my code:

#include <SoftwareSerial.h>
#define SSID        "ESSID"
#define PASS        "passW0rd"
SoftwareSerial dbgSerial(1, 0); // RX, TX
int led = 4;

void setup()  
{
  pinMode(led, OUTPUT);     
  // Open serial communications and wait for port to open:
  dbgSerial.begin(9600);  //can't be faster than 19200 for softserial
  //test if the module is ready
  dbgSerial.println("AT+RST");
  delay(2000);
  dbgSerial.println("AT");
  delay(2000);
  dbgSerial.println("AT+CWMODE=3");
  delay(2000);
  String cmd="AT+CWJAP=\"";
  cmd+=SSID;
  cmd+="\",\"";
  cmd+=PASS;
  cmd+="\"";
  dbgSerial.println(cmd);
  delay(2000);

  dbgSerial.println("AT+CIPMUX=1");
  delay(2000);
  dbgSerial.println("AT+CIPSERVER=1,80");
}
void loop() 
{
  if(dbgSerial.find("led1off"))
  {
    digitalWrite(led, LOW);
  }
  if(dbgSerial.find("led1on"))
  {
    digitalWrite(led, HIGH);
  }
}

it’s simple, first connect to the wifi and then if is received “led1on” the led at 4 turns on, if received “led1off” turns off.
If i select arduino uno as the board in arduino ide, compiles without problems, but if select attiny85:

_0001_at85.ino: In function ‘void loop()’:
_0001_at85.ino:35:16: error: ‘class SoftwareSerial’ has no member named ‘find’
_0001_at85.ino:39:16: error: ‘class SoftwareSerial’ has no member named ‘find’

:’( how i can fix it? how i can read the incoming from esp8266 in my attiny85?

If i select arduino uno as the board in arduino ide, compiles without problems, but if select attiny85:

Code: [Select]
_0001_at85.ino: In function ‘void loop()’:
_0001_at85.ino:35:16: error: ‘class SoftwareSerial’ has no member named ‘find’
_0001_at85.ino:39:16: error: ‘class SoftwareSerial’ has no member named ‘find’

:’( how i can fix it? how i can read the incoming from esp8266 in my attiny85?

The quick fix is to use an Amega328P
The long road is to add ‘find’ to SoftwareSerial … Assuming you are up-to-it… That is why the source code is available.

I’m not trying to come-off being a smartass, but sometimes using a t85 is just NOT worth the $2 saved in the cost of microcontroller sand … Pick the right silicon and move forward.

FYI… Nick Gammon last year released a Software Send Only and a Software Receive Only versions for tiny use to conserve flash and SRAM. Search the forums, I do not have it bookmarked.

Also, Trinket and DigiSpark are t85 devices and have mature posted code and libs.

Good luck,

Ray

You can use the TextFinder library with SoftwareSerial
This example finds the “OK” message.

#include <TextFinder.h>
#include <SoftwareSerial.h>

SoftwareSerial mySerial(3,4); // RX, TX
TextFinder  finder(mySerial); 

void setup() 
{ 
  mySerial.begin(9600); 

  mySerial.println("Start");
} 

void loop(){
  if ( finder.find("OK")  ){
    mySerial.println("Found OK");
  }

}

Erni: You can use the TextFinder library with SoftwareSerial This example finds the "OK" message.

As we say down South, "I'll be...". I did not know that.

Thanks.

Ray