These are chat archives for esp8266/Arduino

21st
May 2015
tzapu
@tzapu
May 21 2015 11:07 UTC
hello all, this is probably too small of a problem compared to what i ve seen above, but i am trying to use the adafruit ssd1306 library so i can drive a small oled and i really don t have the knowledge to make it work
anyone has any pointer to make it work? currently it fails with 'fatal error: avr/pgmspace.h: No such file or directory'
which makes sense as this is not an avr/arduino. but don t know what to do next
Ivan Grokhotkov
@igrr
May 21 2015 11:08 UTC
we don't have "avr/pgmspace.h", but you may try to replace that with "pgmspace.h"
tzapu
@tzapu
May 21 2015 11:10 UTC
ah, will try, thanks. (you seem omnipresent :D )
well, that worked, but now i get cannot convert 'volatile uint32_t {aka volatile unsigned int}' to 'PortReg*
i assume that s because the old and new libraries are returning different value types
Ivan Grokhotkov
@igrr
May 21 2015 11:15 UTC
can you point me to the code so i can take a look how PortReg is declared?
tzapu
@tzapu
May 21 2015 11:16 UTC
sure
taht s the lib
Ivan Grokhotkov
@igrr
May 21 2015 11:18 UTC
take a look at the .h file
#ifdef __SAM3X8E__
 typedef volatile RwReg PortReg;
 typedef uint32_t PortMask;
#else
  typedef volatile uint8_t PortReg;
  typedef uint8_t PortMask;
