Connect an Adafruit Feather (nRF52 Bluefruit LE - nRF52832) to an ESP8266-01  - Page 1
Forum section: electronics / general

author: Prince1819
author_rank: Newbie
timestamp: May 16, 2021, 10:01:07 am
content: Hi,My team and I were trying to connect an Adafruit Feather (nRF52 Bluefruit LE - nRF52832) toan ESP8266-01 through serial connection.The process is the following:1. A bunch of sensors send data to the Adafruit Feather.2. The Feather sends all the data via serial communication to the ESP8266-01.3. Then the ESP sends all to a server.We are having problems in the communication between the Feather and the ESP. For severalweeks we tried to code for ourselves and then after lots of failures, we advance for pre-donecodes found on forums, but no one was working, at least with our hardware.Did someone had the same problem? If yes, how did you solved it?Best regards,Paulo Andrade

author: PlainName
author_rank: Super Contributor
timestamp: May 16, 2021, 09:46:42 pm
content: Might help if you say what the symptoms of it not working are, and what you're actually doing in the way of transferring the data. Otherwise there are a zillion things it could be, 99% of which won't be appropriate to your particular situation.So:1. What is the serial connection? Speed, format, etc?2. Are you sending known data (so you can check it at various points) or is it opaque to you?3. Do you see that data exiting the Feather, on the wires?4. Does the ESP read whatever is on the wire properly?

author: Prince1819
author_rank: Newbie
timestamp: May 23, 2021, 09:16:19 am
content: Might help if you say what the symptoms of it not working are, and what you're actually doing in the way of transferring the data. Otherwise there are a zillion things it could be, 99% of which won't be appropriate to your particular situation.So:1. What is the serial connection? Speed, format, etc? -> Baud Rate: 9600; Type: UART2. Are you sending known data (so you can check it at various points) or is it opaque to you? -> We are sending a temperature from a atmospheric sensor3. Do you see that data exiting the Feather, on the wires? -> Yes4. Does the ESP read whatever is on the wire properly? -> No, in the website we get random numbers or characters

author: PlainName
author_rank: Super Contributor
timestamp: May 23, 2021, 11:23:50 am
content: OK. Just to be sure, I would ignore the sensor and use fake data, so I know the exact pattern that should appear on the wires. And then verify that the data does indeed show on the wire exactly as expected. The problem with sensor data is that it changes, and whilst you might be able to say that the ultimate numbers aren't what's being transferred, it's hard to say what they should be. It's also easier to spot things like reversed bits, 7-bit data, etc.Next, do the same for the ESP->server connection. That is, fake the data being sent to the server with something you can easily verify and check that it does indeed come out the other end properly. Sorry if you've already done this but without knowing if you have it's worth pointing out.Assuming both the above verify correctly, the problem has to be in the ESP, so it's just a matter of intercepting the (still known, fake data) in the receive function and then working towards the server sending stuff until it is wrong.How are you programming this (that is, what language)?

author: Prince1819
author_rank: Newbie
timestamp: June 06, 2021, 10:30:07 am
content: I actually already tried to send "fake data". I defined a string (example: "1234") and then tried to send it via serial communication.With an oscilloscope I measured the wave form and it was ok, it was what I expected. The ESP simply didn´t read anything. That made me think that might have been some prblem with the TX-RX ports of the ESP but I can program it with no worries.I am using Arduino IDE (C++) with a programming board to program itBest regards

author: PlainName
author_rank: Super Contributor
timestamp: June 11, 2021, 12:10:32 pm
content: I think you need to start at the serial port ISR and work your way up to where the data stops appearing. I would consider putting money on the ISR, or however the hardware is read, being a good suspect.From what you've said I assume you're using the Arduino IDE thing. On the one hand that's useful because stuff is already done and proven to work, but on the other you don't really know what it's doing (or not!) when it fails. I think you need to get your hands dirty in there.

author: Prince1819
author_rank: Newbie
timestamp: June 13, 2021, 12:22:10 pm
content: We actually tried that way and it still didn't workbest regards

author: PlainName
author_rank: Super Contributor
timestamp: June 15, 2021, 11:06:08 am
content: It sounds like the serial port driver is being configured for the wrong port or pins. However, there is an assumption that when you say you can program it OK you mean you used the same serial driver code to get data in and out. If not, then that's the place to look - just run up a very basic app that does nothing except read and write the serial port using the same code as in your project that fails. It should be simple enough that you can post the code here or somewhere (which, to be honest, would have been useful back at the start).

author: Prince1819
author_rank: Newbie
timestamp: June 20, 2021, 09:42:45 am
content: We actually tried using that piece code and from pc to ESP, it works fine, but from a microcontroller (Example: Arduino) to ESP it doesn't work. We look up for any error in the Arduino code and it was ok. If i program an arduino with the ESP code, it receives all the data sent over.We used this piece of code:/*ESP8266 Serial CommunicationThe blue LED on the ESP-12 module is connected to GPIO2(which is also the TXD pin; so we cannot use Serial.print() at the same time)*/void setup() {Serial.begin(9600); // Initialize the Serial interface with baud rate of 9600}// the loop function runs over and over again forevervoid loop() {if(Serial.available()>0) //Checks is there any data in buffer{// Serial.print("We got:");Serial.print(char(Serial.read())); //Read serial data byte and send back to serial monitor}}

author: PlainName
author_rank: Super Contributor
timestamp: June 20, 2021, 10:04:37 am
content: Is the ESP serial polarity correct? I could imagine a scenario where it would work with the PC but not a micro if the PC output was inverted (as it would be for V.24).