logo elektroda
logo elektroda
X
logo elektroda

Will the ESP8266 handle a server with graphs refreshed 2 times per second?

Piotr_uC 2829 13
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 15532485
    Piotr_uC
    Level 8  
    Hello

    I have just ordered an ESP8266 chip from the web.
    Unfortunately all the examples given on the web are quite simple.
    I am wondering if it is possible to do something more challenging and if the computing power of the ESP chip will allow it:

    - Is it possible to make a server with a page displaying data in the form of graphs? I mean Simple graphs for about 4 variables. How to do this most efficiently on esp? PHP HTML? The graphs would have to be refreshed at least 2 times per skecond.

    - I currently have a project that sends data to the computer via UART.
    The speed of this communication is 921600 bps. Can the ESP chip operate at this UART speed? Will the computer be able to receive this data over WiFi?
  • ADVERTISEMENT
  • Helpful post
    #2 15532549
    vonar
    Level 28  
    Piotr_uC wrote:
    How to do this most efficiently on esp?

    By a slight cheat: transfer data and draw in the browser with JavaScript.
    A little slower, but without JS: SVG.

    Piotr_uC wrote:
    Can the ESP chip operate at this UART speed?

    Yes.

    Piotr_uC wrote:
    Will the computer be able to receive this data over WiFi?

    Rather, the question is whether the ESP will be able to send this data.... ;)
  • #3 15532631
    gosztekseba
    Level 31  
    ESP in the form not of a server but of a client and for this something similar to this e.g. http://techfreak.pl/nettemp/ or it remains to write your website in php. Regards
  • #4 15532943
    Piotr_uC
    Level 8  
    What is the maximum transmission rate achieved by the ESP between the UART and WiFi ?

    There are perhaps some examples of diagrams in java script ?
  • ADVERTISEMENT
  • #5 15535678
    piotr411
    Level 22  
    Speeds above 230400, are possible to communicate when the clocking is set to 80Mhz.

    Added after 51 [seconds]:

    Speeds above 230400, are communicable when the clocking is set to 80Mhz.
  • #6 15536695
    Piotr_uC
    Level 8  
    ok, thanks for your help

    I am still wondering how to solve this problem with the charts.

    I would like the ESP8266 to act as something like a server, but which only provides data.
    The client (computer or phone) would have to read this data from the ESP8266 and draw graphs based on it. This solution would relieve the ESP chip and the drawing of the graphs could be handled by the computer or phone.
    All data is to be local without sending the data to the "cloud".


    -What do I need to program on the Arduino side? (I have the Adruino IDE and know the C language quite well)
    -On the client side, do I need to write an application that will only work on the computer or maybe some page in PHP/HTML/Javascript ?
    I would like it to work on the computer and on the phone from a web browser.
  • ADVERTISEMENT
  • #7 15537517
    piotr411
    Level 22  
    For good measure, everything can be done as a web page, on an ESP. For graphics, you need a bit more space, so think of the ESP8266-13. ESP supports graphics, you can draw something there. In LUA and EPS Basic, there are examples in the help. I admit that I haven't touched graphics yet, so I'm only suggesting the possibility, but I won't confirm the effectiveness. Have a look at the Reference at this link ESP Basic Graphics

    Take a peek at an example from Help:
    Clock
  • #8 15540727
    Piotr_uC
    Level 8  
    But I don't mean weather station style graphs.
    These are supposed to be graphs drawn live and refreshed several times a second, e.g. with acceleration values
  • #9 15540778
    voyo
    Level 12  
    The ESP8266 is a pretty powerful chip. 80Mhz is really a lot, plus it's very easy to get it to work at 160Mhz. The only thing it may lack is support for floating point operations.

    But - using this chip only as a "modem" and connecting to it by 20x less efficient chip (slightly counting), like some Arduino is just a sin... For this chip you can easily load your program, written from the beginning in C/C++. To make it easier, instead of writing directly in SDK, I recommend frameworks like "Sming" or "PlatformIO".
    As for what you specifically need (from the first post - a web server, serving dynamic graphs) - on the esp8266 you can easily run a pretty efficient web server, serving JS files and capable of handling webservices. With such technologies you can, for example, make an oscilloscope to display a graph on a web page (not to mention simpler projects).
    With JavaScript, the PC is defacto responsible for the graphics, and the web server just "sends" the data to be plotted in a separate TCP session.
    I recommend this project as a "base for expansion" - https://github.com/Spritetm/esphttpd
  • #10 15540797
    piotr411
    Level 22  
    Then put the server on an Android, why torture yourself with an ESP8266. You can buy a tablet for under £100.
  • #11 15541231
    voyo
    Level 12  
    Katy yourself? With that kind of attitude, then just go to the shop and buy/search for a ready-made solution. Besides, 100 PLN is much more than about 10 PLN (and you can buy ESP8266 modules for that much). Plus the size of such a solution - there is no comparison here.
    This is probably a bit out of the spirit of the electrode? But maybe I don't know, I don't know, I rarely visit here....
  • ADVERTISEMENT
  • #13 15542576
    TvWidget
    Level 38  
    Piotr_uC wrote:
    But I don't mean weather station style graphs.
    These are supposed to be graphs drawn live refreshed several times a second e.g. with acceleration values

    Websocket is convenient for this. The server just sends the measurement data and the processing and drawing of the graphs is handled by an application e.g. in JS running in the browser on the client side. You can draw a continuous infinite graph this way, e.g. an ECG.
  • #14 15542727
    rugbygangster
    Level 10  
    Here is an interesting video on the ESP8266 and WebSockets:


ADVERTISEMENT