#endif
there is an ifdef for ARM and else for AVR
tzapu
@tzapu
May 21 2015 11:19 UTC
so i could make those volatile uint32_t
which would match with the esp libs
Ivan Grokhotkov
@igrr
May 21 2015 11:19 UTC
change that to #if defined( __SAM3X8E__ ) || defined( ESP8266 )
tzapu
@tzapu
May 21 2015 11:19 UTC
ah
cool
thanks you
Ivan Grokhotkov
@igrr
May 21 2015 11:19 UTC
np
tzapu
@tzapu
May 21 2015 11:29 UTC
thanks again, removing some more stuff managed to make it compile, now to make it work :)
Michael Miller
@Makuna
May 21 2015 15:42 UTC
@igrr I really wish Arduino didn't require the avr to include progmem.h
#include <avr/progmem.h>. It makes writing compatible libraries a little more annoying.
Ivan Grokhotkov
@igrr
May 21 2015 15:43 UTC
how about moving progmem.h to avr/progmem.h and adding progmem.h which will include avr/progmem.h as a fallback?
Michael Miller
@Makuna
May 21 2015 15:53 UTC
its a work around, a little misleading as this has nothing to do with Avr, but we didn't create that problem ;-)
Ivan Grokhotkov
@igrr
May 21 2015 15:54 UTC
well i don't actually see any other workaround...
Michael Miller
@Makuna
May 21 2015 15:55 UTC
agreed, are you doing this?
Ivan Grokhotkov
@igrr
May 21 2015 16:26 UTC
if you need this right now, do it and send the change. if not, i'll do this a bit later tonight.
Markus
@Links2004
May 21 2015 17:17 UTC
some question i today get my 4MB flash chips, and they working :)
i take a look in the linker file and see the irom0_0_seg is expanded to size of 0xF0000
new addr range: 0x010000 - 0x100000 but the Memory-Map: https://github.com/esp8266/esp8266-wiki/wiki/Memory-Map#spi-flash-rom-layout-without-ota-upgrades
shows at 0x07C000 and 0x07E000 config stuff from the SDK.
is this config is moved or have we a collision in this case?
Ivan Grokhotkov
@igrr
May 21 2015 17:19 UTC
the config is moved as the flash size increases
it takes last 4 sectors of flash
Markus
@Links2004
May 21 2015 17:20 UTC
so the SDK detects the "magic bytes" from the bootloader?
and switch the addr range
for config
Ivan Grokhotkov
@igrr
May 21 2015 17:21 UTC
yeah, there's a global "FlashChip" object which is set up on start
and sdk reads the flash size from there
Markus
@Links2004
May 21 2015 17:22 UTC
so no problems here, perfect.
Markus
@Links2004
May 21 2015 17:39 UTC
is there a reason why ESP8266WiFiClass::_getScanInfoByIndex is protected?
Ivan Grokhotkov
@igrr
May 21 2015 17:39 UTC
like, not public?
or not private?
Markus
@Links2004
May 21 2015 17:40 UTC
yes
I prefer it public access it from outside :)
Ivan Grokhotkov
@igrr
May 21 2015 17:41 UTC
well the rationale is that scan_info is a struct from SDK, and in general i tried not to expose SDK types to the user
there is a bunch of methods to access fields of scan_info by index
those are public
Markus
@Links2004
May 21 2015 17:42 UTC
yes then i need to add to new for channel and bssid and in my code i the call 4 function to get all info
Ivan Grokhotkov
@igrr
May 21 2015 17:42 UTC
BSSID should be there, i just haven't implemented it
it's in standard WiFi Shield library, so we need to have it
and you are welcome to add a new method for the channel
you may add something like getScanInfo(int index, String& ssid, String& BSSID, int& channel, ...)
which will fill all the values in one go
Ivan Grokhotkov
@igrr
May 21 2015 17:45 UTC
i mean, BSSID should be there, but it's not :)
as you see i have commented it out and forgot to add it back later
Markus
@Links2004
May 21 2015 17:46 UTC
I will add it.
alon24
@alon24
May 21 2015 18:15 UTC
hi
Markus
@Links2004
May 21 2015 18:15 UTC
hi
alon24
@alon24
May 21 2015 18:16 UTC
i installed arduno 164 and esp board from: http://arduino.esp8266.com/package_esp8266com_index.json
now I had in my 164 the Adafruit_SSD1306 and Adafruit_GFX libs
Markus
@Links2004
May 21 2015 18:17 UTC
yes?
alon24
@alon24
May 21 2015 18:18 UTC
and now I want to add the ones that will work (hopefully) on esp: https://github.com/Sermus/ESP8266_ArduinoIDE/tree/master/Espressif/ESP8266/libraries
is there a way to install both so that they would work, because I want (do not have to) use the same arduino for developing both
but they are same libs but for differnt devices (so have changes)
Ivan Grokhotkov
@igrr
May 21 2015 18:19 UTC
won't work likely
these libs have been modified to use some stuff from Sming, which is not present in this distribution
alon24
@alon24
May 21 2015 18:20 UTC
i have asming insalled in c:\tools
sming in c:\tools\sming (used choco)
Ivan Grokhotkov
@igrr
May 21 2015 18:20 UTC
but how does the IDE know about that?
alon24
@alon24
May 21 2015 18:20 UTC
yeah
Markus
@Links2004
May 21 2015 18:20 UTC
the original Adafruit_GFX from Adafruit is working on the ESP8266
Ivan Grokhotkov
@igrr
May 21 2015 18:20 UTC
anyway...
alon24
@alon24
May 21 2015 18:21 UTC
realy?
and the ssd1306?
Ivan Grokhotkov
@igrr
May 21 2015 18:21 UTC
I have modified the packaging script to bundle the Adafruit ssd1306 lib with the board manager package
will deploy later tonight
alon24
@alon24
May 21 2015 18:21 UTC
gr8 i am looking forward to tha
htat
Markus
@Links2004
May 21 2015 18:21 UTC
not tested i have an ILI9341 display + Adafruit_GFX running here
Ivan Grokhotkov
@igrr
May 21 2015 18:22 UTC
oh wait that was Adafruit_ILI9341
sorry
alon24
@alon24
May 21 2015 18:22 UTC
thats exactly my next question
Ivan Grokhotkov
@igrr
May 21 2015 18:22 UTC
there was a discussion about SSD1306 though...
just a couple hours ago
i have the 2 screens ssd1306 and that screen
Ivan Grokhotkov
@igrr
May 21 2015 18:22 UTC
@tzapu did you make any progress with Adafruit_ssd1306 lib?
alon24
@alon24
May 21 2015 18:23 UTC
if i can use the ili3941 with just the 4 spi pins that would be good
Markus
@Links2004
May 21 2015 18:23 UTC
ILI9341 is working fine with up to 27fps
alon24
@alon24
May 21 2015 18:23 UTC
how many pins?
Markus
@Links2004
May 21 2015 18:23 UTC
5pins
if you dont add reset
SPI + the D/C line and CS
alon24
@alon24
May 21 2015 18:24 UTC
i would love that
how will i be able to get it? I mean i installed via boardmanager
Ivan Grokhotkov
@igrr
May 21 2015 18:25 UTC
i will update the board manager package later tonight
alon24
@alon24
May 21 2015 18:25 UTC
gr8
Ivan Grokhotkov
@igrr
May 21 2015 18:25 UTC
you will be able to install via board manager
also there is another display which is supported... esp8266/Arduino#271
don't know if its useful for you though
alon24
@alon24
May 21 2015 18:26 UTC
no i have the ssd1306 and 3941
i want to connect a rotary encoder too (for controlling menu)
I have code that uses interupts, how do i use interrups in esp arduino?
Ivan Grokhotkov
@igrr
May 21 2015 18:27 UTC
just like you do it on an arduino — with attachInterrupt
alon24
@alon24
May 21 2015 18:28 UTC
so this code should just work?
Ivan Grokhotkov
@igrr
May 21 2015 18:29 UTC
well, remember not to do any lengthy stuff from the interrupts and you should be good
at least it should work
if it doesn't, let me know
alon24
@alon24
May 21 2015 18:29 UTC
what are the pins numbers - is it just 4 - gpio4?
Markus
@Links2004
May 21 2015 18:29 UTC
yes
Ivan Grokhotkov
@igrr
May 21 2015 18:30 UTC
be warned that some ESP-12s (or 7s?) have gpio4 and gpio5 swapped
the silkscreen is incorrect on some of them
so if gpio4 doesn't seem to work, try swapping them around
ficeto
@ficeto
May 21 2015 18:31 UTC
to be honest very few are actually correct
even the brand spanking new ESP-12E have them wrong
and it's been out there for some time
interrupts should work as expected
on GPIOs 0-15
alon24
@alon24
May 21 2015 18:33 UTC
should i not use 16?
ficeto
@ficeto
May 21 2015 18:33 UTC
no Interrupt vector there
alon24
@alon24
May 21 2015 19:10 UTC
it does not seem to work tried 12,14 tried 4,5
Markus
@Links2004
May 21 2015 19:14 UTC
@igrr esp8266/Arduino#300 new WiFi functions :)
alon24
@alon24
May 21 2015 19:15 UTC
int encoderPin1 = 5;
int encoderPin2 = 4;

