logo elektroda
logo elektroda
X
logo elektroda

ESP8266 GPIO Configuration via AT Commands Over UDP Not Responding

mtbchn 615 8
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 19723802
    mtbchn
    Level 3  
    Hi,

    I want to implement the following task. Using UDP protocol and AT commands, I want to send GPIO configuration to ESP8266 as output.

    What I am managing to achieve:
    1) GPIO configuration via AT commands sent via RS232 terminal.
    2) Sending data to ESP8266 via UDP - ESP8266 is running in transparent mode.

    However, I have the problem that a command sent from UDP, e.g. "AT" goes to the ESP8266 and I can see it in the terminal, but it does not result in an "OK" response - as happens when I type this command by hand.

    What could be the cause of this? Where am I making a mistake? How do I get the ESP8266 to receive "AT" as an AT command and not as plain text?

    Thanks in advance for any hints.
  • ADVERTISEMENT
  • #2 19723938
    czareqpl
    Level 33  
    It is possible that you are not sending the end-of-line character chr(10) or chr(10) + chr(13)
  • #3 19732312
    mtbchn
    Level 3  
    czareqpl wrote:
    Possible that you are not sending the end-of-line character chr(10) or chr(10) + chr(13)
    .

    Sending. Unfortunately, the data is interpreted as text, not as AT commands. Any ideas?

    Added after 11 [minutes]: .

    This is what the data sent from the UDP terminal looks like:

    ESP8266 GPIO Configuration via AT Commands Over UDP Not Responding .

    This is what the data looks like when received at the terminal to which the (RS232) ESP module is connected:
    ESP8266 GPIO Configuration via AT Commands Over UDP Not Responding .

    And this is what the data looks like when I enter the commands in the terminal to which the (RS232) ESP module is connected and, of course, the control works:

    ESP8266 GPIO Configuration via AT Commands Over UDP Not Responding .

    Do I need to indicate in any specific way that I am sending an AT control command? So that the module interprets it in this way[/img]?
  • ADVERTISEMENT
  • #4 19732397
    mpier
    Level 29  
    Hello,
    you probably need to write a program to handle the control of AT commands via UDP.

    Greetings.
  • #5 19732401
    mtbchn
    Level 3  
    mpier wrote:
    Hello,
    you probably need to write a program to handle the control of AT commands via UDP.

    Greetings.
    .

    Hi,
    I am using the "AT" firmware from the Espressiff website. I just wanted to use it for this purpose and send AT commands via UDP terminal.
  • #6 19732428
    mpier
    Level 29  
    So this esp8266 connected to the computer as a modem is supposed to reset itself, after loading this thread in the browser, in which I maliciously wrote "+++ AT+RST"?

    I think it's easier to write a proper program than to rework the one with AT.

    Can you force the device connected to this esp to send the appropriate commands in response to commands received?
  • ADVERTISEMENT
  • #7 19732482
    mtbchn
    Level 3  
    mpier wrote:
    That is, this esp8266 connected to the computer as a modem is supposed to reset, after loading in the browser this thread in which I maliciously wrote "+++ AT+RST"?

    I think it's easier to write a proper program than to rework the one with AT.

    Can you force the device connected to this esp to send appropriate commands in response to commands received?
    .

    The issue is as follows. I have written an application in C# to communicate with the ESP using the UDP protocol - it works. However, the received commands are not identified by ESP as AT commands, but as text (as above in the screenshots). And exactly as you say, if I wanted to send the command: "AT+RST" then my goal would be to get the effect of a prock reset. Meanwhile, I only receive the text "AT+RST" - from UDP.

    Generally, writing a ready-made program - or using a sketch from an Arduino - is not a problem, and I have covered this topic.

    I also don't want the ESP to be an intermediary - i.e. e.g. ESP-01 connected via RS232 with another microcontroller and then the correct response to the message sent. What I want is for the ESP-01 to act as a full-fledged proxy, with the ability to control a single GPIO via UDP - i.e. over UDP I send it a series of AT commands and its response is to issue a high/low state on GPIO1 for example. I manage to achieve this, but when I type the commands in the terminal (RS232) manually, not when they come over UDP. And here I'm wondering if I shouldn't send the data by UDP somehow "dress" it up so that the AT firmware in the ESP-01 understands that it's a control command and not just a string :) .
  • #8 19732545
    khoam
    Level 42  
    mtbchn wrote:
    I manage to do this, but when I enter commands in the terminal (RS232) manually, not when they come over UDP. And here I am wondering if, when sending data by UDP, I shouldn't "dress it up" somehow so that the AT firmware in the ESP-01 understands that it is a control command and not a simple string
    .
    I'm afraid the AT firmware doesn't have the functionality you expect. You can, however, query from the ESP side over TCP or UDP and retrieve data.
  • ADVERTISEMENT
  • #9 19732596
    mtbchn
    Level 3  
    khoam wrote:
    mtbchn wrote:
    I manage to do this, but when I type the commands in the terminal (RS232) manually, not when they come over UDP. And here I'm wondering if, when sending data by UDP, I shouldn't "dress it up" somehow so that the AT firmware in the ESP-01 understands that it's a control command and not a simple string
    .
    I'm afraid the AT firmware doesn't have the functionality you expect. You can, however, from the ESP side query over TCP or UDP and retrieve data.


    Thanks for the reply.

Topic summary

The discussion revolves around configuring GPIO on the ESP8266 using AT commands sent via UDP. The user successfully sends commands through an RS232 terminal but encounters issues when sending commands over UDP, as the ESP8266 does not respond with "OK" as expected. Responses suggest that the lack of proper end-of-line characters (chr(10) or chr(10) + chr(13)) may be causing the commands to be interpreted as plain text rather than AT commands. The user expresses a desire for the ESP8266 to act as a proxy for GPIO control without needing intermediary devices. However, it is noted that the AT firmware may not support the desired functionality, and alternative methods such as querying from the ESP side over TCP or UDP are suggested.
Summary generated by the language model.
ADVERTISEMENT