This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

i want to send the data to esp8266 via rx,tx

hi...  I am working on nRF52832 . nRF52832 ,RX TX is connected to the esp8266 of tx,rx . i want to send the data from nRF52832 TO ESP8266 via uart . which function can i use ? printf or app_uart_put . how to send ?   my connections    suggest me

nRF52832       esp8266

RX                 TX

TX                 RX

GND             GND 

  •  am sorry , yes i have modified the ble_app_uart example . Here is the zip file ,, please have a look . i am directly connecting the esp8266 to nRF52832 development kit using jumper wires . RX----TX , TX----RX, GND ---GND 

    RX --- 8 PIN IN NRF52832 , tx ----6 pin in nrf52832 . i checked the connections everything is fine. 

    7532.main.zip 

  • It is no problem at all. Thanks for sharing the source code.
    These are my initial thoughts, when looking over the code:

    - For readability and debugging, you should be consistent with your indention and remove all the comments and magic numbers floating around.

    - Your main code is very cluttered and hard to read. You call functions multiple times, and it is unclear what you are trying to achieve from the code alone.

    As a general advice to you, it will make all your future work easier(for your own sake) if you make sure your code is formatted properly. It makes it easier to identify bugs, and to understand what is going on in general.

    ps_anu said:
    RX --- 8 PIN IN NRF52832 , tx ----6 pin in nrf52832 . i checked the connections everything is fine. 

    By this, do you mean that the  ESP TX pin is connected to the nRF pin 8 RX pin?
    The 8 pin on the nRF is the RX pin, and the 6 pin is TX, by default. From the tx ----- 6 pin line, it seems you might have connected them in opposite. Could you try to connect them the other way around?
    What do you mean when you say that you checked the connections everything is fine?

    Could you tell me where in the code your application stops, do you make it to the while loop?
    I still have not understood what you mean when you say that your code freezes when you connect UART.

    Best regards,
    Karl

  • 4073.main.zip

    look at the above code , now it is clear and neat . I am very clear , at the initially  conversion itself i have mentioned about my connections. 

    ESP8266    nRF52832 

    RX                TX

    TX                RX

    GND            GND 

    i tried using debugger , i am getting   NRF_BREAKPOINT_COND; , when i step into uart_init , i am getting the error when i reach the  line  628 a  APP_ERROR_CHECK(err_code); 

     i can able to connect to the device using nrf_toolbox app , i am receiving the data for few secs , after that i am getting connection lost .  

  • Thank you for formatting your code, it is now much more comprehensible.

    ps_anu said:
    I am very clear , at the initially  conversion itself i have mentioned about my connections. 

    Sorry for asking you about this so many times, but it is hard to be certain that we are talking about the same thing without a connection diagram, and when the answer is fractured in different replies. Your initial connection description does not include pin numbers, and you written reply contradicts itself when you use "----" to both symbolize a connection and then a descriptor in the very next sentence. I am just making sure I understand you correctly, so I may help resolve your issue.

    ps_anu said:

    i tried using debugger , i am getting   NRF_BREAKPOINT_COND; , when i step into uart_init , i am getting the error when i reach the  line  628 a  APP_ERROR_CHECK(err_code); 

     i can able to connect to the device using nrf_toolbox app , i am receiving the data for few secs , after that i am getting connection lost . 

    Good, this is helpful.
    Which error do you get, when you step into line 628?
    Could you confirm for me, does the application function as expected for a few seconds - advertising, connecting in nrf_toolbox and UART printout - before it suddenly disconnects, and no longer prints anything on UART. Is this what is happening?

    Since you are using a while(1) loop in you main, you will never run your idle_state_handle.
    Could you relax this loop, and instead call app_uart_put in one of the callbacks, and let me know if this solves your problem?

    Best regards,
    Karl

Related