Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By tytower
#17944 OK it seems that the latest Ardino IDE 1.6.4 nightly build has been altered to load the library by a json file and I suspect that they have changed the pin assignments to follow the GPIO numbering so to use DHT for example normally on arduino pin 2 now you use GPIO2

If I am right ( and I have an ESP-12 board running with a DHT that way right now ) then the other pins have probably been changed to match the board so pin 6 would be GPIO6 . I have not got a BMP180 running on I2C pins which should then be GPIO 4 and 5.

Anybody concur?
User avatar
By tytower
#18123
martinayotte wrote:@tytower, check my post at viewtopic.php?f=28&t=2991#p17753
you can either continue to use the deprecated Wire.pins or applying the fix I did in Wire.cpp :
Code: Select allvoid TwoWire::begin(int sda, int scl){
+  default_sda_pin = sda;
+  default_scl_pin = scl;
  twi_init(sda, scl);   
  flush();
}

I find that interesting .
I looked in the Wire library which is now in /hardware/arduino/avr/libraries just to confuse things .
I found no function "void TwoWire::begin(int sda, int scl)" but using Wire.begin(sda,scl); is recognised in the IDE 1.6.4.so I don't follow why it recognises it
I put the above in the .cpp file and in the .h file and it made no difference. It didn't complain of being defined twice either so I am wondering why. Wire is defined to be TwoWire of course

Wire.pins(sda,scl); will also compile but does not show as recognised in the IDE. Playing around with that and with Wire.setClock(Varius speeds ie40000); I could not get my device to work on pins 4 and 5 at all


Seems to be an issue being resolved on github now https://github.com/esp8266/Arduino/issues/254
I put my bit in if it helps
User avatar
By martinayotte
#18174
tytower wrote:I looked in the Wire library which is now in /hardware/arduino/avr/libraries just to confuse things .
I found no function "void TwoWire::begin(int sda, int scl)"

Why are you looking at the AVR version of Wire ?
The ESP version should be in this path arduino-1.6.1/hardware/esp8266com/esp8266/libraries/Wire/Wire.cpp ...
User avatar
By tytower
#18200
martinayotte wrote:
tytower wrote:I looked in the Wire library which is now in /hardware/arduino/avr/libraries just to confuse things .
I found no function "void TwoWire::begin(int sda, int scl)"

Why are you looking at the AVR version of Wire ?
The ESP version should be in this path arduino-1.6.1/hardware/esp8266com/esp8266/libraries/Wire/Wire.cpp ...

Well things have changed with IDE 1.6.4. The ESP stuff is brought down with a json file from the repo and it says it updates at startup . The above was the only Wire library I could find so I assumed that must be the culprit.
Starting with 1.6.4, Arduino allows installation of third-party platform packages using Boards Manager.

I see in the issues of ESP8266/Arduino that there was an error in the I2C protocol which has been fixed now so I am just trying to get the "fix" atm and see if it gets mine running.
https://github.com/esp8266/Arduino/issues/254#issuecomment-104646380
Last edited by tytower on Fri May 22, 2015 4:06 pm, edited 2 times in total.