Chat freely about anything...

User avatar
By Andre58
#15032
Rudolf wrote:Hello Andre58,

Unfortunately the standard baud rate was set to 74880 baud.
The transparent bridge software allows AT commands from the telnet side only.
Have a look in your WLAN router, if your ESP8266 is seen, and an IP address is provided via DHCP.
If so, you can telnet to the ESP8266 and set the baud rate via AT command. Have a look also at:
http://www.rudiswiki.de/wiki9/WiFi2AT-ESP8266

If you have no IP address, flash a standard firmware >=0 0.9.2 and set the WiFi parameters.
Those parameters are kept in flash ROM, even if you change the firmware.
Then you can flash again the transparent bridge firmware.

Regards, Rudolf


Rudolf,

Thanks very much for your help.
Did exactly as you said, and it works fine now.
I can use the ESP module now on both Arduino and PIC processors without any configuration or library.
User avatar
By andrew melvin
#15547 This is class..

Trying to get it to play ball with esptool.py... not having much luck...

The following scout command gets a tty instance that works.. I received terminal commands and can issue them... so it WORKS...

sudo ./socat -d -d pty,link=/dev/tty.tcp,ignoreeof,user=abc,group=tty,mode=777,raw,echo=0 tcp:192.168.1.156:23

BUT...

I get this error when i try to flash anything... any ideas...
Code: Select allTraceback (most recent call last):
  File "/Users/amelvin/git/Arduino/build/Arduino.app/Contents/Java/hardware/tools/esp8266/pyesptool/esptool.py", line 471, in <module>
    esp.connect()
  File "/Users/amelvin/git/Arduino/build/Arduino.app/Contents/Java/hardware/tools/esp8266/pyesptool/esptool.py", line 133, in connect
    self._port.setRTS(True)
  File "/Library/Python/2.7/site-packages/serial/serialposix.py", line 554, in setRTS
    fcntl.ioctl(self.fd, TIOCMBIS, TIOCM_RTS_str)
IOError: [Errno 25] Inappropriate ioctl for device
User avatar
By dacb
#15833
jvandenbroek wrote:I haven't actually any experience with C coding, but I just did something by trial and error, based on many examples around and it actually works! It's probably a very ugly hack, but I don't care :lol: You can find my fork of this repository on https://github.com/jvandenbroek/ESP8266 ... ent-bridge with GPIO2 switching option. Just flash the 2 bin files in the firmware folder and you're good to go.

Usage is simple:
Code: Select all+++AT GPIO2 <1|0>                        # set GPIO2 pin HIGH or LOW (1/0)


Nothing else has changed.
Enjoy!


Nice work. Can you submit a pull request?
User avatar
By eriksl
#16013 This really great stuff! I have been looking for a long time for something like this.

I have a couple of atmega328's (no arduino!) previously connected to enc28j60's (ethernet transceiver) which I am in the process of replacing with esp8266's.

I have it more or less working, but it's never 100% stable like I was used to with the enc28j60's. Especially when you "fire" a lot of data (either in separate connections or in one) to the device, all goes wrong. For a part that's due to the esp not releasing a tcp connection quick enough, so the available number of the tcp connections (4) get filled up real quickly, even though only one connection is required. Some firmwares support udp, which is good for my use, but there are problems with that to; it also counts as a tcp connection and replies don't always go to right address/port combination.

Besides that all, it's very hard to make a fail-safe state machine (especially with the little resources on the atmega328). Sooner or later an +IPD message will cross regular at-command exchange and the state machine will be completely borked. Also I suspect that sometimes uart bytes are dropped by bad framing, because this particular board doesn't have a crystal (yet...).

I now totally worked around it by using timeouts and other workarounds for esp bugs and it now more or less works and keeps working, if you keep the data rate low (i.e. wait 0.2 second between two transmissions). If stuff gets weird, the state machine gets reset rather quickly so there is no hanging/freezing, which I experienced earlier.

BUT the transparent bridge seems to solve all of this. I am now running a test where I send data to esp8266 with the bridge firmware, continuously without delays, and it just works. No hangs, no data loss, just great. I can remove a few hundred lines of code from the atmega328 now :-)

I have one request though, I know it's not peanuts, but at least I would like to have it mentioned.

Communication via UART is very cumbersome for a simple microcontroller like the atmega328. Due to the asynchronous nature, data can come in at any moment, unsollicited. That's not optimal. Also it requires the use of an external crystal which is not always possible.

To overcome above two issues, I would request to use SPI instead. It works synchronously (no crystal required) and also always sollicited. The enc28j60 works that way and it works quite well.

I know that the esp8266 has a hardware SPI implementation, but we probably can't use it, because it's used to address the flash memory. Also it's on the wrong pins. I was thinking of an SPI emulation over de U(S)ART. Depending on the U(S)ART that can be very simple or a somewhat less simple.

The atmega328 has an USART that can be configure as second SPI interface and it will do SPI over the USART just fine. I was hoping the esp8266 has a similar mode in the U(S)ART.

If not, if it supports synchronous mode (USART), it wouldn't too hard to implement also, iirc, hook up the spi clock to the usart clock and we should be almost done already. Otherwise it would get a bit hairy I think, a software SPI implementation with a pin change interrupt :-/

Afaik there is at least one free pin on every esp, to be used as clock. There would be no slave select, but with only one device, it's not really required imho.

Anyone wanting to brainstorm about this please welcome ;-)