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
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.
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
Me No Dev
@me-no-dev
I have successfuly used javascript to fetch resources one by one (even AJAX)
Clemens Kirchgatterer
@everslick
that could be an idea
Me No Dev
@me-no-dev
the days before Async :D
let me see if I can dig up the code
Clemens Kirchgatterer
@everslick
that would be very kind of you, sir.
like this?
Me No Dev
@me-no-dev
@everslick i sent it to you in private :D
brutzler
@brutzler

Hi,
for remote debugging I sometimes use an "debug-ESP" and transfer everything what is coming from my "main-ESP" into the serial interface via UDP broadcast.

  if (stringComplete) {
    UDP.beginPacket("192.168.1.255", 514);        // Broadcast on Port 514
    UDP.write(inputString.c_str());
    UDP.endPacket();
    inputString = "";
    stringComplete = false;
  }

A terminal program (YAT) on the PC is receiving the debug messages.
Just thinking, why this can not be done from the "main-ESP" itself...
Do you think, I can gain any problems with this way? run out of numbers of connections/sockets?

Clemens Kirchgatterer
@everslick
i use this all the time.
just try it
keep in mind, that if you send too often, the ESP will just drop some packets, without any error.
brutzler
@brutzler

any hint how to make this easier?
normally I use for debug on serial something like this:

#define DEBUG Serial1
DEBUG << String(Date)<< "  " << String(Time) <<  endl

Can I make somehow a "#define DEBUG UDP". What do I need for this?