logo elektroda
logo elektroda
X
logo elektroda

ESP8266-12 External Antenna: Displaying Temperature via Web Server Using AT Commands

Elektronik_Kraków 6495 6
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 15177478
    Elektronik_Kraków
    Level 13  
    Hello
    I wanted to use the ESP8266-12 ( the larger one with a socket for an external antenna ) to display temperature values via the WWW.
    For now, I am communicating with it via a terminal. The module starts up, and following the examples I try to display something.

    I model this page - admittedly an Arduino, but you can trace what is sent.

    The communication goes as follows:
    Code: Text
    Log in, to see the code


    the problem arises when I want to send text.
    I want to send 25 characters first
    Code: Text
    Log in, to see the code

    i.e. I should send first
    Code: Text
    Log in, to see the code


    If I understood correctly, first I send the information what the text length will be and then the text itself - at least that's how I did it when sending emails over GPRS via SIM800L and it worked there.
  • ADVERTISEMENT
  • #2 15181123
    Elektronik_Kraków
    Level 13  
    I will answer for myself. Unfortunately with me the English is poor ( and is unlikely to get better ).
    I misunderstood the principle of displaying pages - I thought that it loads immediately and the module remembers the content all the time ( until it is switched off or the next load ). And the module loads the current data on the fly, maybe that's better.

    But to the point.
    I load the content like this
    Code: Text
    Log in, to see the code


    and I don't know why the module sometimes responds
    Code: Text
    Log in, to see the code


    and sometimes
    Code: Text
    Log in, to see the code


    This results in page display errors, extra characters appear <

    I forgot to add, that where extra characters are displayed > then when entering HTML text from the terminal the first time the module does not respond, you have to repeat, perhaps because of this extra characters appear >



    And it explained why the extra characters > . The module does not like the character # which occurs in the degree Celsius character code, I replaced it with another notation and it is OK.
  • ADVERTISEMENT
  • #3 15200762
    Elektronik_Kraków
    Level 13  
    Successfully run the module. I.e. the program in Bascom, contains among others two subroutines, Setup_esp8266 and Send_esp8266 .
    I did have a small problem, but it was due to the wrong order of sending CR and LF characters. The correct order should be:
    Code: Text
    Log in, to see the code

    While the configuration does not cause problems ( because it goes automatically at startup ), sending the data to the page no longer works, manually there is no problem - a few dozen times copy/paste and the page is displayed.

    A problem with receiving data from the module, Until now I was receiving short strings, e.g. from a GSM modem and it worked. Here a lot of characters and several lines are flying.

    I now do it like this:
    Code: VB.net
    Log in, to see the code


    When the module is called by the browser, quite a few characters and lines are sent,. among others
    Code: Text
    Log in, to see the code


    I'm probably going about this wrong, maybe you need to make a large buffer and load all the lines into it ? Only then parse. Now I have the impression that the incoming data "blurs" the earlier ones.

    I also found such an example of receiving data in this link

    Code: VB.net
    Log in, to see the code
  • ADVERTISEMENT
  • #4 15210049
    Elektronik_Kraków
    Level 13  
    Hello again - I'm probably writing to myself a bit

    I've done a pickup like this:
    Code: VB.net
    Log in, to see the code


    And now when typing from the terminal:
    Code: Text
    Log in, to see the code


    it starts sending the content of the page without any problem, I can do it repeatedly. But after plugging in the module, when it sends:
    Code: Text
    Log in, to see the code


    it's as if too many lines are clogging it up. How would it be possible to split that first line to one string and the second to another, maybe by checking the value of the variable Event ?
  • ADVERTISEMENT
  • #5 16320002
    george2002

    Level 21  
    Just out of curiosity - has a colleague figured out the other way round - i.e. there is a website where you have to enter e.g. SSIS and Password and this has to go back via the uC to the ESP8266 :) ? I would like to make such a website in bascom with the configuration of the ESP8266 via the website, because there are examples everywhere on the internet of how to send something from the ESP8266 to e.g. Thingspeak, but the other way round there are fewer examples ... especially in Bascom ;)
    Company Account:
    GS electronic Grzegorz Stoliński
    2 Pułku Lotniczego 18, Kraków, 31-857 | Company Website: www.gselectronic.pl
  • #6 16320265
    Anonymous
    Anonymous  
  • #7 16320292
    george2002

    Level 21  
    niveasoft wrote:
    This kind of thing can be achieved without problems. Just the topic is broad and don't expect step by step instructions for every possible case.
    The carrier is not important i.e. ESP8266 or WS5100, WS5300 or newer.

    I recently programmed modules based on Arduino boards + Ethernet Shield`s.
    The software was to be one and the boards were to have configurable network and other settings.
    I found that setting up the barrier controller via a web page was overkill and relied on AT commands. Link
    The result is a project in which you can set each parameter by connecting to the device with a terminal.
    Nevertheless, it is possible to write something that will program it via a browser without any problem. You can see such a sample project Link

    The matter boils down to saving the settings and loading them at startup/change and then sending them to the controlled medium.


    No well my colleague misunderstood me, in general I'm only interested in the part of processing such a thing that on the page that the ESP puts on itself there are fields to enter the SSID and Password and now how to receive it through the ESP8266 and that's all I need info on because displaying on the page or pages or sending to thingspeak I have mastered but receiving from the page not yet :)

    Greetings
    George2002
    Company Account:
    GS electronic Grzegorz Stoliński
    2 Pułku Lotniczego 18, Kraków, 31-857 | Company Website: www.gselectronic.pl
ADVERTISEMENT