• Hi all, I am very much a novice at both IoT devices and JS, I force myself to learn.
    I have come up with 2 problems I am not able to work out tho.

    I have Espruino 2.03 on the RAK8212 and for testing I am using AT commands easily over Web IDE over BLE and very happy with the way GPS and LTE CAT-M1 connections work. Great!
    I then bought an ESP8266 ESP-01 into the mix, running native AT firmware "ESP8266_AT_Bin_V1.6.2_0".

    I connected the TX/RX of the ESP to RAK D28/D29 (SENS_DOUT1 and SENS_DOUT2) which is the TX/RX for when the FTTI is connected to PC and I am now stuck with 2 issues.
    1) I am getting only gargabe data over the serial once I reset the ESP8266 and I have no idea why, due to my inexperience I hope.
    2) I am unable to send my own AT command to the ESP8266 over the WebIDE through the RAK it seems.
    I only get the output back from the ESP8266 once I perform a reset on the ESP8266 (See 1 and below).
    I have tried Serial1.print("AT"), Serial1.write("AT\r"), Serial1.write("AT\r\n") but I only get local echo using the same upload to the RAK as per number 1, it never goes to the ESP, as I can not see the ESP light flashing indicating activity.

    My upload looks like this

    Serial1.setup(115200, {rx:D28, tx:D29});
    Serial1.on('data', function (data) { print(" "+data); });
    Serial1.println("AT");

    And my output looks like this, after pushing reset button on the ESP8266

    I am able to connect the ESP8266 over FTTI and using "Termite" connect to the serial console and issue AT commands no problems, and get results returned. Using same baud rate of 115200.

    I have searched the forum as well as the documentation, where I have gotten the Serial commands to test with.
    I am unsure where I am going wrong, is someone kindly able to give me a hand please?
    Thanks muchly.

  • Sun 2019.06.02

    Hello user @user, I know you wanted to be addressed that way ;-)

    It appears you have done exhausted cross testing as your explanation shows. Sometimes we stare at the same setup for so long, the obvious gets overlooked. It doesn't hurt to re-verify.

    I don't have experience with RAK nor a definitive solution, but do have a few ideas to try.


    I've read in other forums the ESP-01 can be problematic. Most usually have success with ESP-12 or -E versions.

    Has the baud rate of IDE been verified?    WebIDE >> Settings >> Communications >> Baud Rate

    Has a slower baud rate been attempted?

    Are you attempting the Loopback test?

    https://www.espruino.com/USART

    When connected to the RAK does Tx -> Rx

    Are/have you able to isolate testing each side using loopback on each to see if it is actually a baud issue?


    'I only get the output back from the ESP8266 once I perform a reset on the ESP8266'

    ref: http://www.espruino.com/Troubleshooting#­line=61

    Please read pp. half way down page starting with "When you are not connected to a computer via USB, Espruino automatically moves the console"
    "Note: Serial ports are not generally as fast as USB - 9600 baud is only around 1000 characters/second."

    This might be occurring and/or a change in baud rate when switching between the two.

    I've had issues that I never fully understood, as the two do overlap at times. Forcing the state will usually fix the issue.



    As your explanation seems exhaustive, until an individual with actual same RAK ESP-01 hardware experience can assist, it doesn't hurt to take another peek.

  • What you're doing sounds pretty much spot on, including baud rate.

    In addition to what Robin says, things I can think are:

    • You don't have GND connected together on everything
    • You don't have a powerful enough 3.3v voltage source for the ESP8266 - I'm not sure but RAK8212 may not have a powerful voltage regulator
    • RX/TX pin are swapped?
  • Thanks Robin and Gordon for your time, I got a fair whack of work and jury duty on top currently so my testing is delayed a bit but ill be trying over next day for sure.

    You have just reminded me, when I was testing the ESP8266, it was on its own, i am running it through a separate 3.3V supply and not the USB serial converter 3.3, but the power supply itself is powered off USB, should be plenty of power.
    I did not find out what the 3.3V power supply pins are capable of providing from the RAK yet so I didnt use them to power the ESP yet, but it is the plan to use the RAK 3.3 supply I hope.

    Currently there is no ground from the RAK to the breadboard where the buttons for flash and reset and all the connections from the ESP are, but I did test it out just now and it did not change anything unfortunately.

    What I may do for a test tomorrow when I get more time is to try power the whole ESP from the RAK, which will then have the common ground with the RAK too.

    Also the loopback test, I swear I have done it successfully, but ill have to retest. Hard to remember after a few hours banging head against the wall with this issue hehe

    I did swap the TX/RX pins but i do not appear to have much success with that, in fact the reset button immediately decides to not work on the ESP8266. Normally the lights go mad for a second when you reset it, but nothing after I swap the TX/RX pins.

    I'll report back next testing session.
    Appreciate your time.

  • ESP8266 modules like to have a decent capacitor across GND and 3.3V as close as possible to catch power demand spikes, even with sufficient power supply for the average use. See post with picture in this conversation.

  • If you didn't have GND common between the ESP8266 and RAK then that'd 100% cause the issues you were seeing.

    So with it connected it'd be worth re-trying some stuff you did previously in order to see if you have any success.

    When booting the ESP8266 will print garbage since the bootloader works at 78400(iirc?) baud - but once booted it should print ready and work just fine at 155200.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Unable to get clean data from RAK8212 connected to ESP8266 over Serial1

Posted by Avatar for user @user

Actions