pinMode(encoderPin1, INPUT);
pinMode(encoderPin2, INPUT);

digitalWrite(encoderPin1, HIGH); //turn pullup resistor on
digitalWrite(encoderPin2, HIGH); //turn pullup resistor on

//call updateEncoder() when any high/low changed seen
//on interrupt 0 (pin 2), or interrupt 1 (pin 3)
attachInterrupt(0, updateEncoder, CHANGE);
attachInterrupt(1, updateEncoder, CHANGE);

ficeto
@ficeto
May 21 2015 19:15 UTC
@alon24 what version of the IDE are you using?
alon24
@alon24
May 21 2015 19:15 UTC
1.6.4
ficeto
@ficeto
May 21 2015 19:15 UTC
let me check
whi int 0?
int0 is pin 0
attachInterrupt(encoderPin1, updateEncoder, CHANGE);
alon24
@alon24
May 21 2015 19:16 UTC
so can i use other pins? what is the correct line?
ficeto
@ficeto
May 21 2015 19:17 UTC
man... you have interrupt on ALL pins BUT pin 16 and analog input
alon24
@alon24
May 21 2015 19:17 UTC
oh, i am sorry, i did not check to see, i just did the copy/paste - my bad - checking
ficeto
@ficeto
May 21 2015 19:17 UTC
attachInterrupt([pin_number], [function], [type])
alon24
@alon24
May 21 2015 19:20 UTC
this just works well
thanks!
so tonight u add this screen, and u said that ssd1306 was talked about before, a few hours ago.
do u know if it is going to be inserted too soon? when?
ficeto
@ficeto
May 21 2015 19:22 UTC
i have no clue what screen you are talking about at all :)
you talked to somebody else
Markus
@Links2004
May 21 2015 19:22 UTC
its the ili3941 and its done when igrr hast the time to build and upload it
alon24
@alon24
May 21 2015 19:23 UTC
igrr said that there was talk in the gitter about ssd1306
so i asked if anyone knows what the talk was since, the search does not show me that conversation, because I was not a memener
member in the chat
Markus
@Links2004
May 21 2015 19:23 UTC
the ili3941 can be finde here: https://github.com/esp8266/Arduino/tree/esp8266/libraries/Adafruit_ILI9341
for the ssd1306 use the search in gitter ;)
alon24
@alon24
May 21 2015 19:24 UTC
if someone can do a search on the right they will know
ficeto
@ficeto
May 21 2015 19:24 UTC
you have the spi or the i2c version?
why not use the Adafruit's library?
@Links2004 in my latest push :) gzipped content streaming as well
SPIFFS_WebServer.png
alon24
@alon24
May 21 2015 19:26 UTC
i2c
adafruit does not work
ficeto
@ficeto
May 21 2015 19:26 UTC
well you need to comment a few lines
use pin 4 -> sda
pin 5 -> scl
so on
as far as I remember they have TWI = 0; and then restore
alon24
@alon24
May 21 2015 19:27 UTC
@ficeto - do you mean u r adding the lib soon?
ficeto
@ficeto
May 21 2015 19:27 UTC
a few times in the core functions
Markus
@Links2004
May 21 2015 19:27 UTC
@ficeto it is yours, its a merge
ficeto
@ficeto
May 21 2015 19:27 UTC
no did not say such thing
i do not think addition is needed
alon24
@alon24
May 21 2015 19:28 UTC
so which lines to comment out?
ficeto
@ficeto
May 21 2015 19:28 UTC
a small edit on the original one and you can make it work
link me to the library source so i dont need to search for it
@ficeto u mean the adafruit - jas
ficeto
@ficeto
May 21 2015 19:29 UTC
yup
holdon
ficeto
@ficeto
May 21 2015 19:31 UTC
in the cpp file
line 510 and 511
for the SSD lib that is
then line530
in the h file
line 27 from #ifdef SAM3X8E
needs to become
#if defined(__SAM3X8E__) || defined(ESP8266)
that should compile the driver
@Links2004 isn't the GFX lib alredy in?
Markus
@Links2004
May 21 2015 19:35 UTC
no modifications need
ficeto
@ficeto
May 21 2015 19:35 UTC
great then
Markus
@Links2004
May 21 2015 19:35 UTC
works in original version
ficeto
@ficeto
May 21 2015 19:36 UTC
btw did you notice the new tool in the menu :) and the debug screen of the Arduino IDE on my screenshot
alon24
@alon24
May 21 2015 19:36 UTC
so here is my question, if i do this, and i use my ise for both arduino nano and esp dev, it will break the arduino nano use of ssd1306 - right?
ficeto
@ficeto
May 21 2015 19:37 UTC
what?
you want to have twomasters at the same time?
no...
it will work
if you want to ensure thefastest speed instead of commenting you can do the following
Markus
@Links2004
May 21 2015 19:39 UTC
@ficeto yes looking really good, at he weekend i start the implementation for the webSocket server and after the Client.
i today get me 4MB SPI flash, so webserver incomming ;)
can the webserver handle more the one connection at the same time?
ficeto
@ficeto
May 21 2015 19:40 UTC
#if !defined(__SAM3X8E__) && !defined(ESP8266)
@Links2004 no
but it's in the works
Ivan Grokhotkov
@igrr
May 21 2015 19:41 UTC
actually I think I'll take on SSL first
Markus
@Links2004
May 21 2015 19:41 UTC
@ficeto ok so the websocket server will use its own port for the beginning.
ficeto
@ficeto
May 21 2015 19:41 UTC
actually while working on a large request it's easy to brick the esp
Ivan Grokhotkov
@igrr
May 21 2015 19:41 UTC
and async webserver second
ficeto
@ficeto
May 21 2015 19:42 UTC
@Links2004 yes
i tested a telnet server with web server together and got it working
ficeto
@ficeto
May 21 2015 19:49 UTC
here is the telnet to serial part
#include <ESP8266WiFi.h>

