Notifications
Clear all

Rabbit Shack/Chicken Coop Automation Project

31 Posts
6 Users
12 Reactions
2,239 Views
TFMcCarthy
(@tfmccarthy)
Member
Joined: 6 months ago
Posts: 250
 

@huckohio 

The maintenance effort seems to be manageable. I figured you still have to regular trips to the Shacks but you don't need to check the controllers every trip. And the comm error LEDs would give you the heads up of a persistent problem. I'm guessing that, eventually, you expect to replace the entire PCB board but not for years.

Thanks for the 311 on PCBWay. That will come in handy.

The esp32 version I was looking for is the library version. Don't blame me for the terminology conflict but, you get to the Espressif library version through the Arduino IDE boards manager.

The reason I ask is because there's a compatibility problem with ESP-NOW API for registering the callback functions (esp_now_register_send_cb and esp_now_register_recv_cb). I haven't tracked down when this changed occurred yet, but I see it in v3.0.4. I'm  currenty working using v2.0.16


   
ReplyQuote
(@aliarifat)
Member
Joined: 6 months ago
Posts: 52
 

Regarding the ESP32 library version in the Arduino IDE, I understand the confusion with the terminology. The ESP32 core for Arduino is managed via the Arduino Boards Manager, and the version you're using does affect the available APIs and their behavior.


   
ReplyQuote
huckOhio
(@huckohio)
Member
Joined: 5 years ago
Posts: 301
Topic starter  

@aliarifat I was able to compile all my code under the new ESP32 library that came out a couple months ago.   Just received another ESP32 library update and the compile fails.  Error was on the

 esp_now_register_recv_cb(OnDataRecv);

function.  I need to look at the changes.

Mike

   
ReplyQuote
huckOhio
(@huckohio)
Member
Joined: 5 years ago
Posts: 301
Topic starter  

Here is the error:

C:\Users\Mike\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-b6b4727c58\esp32s3/include/esp_wifi/include/esp_now.h:157:54: note:   initializing argument 1 of 'esp_err_t esp_now_register_recv_cb(esp_now_recv_cb_t)'
  157 | esp_err_t esp_now_register_recv_cb(esp_now_recv_cb_t cb);
      |                                    ~~~~~~~~~~~~~~~~~~^~

   
ReplyQuote
huckOhio
(@huckohio)
Member
Joined: 5 years ago
Posts: 301
Topic starter  

@aliarifat 

I may have misspoken.  The last time I compiled the code was after I started hearing about the updated esp32 board library.  I decided to try an compile, which it did, but it seems the IDE library wasn't updated.  I just verified that the last version that worked was 2.0.17.  I'll need to track down the changes and update the code...when I get a minute!


   
ReplyQuote
huckOhio
(@huckohio)
Member
Joined: 5 years ago
Posts: 301
Topic starter  

@zander

Ron,  I know you've been following the ESP32 library update issue.  I seem to remember you recently responded to a post stating the library was breaking code and provide a link or two for more info/resolution (apologies if that wasn't you).  Can you provide those links again?  My ESP-Now is getting a error. 

Thanks, Mike.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 4 years ago
Posts: 7935
 

@huckohio No problem Mike, the official doc is at HERE but the NERDS are also tracking it although I did not see any difference in their docs.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.


   
ReplyQuote
TFMcCarthy
(@tfmccarthy)
Member
Joined: 6 months ago
Posts: 250
 

@huckohio 

Yeah, that's the one I have. The fix is easy but annoying.


//esp_now_register_recv_cb(receiveCallback);
//esp_now_register_send_cb(sentCallback);
esp_now_register_recv_cb(esp_now_recv_cb_t(receiveCallback));
esp_now_register_send_cb(esp_now_send_cb_t(sentCallback));
 

This uses an explicit cast to the callback function pointer. 

The cause is a change to the first parameter of the callback function. Used to be a mac  address, now a struct address


   
ReplyQuote
huckOhio
(@huckohio)
Member
Joined: 5 years ago
Posts: 301
Topic starter  

@tfmccarthy 

Thanks.  I just tried a recompile with 3.0.4 and saw the error.  My project used 2.0.17.  Thanks for the fix...this would have taken me weeks to figure out!

 

Mike


   
ReplyQuote
huckOhio
(@huckohio)
Member
Joined: 5 years ago
Posts: 301
Topic starter  

@tfmccarthy 

Posted by: @tfmccarthy

The cause is a change to the first parameter of the callback function. Used to be a mac  address, now a struct address

Does this mean I have to change something with the mac address in the code?


   
ReplyQuote
huckOhio
(@huckohio)
Member
Joined: 5 years ago
Posts: 301
Topic starter  

@tfmccarthy DAMN!  That was a quick fix.  I changed the recv callback to the command you provided and the code compiles with V3.0.4 library.  I need to set up a test between two ESP32s.

Thanks.


   
ReplyQuote
TFMcCarthy
(@tfmccarthy)
Member
Joined: 6 months ago
Posts: 250
 

@huckohio 

No. You don't have to change anything else. The change is limited to that line only.

I don't want to bore people with the details of why, unless they ask.

The issue I was trying to address is if someone updated the library because they were notified it was out of date and then suddenly their code stopped compiling.


   
ReplyQuote
TFMcCarthy
(@tfmccarthy)
Member
Joined: 6 months ago
Posts: 250
 

@huckohio 

Posted by: @huckohio

DAMN!  That was a quick fix.

Well, I ran into this a while back and had the fix in hand. I'm just hesitant telling people, "do this, do that" in code they've put effort into.

But you're a different case. I can't let ACME Acres fall behind the bleeding edge of technology.


   
ReplyQuote
huckOhio
(@huckohio)
Member
Joined: 5 years ago
Posts: 301
Topic starter  

@tfmccarthy 

I see a large wooden crate on your doorstep soon....

Thanks again.


   
ReplyQuote
huckOhio
(@huckohio)
Member
Joined: 5 years ago
Posts: 301
Topic starter  

Attached are the updated ino files with the correction for the new ESP32 board library (thanks @tfmccarthy ) and an updated/improved function to show the correct time based on standard time or daylight savings time.

 

 


   
ReplyQuote
Page 2 / 3