Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Douglas Pearless
@DouglasPearless
for example me-no-dev/ESPAsyncTCP#67
Me No Dev
@me-no-dev
I have :D
Douglas Pearless
@DouglasPearless
Ah Ha, I figured you of all possible people might have :-)
I like the look of the library and have been scratching my head after reading as many examples as I could find; would you have an example you could share?
Me No Dev
@me-no-dev
what do you want to achieve?
Douglas Pearless
@DouglasPearless
I want to convert my sketch to use your async buffering library to solve a problem where the block TCP libraries that come with ESP8266/Arduino are causing me to lose characters; this is to add a telnet WiFi connection to Smoothie and other 3D printers / lasercutters
(I have spend a lot of hours tracing the problem down to the TCP end of the equation)
brutzler
@brutzler
let me hook up:
what is the advantage of a async-TCP-connection?
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
Me No Dev
@me-no-dev
do not remove it... use the non-buffer one
Douglas Pearless
@DouglasPearless
Ah, ok
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.