#define MAX_SRV_CLIENTS 1
const char* ssid = "nbis-test";
const char* password = "1234567890";

WiFiServer server(21);
WiFiClient serverClients[MAX_SRV_CLIENTS];

void setup() {
  Serial1.begin(115200);
  //Serial1.setDebugOutput(true);
  WiFi.begin(ssid, password);
  Serial1.print("\nConnecting to "); Serial1.println(ssid);
  uint8_t i = 0;
  while (WiFi.status() != WL_CONNECTED && i++ < 20) delay(500);
  if(i == 21){
    Serial1.print("Could not connect to"); Serial1.println(ssid);
    while(1) delay(500);
  }
  Serial.begin(115200);
  server.begin();
  server.setNoDelay(true);
  Serial1.print("Ready! Use 'telnet ");
  Serial1.print(WiFi.localIP());
  Serial1.println(" 21' to connect");
}

void loop() {
  uint8_t i;
  if (server.hasClient()){
    for(i = 0; i < MAX_SRV_CLIENTS; i++){
      if (!serverClients[i] || !serverClients[i].connected()){
        if(serverClients[i]) serverClients[i].stop();
        serverClients[i] = server.available();
        continue;
      }
    }
    //no free spot
    WiFiClient serverClient = server.available();
    serverClient.stop();
  }
  for(i = 0; i < MAX_SRV_CLIENTS; i++){
    if (serverClients[i] && serverClients[i].connected()){
      if(serverClients[i].available()){
        while(serverClients[i].available()) Serial.write(serverClients[i].read());
      }
    }
  }
  if(Serial.available()){
    size_t len = Serial.available();
    uint8_t sbuf[len];
    Serial.readBytes(sbuf, len);
    for(i = 0; i < MAX_SRV_CLIENTS; i++){
      if (serverClients[i] && serverClients[i].connected()){
        serverClients[i].write(sbuf, len);
        delay(1);
      }
    }
  }
}
tested with up to 4 clients
Ivan Grokhotkov
@igrr
May 21 2015 19:51 UTC
that's not bad given that we have 5 TCP connections max :)
ficeto
@ficeto
May 21 2015 19:51 UTC
was lazy to poen more screens :D
the fifth was the http
then removed http and tested how well will the telnet work
Markus
@Links2004
May 21 2015 19:52 UTC
why only 5 connections lwip can normally handle more, limit from espressif?
ficeto
@ficeto
May 21 2015 19:52 UTC
and with this code i got lots through
Ivan Grokhotkov
@igrr
May 21 2015 19:53 UTC
yes that's a limit due to static memory allocation for the TCP stack
we can get over it by building lwIP from source
but I doubt we really need this
Markus
@Links2004
May 21 2015 19:54 UTC
k, i have uIP running on a mega board with more the 5 connections ;)
ficeto
@ficeto
May 21 2015 19:55 UTC
different story because different hardware
can i look at that code btw?
what ethernet controller are you using with it?
enc24j60?
alon24
@alon24
May 21 2015 19:56 UTC

