Shop OBEX P1 Docs P2 Docs Learn Events
Low cost wifi module ESP8266 - Page 16 — Parallax Forums

Low cost wifi module ESP8266

11213141618

Comments

  • David Betz wrote: »
    You'll need to connect GPIO12 to reset on the Propeller as well as DI and DO to pins 31 and 30 to get the loader to work.


    You read my mind, I was parsing the various code for exactly this info..... thank you.
  • pmrobertpmrobert Posts: 669
    edited 2016-11-02 20:48
    Sorry, I didn't read this very well. What are you trying to do? The Pimoroni Hat is a board for the RaspberryPi. What does it have to do with the ESP8266 which is what we're talking about here. In any case, there is a command line option in proploader to select the GPIO used for reset for serial downloads on a RaspberryPi. There is currently no board configuration option but it could be added.
    My apologies; fingers engaged before brain in gear. GPIO12 you refer to is the GPIO on the 8266 - I get it now. Pi talks to ESP8266 which then programs Prop, correct?
  • Yes, a Pi could talk to the ESP8266 over a wi-fi connection.
  • David BetzDavid Betz Posts: 14,511
    edited 2016-11-02 20:59
    FYI, you can change the GPIO pin used by the ESP by using these shell commands:
    IP=192.168.4.1
    curl -XPOST $IP/wx/setting?name=reset-pin\&value=15
    curl -XPOST $IP/wx/save-settings
    
    Of course, set IP to the IP address of your ESP. And change 15 to the GPIO you want to use.
  • David Betz wrote: »
    FYI, you can change the GPIO pin used by the ESP by using these shell commands:
    IP=192.168.4.1
    curl -XPOST $IP/wx/setting?name=reset-pin\&value=15
    curl -XPOST $IP/wx/save-settings
    
    Of course, set IP to the IP address of your ESP. And change 15 to the GPIO you want to use.

    Does this work with the TX and RX pins also?
    I seem to be having trouble using the DI and DO pins, when I put an o-scope on those pins, I am getting static (as in high frequency noise) ,, And when I connect my prop to the DI and DO pins, the esp drops its wifi connection immediately.

    I figured id try some other pins.
  • David BetzDavid Betz Posts: 14,511
    edited 2016-11-04 23:36
    Clock Loop wrote: »
    David Betz wrote: »
    FYI, you can change the GPIO pin used by the ESP by using these shell commands:
    IP=192.168.4.1
    curl -XPOST $IP/wx/setting?name=reset-pin\&value=15
    curl -XPOST $IP/wx/save-settings
    
    Of course, set IP to the IP address of your ESP. And change 15 to the GPIO you want to use.

    Does this work with the TX and RX pins also?
    I seem to be having trouble using the DI and DO pins, when I put an o-scope on those pins, I am getting static (as in high frequency noise) ,, And when I connect my prop to the DI and DO pins, the esp drops its wifi connection immediately.

    I figured id try some other pins.
    It only works with DI and DO. You might have to enable the internal pullup on the RX pin. You can do it like this:
    curl -XPOST $1/wx/setting?name=rx-pullup\&value=1
    curl -XPOST $IP/wx/save-settings
    
  • Clock LoopClock Loop Posts: 2,069
    edited 2016-11-04 23:43
    When I connect my props RX pin, it causes the esp to generate error info in a repeated loop out the serial port.
    2nd boot version : 1.6
    
      SPI Speed      : 80MHz
    
      SPI Mode       : QIO
    
      SPI Flash Size & Map: 32Mbit(512KB+512KB)
    
    jump to run user1 @ 1000
    
    
    
    Fatal exception 28(LoadProhibitedCause):
    
    epc1=0x40217dee, epc2=0x00000000, epc3=0x00000000, excvaddr=0x0000016c, depc=0x00000000
    
    
    
     ets Jan  8 2013,rst cause:4, boot mode:(3,6)
    
    
    
    wdt reset
    
    load 0x40100000, len 2408, room 16
    
    tail 8
    
    chksum 0xe5
    
    load 0x3ffe8000, len 776, room 0
    
    tail 8
    
    chksum 0x84
    
    load 0x3ffe8310, len 632, room 0
    
    tail 8
    
    chksum 0xd8
    
    csum 0xd8
    

    I'll try to do the pullup.
    As soon as I pull the wire to P31 on the prop (DI on the esp) the error output from the esp serial port immediately stops, and the esp reconnects to my network.
  • David BetzDavid Betz Posts: 14,511
    edited 2016-11-04 23:44
    Clock Loop wrote: »
    When I connect my props RX pin, it causes the esp to generate error info in a repeated loop out the serial port.
    2nd boot version : 1.6
    
      SPI Speed      : 80MHz
    
      SPI Mode       : QIO
    
      SPI Flash Size & Map: 32Mbit(512KB+512KB)
    
    jump to run user1 @ 1000
    
    
    
    Fatal exception 28(LoadProhibitedCause):
    
    epc1=0x40217dee, epc2=0x00000000, epc3=0x00000000, excvaddr=0x0000016c, depc=0x00000000
    
    
    
     ets Jan  8 2013,rst cause:4, boot mode:(3,6)
    
    
    
    wdt reset
    
    load 0x40100000, len 2408, room 16
    
    tail 8
    
    chksum 0xe5
    
    load 0x3ffe8000, len 776, room 0
    
    tail 8
    
    chksum 0x84
    
    load 0x3ffe8310, len 632, room 0
    
    tail 8
    
    chksum 0xd8
    
    csum 0xd8
    

    I'll try to do the pullup.
    Are you sure you have the DO pin connected and not the debug pin? It looks like you're getting debug output (GPIO2). RX is GPIO1 and TX is GPIO3.

  • David Betz wrote: »
    Are you sure you have the DO pin connected and not the debug pin? It looks like you're getting debug output (GPIO2). RX is GPIO1 and TX is GPIO3.

    I have a proptool connected to RX-GPIO1 and TX-GPIO3 on the esp for debug display also.


    My propeller chip's P31 is connected to DI, and the P30 is connected to D0, the props reset is connected to GPIO12 on the esp.

    propesp.jpg
    1306 x 979 - 653K
  • P31 is RX on the Propeller so it seems like it should be connected to DO on the ESP.
  • yetiyeti Posts: 818
    edited 2016-11-05 00:37
    I think you connect to the SD_xx pins which interferes with the flash chip.
  • Clock LoopClock Loop Posts: 2,069
    edited 2016-11-05 00:43
    David Betz wrote: »
    P31 is RX on the Propeller so it seems like it should be connected to DO on the ESP.
    I swapped my props RX (P31) to connect to DO, and still nothing.

    yeti wrote: »
    I think you connect to the SD_xx pins which interferes with the flash chip.

    It seems you are right when I scope it out.
    Red is DI and Blue is D0.
    Thats some seriously high frequency analog noise, coming from the di/do and it seems to be slightly mirrored. 20us is the scope timing.
    oscope1.gif
    837 x 482 - 155K
  • I think the ESP blasts out some high baud rate stuff when it boots. I don't think there is anything you can do about that.
  • Clock LoopClock Loop Posts: 2,069
    edited 2016-11-05 00:57
    David Betz wrote: »
    I think the ESP blasts out some high baud rate stuff when it boots. I don't think there is anything you can do about that.

    I am seeing this constantly, even after boot up, i can communicate with the Parallax Wi-Fi Module Configuration page while the esp is also constantly putting this noise on the DI/DO lines.

    I have two of these red dev esp boards, and they both do the same exact thing. I know they work because they connect to my wifi and i can access the Parallax Wi-Fi Module Configuration page.
    pi@PiDev:~ $ proploader -W
    Name: 'wx-eeeeee, IP: 192.168.0.5, MAC: ee:ee:ee:ee:ee:ee
    pi@PiDev:~ $ proploader blink.spin
    Loading 'blink.spin'
    error: failed to load image 'blink.spin'
    error: load failed: -1
    

    Even when I completely disconnect my prop from the esp, the DI and DO lines are still very noisy, constantly.
  • Clock Loop wrote: »
    David Betz wrote: »
    I think the ESP blasts out some high baud rate stuff when it boots. I don't think there is anything you can do about that.

    I am seeing this constantly, even after boot up, i can communicate with the Parallax Wi-Fi Module Configuration page while the esp is also constantly putting this noise on the DI/DO lines.

    I have two of these red dev esp boards, and they both do the same exact thing. I know they work because they connect to my wifi and i can access the Parallax Wi-Fi Module Configuration page.
    pi@PiDev:~ $ proploader -W
    Name: 'wx-eeeeee, IP: 192.168.0.5, MAC: ee:ee:ee:ee:ee:ee
    pi@PiDev:~ $ proploader blink.spin
    Loading 'blink.spin'
    error: failed to load image 'blink.spin'
    error: load failed: -1
    

    Even when I completely disconnect my prop from the esp, the DI and DO lines are still very noisy, constantly.
    You enabled the RX pull-up? I'm sorry but I haven't seen this behavior.

  • Clock LoopClock Loop Posts: 2,069
    edited 2016-11-05 01:12
    David Betz wrote: »
    You enabled the RX pull-up? I'm sorry but I haven't seen this behavior.


    It seems the pull up settings have no difference in the DI and DO lines when the following code is run.
    I don't see the wire on the scope going high in between the noise.
    pi@PiDev:~ $ proploader -W
    Name: 'wx-xxxxxx', IP: 192.168.1.147, MAC: xx:xx:xx:xx:xx:xx
    pi@PiDev:~ $ proploader blink.spin
    Loading 'blink.spin'
    error: failed to load image 'blink.spin'
    error: load failed: -1
    pi@PiDev:~ $ IP=192.168.1.147
    pi@PiDev:~ $ curl -XPOST $IP/wx/setting?name=rx-pullup\&value=1
    pi@PiDev:~ $ curl -XPOST $IP/wx/save-settings
    pi@PiDev:~ $ curl -XPOST $IP/wx/setting?name=rx-pullup\&value=0
    pi@PiDev:~ $ curl -XPOST $IP/wx/save-settings
    pi@PiDev:~ $ curl -XPOST $IP/wx/setting?name=rx-pullup\&value=1
    pi@PiDev:~ $ curl -XPOST $IP/wx/save-settings
    


  • Clock Loop wrote: »
    David Betz wrote: »
    You enabled the RX pull-up? I'm sorry but I haven't seen this behavior.


    It seems the pull up settings have no difference in the DI and DO lines when the following code is run.
    I don't see the wire on the scope going high in between the noise.
    pi@PiDev:~ $ proploader -W
    Name: 'wx-xxxxxx', IP: 192.168.1.147, MAC: xx:xx:xx:xx:xx:xx
    pi@PiDev:~ $ proploader blink.spin
    Loading 'blink.spin'
    error: failed to load image 'blink.spin'
    error: load failed: -1
    pi@PiDev:~ $ IP=192.168.1.147
    pi@PiDev:~ $ curl -XPOST $IP/wx/setting?name=rx-pullup\&value=1
    pi@PiDev:~ $ curl -XPOST $IP/wx/save-settings
    pi@PiDev:~ $ curl -XPOST $IP/wx/setting?name=rx-pullup\&value=0
    pi@PiDev:~ $ curl -XPOST $IP/wx/save-settings
    pi@PiDev:~ $ curl -XPOST $IP/wx/setting?name=rx-pullup\&value=1
    pi@PiDev:~ $ curl -XPOST $IP/wx/save-settings
    

    What gets printed out on the DBG pin? The firmware prints lots of progress messages.

  • Clock LoopClock Loop Posts: 2,069
    edited 2016-11-05 01:28
    David Betz wrote: »
    What gets printed out on the DBG pin? The firmware prints lots of progress messages.

    Seriously? I get no output from the DBG pin(assuming you mean the esp's TX and RX pins (the ones used to program the esp firmware). But the Parallax Wi-Fi Module Configuration page works.

    If I am supposed to be getting constant output from the DBG pin, then something is wrong here.

    I noticed in the instructions here at the bottom, https://github.com/parallaxinc/Parallax-ESP/blob/master/README.md
    The 2nd step is to pack the static files the webserver will serve and flash that. Reset the module into bootloader mode again and enter make htmlflash.
    

    It says enter make htmlflash, but that doesn't work for me.
    Should this step be removed from the readme file?

    My flash seems to go fine with just 'make flash'
    The Parallax Wi-Fi Module Configuration webpage and sta-ap wifi connections work fine after doing just 'make flash'

  • Clock Loop wrote: »
    David Betz wrote: »
    What gets printed out on the DBG pin? The firmware prints lots of progress messages.

    Seriously? I get no output from the DBG pin(assuming you mean the esp's TX and RX pins (the ones used to program the esp firmware). But the Parallax Wi-Fi Module Configuration page works.

    If I am supposed to be getting constant output from the DBG pin constantly, then something is wrong here.
    The DBG pin is GPIO2. Try connecting a PropPlug to it and tell me what you see.

  • David Betz wrote: »
    The DBG pin is GPIO2. Try connecting a PropPlug to it and tell me what you see.

    Oh well look at that, thats nice to know. Lots of info here.
                Flash config restore ok
    
    Reset Pin: 12
    
    RX Pullup: 0
    
    DISCOVER: initialized
    
    Version v1.0.0-15 (2016-11-01 12:48:51 g0e22344)
    
    mount: flash ID xxxxxxxx
    
    mount: flash filesystem mounted at 00100000
    
    Flash filesystem mounted!
    
    Httpd init
    
    
    
    Ready
    
    mode : sta(xx:xx:xx:xx:xx:xx)
    
    add if0
    
    scandone
    
    state: 0 -> 2 (b0)
    
    state: 2 -> 3 (0)
    
    state: 3 -> 5 (10)
    
    add 0
    
    aid 1
    
    cnt
    
    
    
    connected with UFO, channel 7
    
    dhcp client start...
    
    ip:192.168.0.147,mask:255.255.255.0,gw:192.168.0.1
    
    pm open,type:2 0      
    

    Then I loaded the Parallax Wi-Fi Module Configuration webpage in my browser, and the DBG port spit this.
    Conn req from  192.168.0.102:56122, using pool slot 0
    
    URL = /
    
    Is url index 0
    
    Is url index 1
    
    Pool slot 0 is done. Closing.
    
    Pool slot 0: socket closed.
    
    Conn req from  192.168.0.102:56124, using pool slot 0
    
    URL = /wx/setting?name=module-name
    
    GET args = name=module-name
    
    Is url index 0
    
    Is url index 21
    
    GET 'module-name' --> 'wx-xxxxxx'
    
    Pool slot 0 is done. Closing.
    
    Pool slot 0: socket closed.
    
    Conn req from  192.168.0.102:56125, using pool slot 0
    
    URL = /wx/setting?name=version
    
    GET args = name=version
    
    Is url index 0
    
    Is url index 21
    
    GET 'version' --> 'v1.0.0-15 (2016-11-01 12:48:51 g0e22344)'
    
    Pool slot 0 is done. Closing.
    
    Pool slot 0: socket closed.
    

    Then i issued this command in my pi.
    proploader -W but the dbg port didn't spit anything.

    So then i issued this command in my pi.
    pi@PiDev:~/PropLoader $ proploader blink.spin
    Loading 'blink.spin'
    Loading second-stage loader
    error: load failed: -1
    

    And the dbg port spit this:
    Conn req from  192.168.0.135:43600, using pool slot 0
    
    URL = /wx/setting?name=version
    
    GET args = name=version
    
    Is url index 0
    
    Is url index 21
    
    GET 'version' --> 'v1.0.0-15 (2016-11-01 12:48:51 g0e22344)'
    
    Pool slot 0 is done. Closing.
    
    Pool slot 0: socket closed.
    
    Conn req from  192.168.0.135:43602, using pool slot 0
    
    URL = /wx/setting?name=baud-rate&value=115200
    
    GET args = name=baud-rate&value=115200
    
    Is url index 0
    
    Is url index 21
    
    SET 'baud-rate' to '115200'UART: 115200 baud, 1 stop bit
    
     --> OK
    
    Pool slot 0 is done. Closing.
    
    Pool slot 0: socket closed.
    
    Conn req from  192.168.0.135:43604, using pool slot 0
    
    URL = /propeller/load?baud-rate=115200&response-size=8&response-timeout=1000
    
    GET args = baud-rate=115200&response-size=8&response-timeout=1000
    
    Mallocced buffer for 392 + 1 bytes of post data.
    
    Is url index 0
    
    Is url index 17
    
    load: size 392, baud-rate 115200, final-baud-rate 115200, reset-pin 12
    
      responseSize 8, responseTimeout 1000
    
    Pool slot 0 is done. Closing.
    
    Pool slot 0: socket closed.
    

    Then I issued this in my PI
    pi@PiDev:~/PropLoader $ curl -XPOST $IP/wx/setting?name=rx-pullup\&value=1
    pi@PiDev:~/PropLoader $ curl -XPOST $IP/wx/save-settings

    And the dbg port spit this
    Conn req from  192.168.0.135:43606, using pool slot 0
    
    URL = /wx/setting?name=rx-pullup&value=1
    
    GET args = name=rx-pullup&value=1
    
    Is url index 0
    
    Is url index 21
    
    SET 'rx-pullup' to '1' --> OK
    
    Pool slot 0 is done. Closing.
    
    Pool slot 0: socket closed.
    
    Conn req from  192.168.0.135:43608, using pool slot 0
    
    URL = /wx/save-settings
    
    Is url index 0
    
    Is url index 22
    
    Pool slot 0 is done. Closing.
    
    Pool slot 0: socket closed.
    

    I then tried again to upload my blink.spin file with the rx pull up.
    pi@PiDev:~/PropLoader $ proploader blink.spin
    Loading 'blink.spin'
    Loading second-stage loader
    error: load failed: -1
    

    The dbg pin shows this:
    Conn req from  192.168.0.135:43614, using pool slot 0
    
    URL = /wx/setting?name=version
    
    GET args = name=version
    
    Is url index 0
    
    Is url index 21
    
    GET 'version' --> 'v1.0.0-15 (2016-11-01 12:48:51 g0e22344)'
    
    Pool slot 0 is done. Closing.
    
    Pool slot 0: socket closed.
    
    Conn req from  192.168.0.135:43616, using pool slot 0
    
    URL = /wx/setting?name=baud-rate&value=115200
    
    GET args = name=baud-rate&value=115200
    
    Is url index 0
    
    Is url index 21
    
    SET 'baud-rate' to '115200' --> OK
    
    Pool slot 0 is done. Closing.
    
    Pool slot 0: socket closed.
    
    Conn req from  192.168.0.135:43618, using pool slot 0
    
    URL = /propeller/load?baud-rate=115200&response-size=8&response-timeout=1000
    
    GET args = baud-rate=115200&response-size=8&response-timeout=1000
    
    Mallocced buffer for 392 + 1 bytes of post data.
    
    Is url index 0
    
    Is url index 17
    
    load: size 392, baud-rate 115200, final-baud-rate 115200, reset-pin 12
    
      responseSize 8, responseTimeout 1000
    
    Pool slot 0 is done. Closing.
    
    Pool slot 0: socket closed.
    


  • ummm... I think your problem is that you can't load .spin files. You can only load .binary files. You'll have to use OpenSpin or Propeller Tool to compile the Spin code into a .binary file before trying to load it.
  • David Betz wrote: »
    ummm... I think your problem is that you can't load .spin files. You can only load .binary files. You'll have to use OpenSpin or Propeller Tool to compile the Spin code into a .binary file before trying to load it.

    WTF? lol

    Well, at least the reset line shows as working.
    reset.jpg

    Now I will try a binary file.
    638 x 509 - 164K
  • Another suggestion, add -v to your proploader command line for verbose output.
  • None of this is working, during all of this testing and trying different things, the DI and DO lines on the ESP are constantly showing bad noise, and when I give a program command.
     proploader blink.binary
    Loading 'blink.binary'
    Loading second-stage loader
    error: load failed: -1
    

    The DI and DO lines DO NOT show 115200 baud rate data at all. They just keep showing bad high frequency noise.

    The DI and DO lines should not be doing this kind of noise if you are using the di and do for loading the propeller code, they should be showing nice and square pulses..
    but im still getting this no matter what i try here.
    oscope1.gif


    I am going to wire up my other esp module, that is from a different manufacturer. (totally different dev pcb)
  • I don't know what is happening. As I've said, I've never seen that behavior. I have used a module that Parallax is making as well as one I bought off the internet. In fact, I think I've tried two I got off the internet. These two:

    https://www.itead.cc/wiki/Wee_Serial_WIFI_Module
    https://www.amazon.com/HiLetgo-ESP8266-ESP-01-Wireless-Transceiver/dp/B00NF0FCW8

    I have to admit that I haven't tried the ESP-01 in quite some time but it did work when I originally used it.
  • Sorry, I'm signing off for the night. I'll check this thread in the morning. Good luck!
  • Clock LoopClock Loop Posts: 2,069
    edited 2016-11-05 02:48
    David Betz wrote: »
    Sorry, I'm signing off for the night. I'll check this thread in the morning. Good luck!

    Thanks for the help.

    YETI had solved the problem in a PM with me.

    The issue is that you CANNOT connect to the DI and DO lines on the ESP. I assumed you meant the SD_D0 and the SD_D1 wires that the esp uses to load from its flash chip.

    After trying what yeti suggested, connecting the propeller chip to the ONLY UART the esp has, (aka gpio1 and gpio3, the prop loads the test blink program.

    I DID need to compile the blink.spin into blink.binary to get it to load also.
    pi@PiTest:~/PropLoader $ openspin blink.spin -b
    Propeller Spin/PASM Compiler 'OpenSpin' (c)2012-2016 Parallax Inc. DBA Parallax Semiconductor.
    Version 1.00.80 Compiled on Oct 30 2016 20:08:38
    Compiling...
    blink.spin
    Done.
    Program size is 136 bytes
    pi@PiTest:~/PropLoader $ proploader blink.binary
    Loading 'blink.binary'
    Loading second-stage loader
    Loading image.
    Verifying RAM
    Sending readyToLaunch packet
    Sending launchNow packet
    

    To show the correct wiring, I will post the correct wiring screenshot now.
  • PROPer wiring. A.k.a. DO NOT connect to the D1 and D0 lines (the ones the flash chip is using)
    Connect to the RX and TX lines on the esp.
    The same lines you use to program the esp, are the ones you use to connect to your prop chip.
    PROPer.jpg
    816 x 612 - 329K
  • This is EXCELLENT. Now I can move ahead with my project.

    And post it in the prop forums, very soon.

    Thank you david, and yeti!

    Can i connect to the ParallaxESP to view the data coming from the propeller chip I just programmed?

    (kinda like a debug to the parallax serial terminal)
    I figure its a telnet port connection?
  • Clock Loop wrote: »
    David Betz wrote: »
    Sorry, I'm signing off for the night. I'll check this thread in the morning. Good luck!

    Thanks for the help.

    YETI had solved the problem in a PM with me.

    The issue is that you CANNOT connect to the DI and DO lines on the ESP. I assumed you meant the SD_D0 and the SD_D1 wires that the esp uses to load from its flash chip.

    After trying what yeti suggested, connecting the propeller chip to the ONLY UART the esp has, (aka gpio1 and gpio3, the prop loads the test blink program.

    I DID need to compile the blink.spin into blink.binary to get it to load also.
    pi@PiTest:~/PropLoader $ openspin blink.spin -b
    Propeller Spin/PASM Compiler 'OpenSpin' (c)2012-2016 Parallax Inc. DBA Parallax Semiconductor.
    Version 1.00.80 Compiled on Oct 30 2016 20:08:38
    Compiling...
    blink.spin
    Done.
    Program size is 136 bytes
    pi@PiTest:~/PropLoader $ proploader blink.binary
    Loading 'blink.binary'
    Loading second-stage loader
    Loading image.
    Verifying RAM
    Sending readyToLaunch packet
    Sending launchNow packet
    

    To show the correct wiring, I will post the correct wiring screenshot now.
    I'm glad you got it working. Yes, you have to connect to GPIO1 and GPIO3. That is the main UART on the ESP. There is another UART but it is for output only and it is connected to GPIO2. That's what I've been calling DBG. Sorry if that wasn't clear.

Sign In or Register to comment.