Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Me No Dev
@me-no-dev
why buffering?
@brutzler it does not hold the loop
@DouglasPearless there is an example for Async telnet in github
i think...
if you are going to push the telnet to the serial, you do not need to buffer
Douglas Pearless
@DouglasPearless
I have LaserWeb send data to the Smoothie via a telnet connection via an ESP8266; the replies lose characters etc. By logging to Serial1 I can see the data flowing to the Smoothie UART and back to the ESP8266 but sometimes not all the characters get back over WiFi to LaswerWeb
I did not see an Async telnet example, I will check again, just a moment
Me No Dev
@me-no-dev
not there... let me look
Douglas Pearless
@DouglasPearless
ok, thanks
here is an old example you can look at
Douglas Pearless
@DouglasPearless
cool
Is that a complete sketch as I get "'AsyncClient' has not been declared"
Me No Dev
@me-no-dev
missing the include it seems
Douglas Pearless
@DouglasPearless
:-)
Douglas Pearless
@DouglasPearless
I added the following includes and it now compiles:

include <ESPAsyncTCPbuffer.h>

include <ESP8266WiFi.h>

include <ArduinoOTA.h>

Me No Dev
@me-no-dev
you need ESPAsyncTCP not the buffer
Douglas Pearless
@DouglasPearless
oops, that wasn't supposed to be so big, I guess the "#" is some kind of markup
Me No Dev
@me-no-dev
yeah...
read on github markup :)
Douglas Pearless
@DouglasPearless

Interesting, if I remove that include I get:
AsyncTelnetServer:28: error: 'AsyncClient' has not been declared
void onPoll(void obj, AsyncClient c){

and a lot of other erro

Me No Dev
@me-no-dev
#include <ESPAsyncTCP.h>
Douglas Pearless
@DouglasPearless
your sketch requires either:
ESPAsyncTCP.h
or
ESPAsyncTCPbuffer.h
in order to compile
Ah, ok
Me No Dev
@me-no-dev
do not remove it... use the non-buffer one
Douglas Pearless
@DouglasPearless
now using the non buffer one; going to try in a minute; compiling and uploading now :-)
Douglas Pearless
@DouglasPearless
A couple of quick questions, where does os_printf send its output, can I get it to write to Serial1 ?
or does that actually go to the UART0 which I think it does
Douglas Pearless
@DouglasPearless
I will need to sit down and better understand how this works as I seen to be getting strange data back; it seems to be chopping lines (Strings) up ie. send "X250.80 S0.1516"
expecting back an
"ok"
but Smoothie replies:
"error: unsupported command - X:124"
so it appears something is going wrong send data across the ESP to Smoothies UART :-(
Me No Dev
@me-no-dev
well check the code :) probably sending new lines somwhere
I gave you an example, not a eworking code for your need
Douglas Pearless
@DouglasPearless
I am reading the code right now, I appreciate the example, certainly something to work on :-)
Me No Dev
@me-no-dev
so this part actually sets os_printf:
void _u0_putc(char c){
  while(((U0S >> USTXC) & 0x7F) == 0x7F);
  U0F = c;
}
void setup(){
  Serial.begin(115200);
  ets_install_putc1((void *) &_u0_putc);
  system_set_os_print(1);
}
void _u1_putc(char c){
  while(((U1S >> USTXC) & 0x7F) == 0x7F);
  U1F = c;
}
void setup(){
  Serial1.begin(115200);
  ets_install_putc1((void *) &_u1_putc);
  system_set_os_print(1);
}
Douglas Pearless
@DouglasPearless
Ah Ha, Serial is on UART0 and the 1 = UART1 I assume? and there
Me No Dev
@me-no-dev
here it is for serial1
Douglas Pearless
@DouglasPearless
great, is it set at 115200 as well or that odd 74800 rate?
Me No Dev
@me-no-dev
read the code again ;) it's calling Serial.begin
Douglas Pearless
@DouglasPearless
oops, staring me in the face, clearly not enough coffee today
Clemens Kirchgatterer
@everslick
I tried the AsyncWebserver approx. a year ago, but i ran into out of heap issues back then. are the requirements on RAM still the same?
because you mentioned buffered/non buffered implementation.
Me No Dev
@me-no-dev
@everslick if you are handling 5 connections at the same time, there are resources allocated for all 5 :)
Clemens Kirchgatterer
@everslick
thats kind of to be expected. :-D
but i have no control over how many connections the browser opens to fetch different resources from the server, so it is hard to predict what happens.
Me No Dev
@me-no-dev
if you are low on RAM and can not afford to handle multiple connections, then by all means you should use the sync server and make sure you handle only one
actually you do have ;)
Clemens Kirchgatterer
@everslick
yes?
Me No Dev
@me-no-dev
it depends on your design
Clemens Kirchgatterer
@everslick
yeah