.h file

if defined(SAM3X8E) || defined(ESP8266)

typedef volatile RwReg PortReg;
typedef uint32_t PortMask;

else

typedef volatile uint8_t PortReg;
typedef uint8_t PortMask;

endif

.cpp file
// save I2C bitrate

if !defined(SAM3X8E) && !defined(ESP8266)//#ifndef SAM3X8E

uint8_t twbrbackup = TWBR;
TWBR = 12; // upgrade to 400KHz!

endif

if !defined(SAM3X8E) && !defined(ESP8266)//#ifndef SAM3X8E

TWBR = twbrbackup;

endif

Markus
@Links2004
May 21 2015 19:57 UTC
yes Enc28J60
alon24
@alon24
May 21 2015 19:57 UTC
@ficeto are those the changes need for the ssd1306?
ficeto
@ficeto
May 21 2015 19:57 UTC
yes
read how to paste code
alon24
@alon24
May 21 2015 19:58 UTC
'''
test
'''
test
'''
ficeto
@ficeto
May 21 2015 19:58 UTC
after the commas shift+enter
ficeto
@ficeto
May 21 2015 19:58 UTC
then ctrl+enter to send
alon24
@alon24
May 21 2015 19:59 UTC
test
ficeto
@ficeto
May 21 2015 19:59 UTC
there you go :D
alon24
@alon24
May 21 2015 19:59 UTC
k, sorry about that
its not ' its `
thank you
now. cant i use wire.pins or something to change i2c pins? for sda scl?
ficeto
@ficeto
May 21 2015 20:01 UTC
yes
let me look
Markus
@Links2004
May 21 2015 20:01 UTC
use: wire.begin(sda, scl);
wire.pins are deprecated
Ivan Grokhotkov
@igrr
May 21 2015 20:02 UTC
the idea is that if you just need to change the pins so that the library which uses Wire.begin() will work, it's okay
if you are writing a sketch, use Wire.begin(sda, scl)
perhaps need to remove that deprecation warning so not to scare people
ficeto
@ficeto
May 21 2015 20:03 UTC
hahahaha
Markus
@Links2004
May 21 2015 20:03 UTC
^^
Ivan Grokhotkov
@igrr
May 21 2015 20:04 UTC
or add some #warning there
alon24
@alon24
May 21 2015 20:04 UTC
In file included from C:\Users\ilan\Documents\Arduino\libraries\Adafruit-GFX-Library\Adafruit_GFX.cpp:35:0:
C:\Users\ilan\Documents\Arduino\libraries\Adafruit-GFX-Library\glcdfont.c:8:0: warning: "PROGMEM" redefined [enabled by default]
  #define PROGMEM
 ^
In file included from C:\Users\ilan\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\1.6.4-628-g545ffde\cores\esp8266/Arduino.h:38:0,
                 from C:\Users\ilan\Documents\Arduino\libraries\Adafruit-GFX-Library\Adafruit_GFX.h:5,
                 from C:\Users\ilan\Documents\Arduino\libraries\Adafruit-GFX-Library\Adafruit_GFX.cpp:34:
C:\Users\ilan\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\1.6.4-628-g545ffde\cores\esp8266/pgmspace.h:15:0: note: this is the location of the previous definition
 #define PROGMEM     ICACHE_RODATA_ATTR
 ^
C:\Users\ilan\Documents\Arduino\libraries\Adafruit-GFX-Library\Adafruit_GFX.cpp:39:0: warning: "pgm_read_byte" redefined [enabled by default]
  #define pgm_read_byte(addr) (*(const unsigned char *)(addr))
 ^
In file included from C:\Users\ilan\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\1.6.4-628-g545ffde\cores\esp8266/Arduino.h:38:0,
                 from C:\Users\ilan\Documents\Arduino\libraries\Adafruit-GFX-Library\Adafruit_GFX.h:5,
                 from C:\Users\ilan\Documents\Arduino\libraries\Adafruit-GFX-Library\Adafruit_GFX.cpp:34:
C:\Users\ilan\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\1.6.4-628-g545ffde\cores\esp8266/pgmspace.h:63:0: note: this is the location of the previous definition
 #define pgm_read_byte(addr)                                              \
 ^
C:\Users\ilan\Documents\Arduino\libraries\Adafruit_SSD1306\Adafruit_SSD1306.cpp:19:26: fatal error: avr/pgmspace.h: No such file or directory
 #include <avr/pgmspace.h>
                          ^
compilation terminated.
Error compiling.
Markus
@Links2004
May 21 2015 20:04 UTC
the #warning will also be trigger if the function is not used
Ivan Grokhotkov
@igrr
May 21 2015 20:04 UTC
right
@alon24 as a temporary workaround, replace avr/pgmspace.h with pgmspace.h
i'll move the file in the next commit
Markus
@Links2004
May 21 2015 20:06 UTC
@alon24 you have an old version of the GFX
https://github.com/adafruit/Adafruit-GFX-Library/
is working fine without changes
alon24
@alon24
May 21 2015 20:12 UTC
@Links2004 took it, not compiling without changes
Markus
@Links2004
May 21 2015 20:13 UTC
have it running here what for errors you get ?
alon24
@alon24
May 21 2015 20:13 UTC

In file included from C:\Users\ilan\Documents\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_GFX.cpp:35:0:
C:\Users\ilan\Documents\Arduino\libraries\Adafruit-GFX-Library-master\glcdfont.c:8:0: warning: "PROGMEM" redefined [enabled by default]
  #define PROGMEM
 ^
In file included from C:\Users\ilan\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\1.6.4-628-g545ffde\cores\esp8266/Arduino.h:38:0,
                 from C:\Users\ilan\Documents\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_GFX.h:5,
                 from C:\Users\ilan\Documents\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_GFX.cpp:34:
C:\Users\ilan\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\1.6.4-628-g545ffde\cores\esp8266/pgmspace.h:15:0: note: this is the location of the previous definition
 #define PROGMEM     ICACHE_RODATA_ATTR
 ^
C:\Users\ilan\Documents\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_GFX.cpp:39:0: warning: "pgm_read_byte" redefined [enabled by default]
  #define pgm_read_byte(addr) (*(const unsigned char *)(addr))
 ^
In file included from C:\Users\ilan\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\1.6.4-628-g545ffde\cores\esp8266/Arduino.h:38:0,
                 from C:\Users\ilan\Documents\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_GFX.h:5,
                 from C:\Users\ilan\Documents\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_GFX.cpp:34:
C:\Users\ilan\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\1.6.4-628-g545ffde\cores\esp8266/pgmspace.h:63:0: note: this is the location of the previous definition
 #define pgm_read_byte(addr)                                              \
 ^
C:\Users\ilan\Documents\Arduino\libraries\Adafruit_SSD1306\Adafruit_SSD1306.cpp:21:25: fatal error: util/delay.h: No such file or directory
  #include <util/delay.h>
                         ^
compilation terminated.
Error compiling.
Markus
@Links2004
May 21 2015 20:13 UTC
the problem is in the Adafruit_SSD1306.cpp
alon24
@alon24
May 21 2015 20:14 UTC
oh
so change there
jas
#include "pgmspace.h"
#ifndef __SAM3X8E__
 #include <util/delay.h>
#endif
jas
Markus
@Links2004
May 21 2015 20:16 UTC

ok for removing the warnings simply

#ifndef pgm_read_byte
 #define pgm_read_byte(addr) (*(const unsigned char *)(addr))
#endif

and

#ifndef PROGMEM
 #define PROGMEM
#endif
Markus
@Links2004
May 21 2015 20:24 UTC

wow espressif did crazy stuff

#define MEMP_NUM_TCP_PCB                    (*((volatile uint32*)0x600011FC))

butt still is 5.

alon24
@alon24
May 21 2015 20:30 UTC
It appears I did not save before, so now I am getting this:

In file included from ssd1306_128x64_i2c.ino:22:0:
C:\Users\ilan\Documents\Arduino\libraries\Adafruit_SSD1306/Adafruit_SSD1306.h:28:19: error: 'RwReg' does not name a type
  typedef volatile RwReg PortReg;
                   ^
C:\Users\ilan\Documents\Arduino\libraries\Adafruit_SSD1306/Adafruit_SSD1306.h:164:3: error: 'PortReg' does not name a type
   PortReg *mosiport, *clkport, *csport, *dcport;
   ^
Error compiling
alon24
@alon24
May 21 2015 20:36 UTC
h file

#if defined(__SAM3X8E__) || defined(ESP8266)// #ifdef __SAM3X8E__
 typedef volatile RwReg PortReg;
 typedef uint32_t PortMask;
#else
  typedef volatile uint8_t PortReg;
  typedef uint8_t PortMask;
#endif
it seems that if denied esp8266 then it does not know RwReg here and PortReg
Removing the defined(esp8266) here gives an error:
In file included from C:\Users\ilan\Documents\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_GFX.cpp:35:0:
C:\Users\ilan\Documents\Arduino\libraries\Adafruit-GFX-Library-master\glcdfont.c:8:0: warning: "PROGMEM" redefined [enabled by default]
  #define PROGMEM
 ^
In file included from C:\Users\ilan\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\1.6.4-628-g545ffde\cores\esp8266/Arduino.h:38:0,
                 from C:\Users\ilan\Documents\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_GFX.h:5,
                 from C:\Users\ilan\Documents\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_GFX.cpp:34:
C:\Users\ilan\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\1.6.4-628-g545ffde\cores\esp8266/pgmspace.h:15:0: note: this is the location of the previous definition
 #define PROGMEM     ICACHE_RODATA_ATTR
 ^
C:\Users\ilan\Documents\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_GFX.cpp:39:0: warning: "pgm_read_byte" redefined [enabled by default]
  #define pgm_read_byte(addr) (*(const unsigned char *)(addr))
 ^
In file included from C:\Users\ilan\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\1.6.4-628-g545ffde\cores\esp8266/Arduino.h:38:0,
                 from C:\Users\ilan\Documents\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_GFX.h:5,
                 from C:\Users\ilan\Documents\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_GFX.cpp:34:
C:\Users\ilan\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\1.6.4-628-g545ffde\cores\esp8266/pgmspace.h:63:0: note: this is the location of the previous definition
 #define pgm_read_byte(addr)                                              \
 ^
C:\Users\ilan\Documents\Arduino\libraries\Adafruit_SSD1306\Adafruit_SSD1306.cpp:21:25: fatal error: util/delay.h: No such file or directory
  #include <util/delay.h>
                         ^
compilation terminated.
Error compiling.
alon24
@alon24
May 21 2015 20:42 UTC
I already added the 

#ifndef pgm_read_byte
 #define pgm_read_byte(addr) (*(const unsigned char *)(addr))
#endif

#ifndef PROGMEM
 #define PROGMEM
#endif

to the cpp, maybe uit should be in the h file
i am going to bed, i give up for today - thanks for the help
alon24
@alon24
May 21 2015 21:10 UTC
hey, if anyone can just do the changes for sdd1306 and post them somewhere, that would be gr8. if not tomorrow is a new day. I will try again.