Author Topic: No ack received by sender with esp8266  (Read 462 times)

2ni

  • Newbie
  • *
  • Posts: 1
No ack received by sender with esp8266
« on: May 21, 2018, 01:05:17 PM »
I'm using the examples Struct_send/receive with an esp8266. The sender can send the data and I get it on the receiver. So far so good.
But on the sender side I only get an ack, if I add a delay in the function sendACK (RFM69.cpp line 294):
Code: [Select]
while (!canSend() && millis() - now < RF69_CSMA_LIMIT_MS) {receiveDone(); delay(1);}

With that change it works like a charm, without it just waits for RF69_CSMA_LIMIT_MS milliseconds and then returns, ending in the sender printing "... nothing".
Does this issue ring a bell to someone?

TomWS

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1864
Re: No ack received by sender with esp8266
« Reply #1 on: May 21, 2018, 02:25:28 PM »
It is unclear from your post whether you have esp8266 on both ends of the link or only one.  And, if only one, which end?

Posting the two endpoint sketches would also help.

Tom

nemail

  • Newbie
  • *
  • Posts: 1
Re: No ack received by sender with esp8266
« Reply #2 on: February 07, 2019, 08:01:46 PM »
just wanted to follow up on this. i have esp8266 at both ends and as soon as i added delay(1) to canSend(), Acks were working perfectly. Before that, I had the same issue.

I'm using very basic, stripped down gateway and node example.

Will test this with ESP8266 on one and 328p on the other end later.

i don't think, this issue should stay closed, unless you decide not to support esp8266 at all.

if this issue really is only settings/code (not library) related, it might come handy to new users to have working examples for the esp8266 included in the library.

TomWS

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1864
Re: No ack received by sender with esp8266
« Reply #3 on: February 07, 2019, 08:14:01 PM »
just wanted to follow up on this. i have esp8266 at both ends and as soon as i added delay(1) to canSend(), Acks were working perfectly. Before that, I had the same issue.

I'm using very basic, stripped down gateway and node example.

Will test this with ESP8266 on one and 328p on the other end later.

i don't think, this issue should stay closed, unless you decide not to support esp8266 at all.

if this issue really is only settings/code (not library) related, it might come handy to new users to have working examples for the esp8266 included in the library.
I suspect that you would get the same result if you used
Code: [Select]
yield();
instead of delay(1);  yield() might be a tad faster, but it's probably not critical.  esp8266 needs to have some cycles to support its WiFi stack.  Normal loop() operations provide this, but stuck in an internal loop should have a yield() and, I agree, the library should probably conditionally add this to any of its internal loops.

Tom