ESP-NOW - Peer to P...
 
Notifications
Clear all

ESP-NOW - Peer to Peer ESP32 Network

49 Posts
9 Users
6 Likes
4,201 Views
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6969
 

@russ-terry Here is my WiFi.h in the ESP32 board library

Screen Shot 2022 04 17 at 21.07.06

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.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
frogandtoad
(@frogandtoad)
Member
Joined: 5 years ago
Posts: 1458
 

@zander

Posted by: @zander

@russ-terry I just tried it, no problems.  Do you have maximum error checkin on as in the picture.

Screen Shot 2022 04 17 at 20.55.47

Given that @russ-terry said he is using an ESP8266, and Bill did mention that you'd require a different library for the ESP8266, then I think the error message he is receiving is quite clear.

Unfortunately, Bill does not mention the correct library to use in his video or website article.  I've had a quick look, and "ESP8266WiFi" appears to be the relevant WiFi library to use for the ESP8266.

I don't have an ESP8266 to try it for you, but let us know if you still have trouble with that one after installing it.


   
ReplyQuote
frogandtoad
(@frogandtoad)
Member
Joined: 5 years ago
Posts: 1458
 

@zander @russ-terry

Posted by: @frogandtoad

@zander

Posted by: @zander

@russ-terry I just tried it, no problems.  Do you have maximum error checkin on as in the picture.

Screen Shot 2022 04 17 at 20.55.47

Given that @russ-terry said he is using an ESP8266, and Bill did mention that you'd require a different library for the ESP8266, then I think the error message he is receiving is quite clear.

Unfortunately, Bill does not mention the correct library to use in his video or website article.  I've had a quick look, and "ESP8266WiFi" appears to be the relevant WiFi library to use for the ESP8266.

I don't have an ESP8266 to try it for you, but let us know if you still have trouble with that one after installing it.

Sorry, can no longer edit my post... in any case, found some further information that may well help you to install the WiFi library for the ESP8266 micro controller:

how-do-i-add-esp8266wifi-h-to-arduino-ide/

Hope this helps!

Cheers


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

@frogandtoad I thought he was having trouble with the esp32, but if he is trying the esp8266 then he does need to make some changes. I think I did that but I don't recall if I did or what I did.

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.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
frogandtoad
(@frogandtoad)
Member
Joined: 5 years ago
Posts: 1458
 

@zander

Posted by: @zander

@frogandtoad I thought he was having trouble with the esp32, but if he is trying the esp8266 then he does need to make some changes. I think I did that but I don't recall if I did or what I did.

No problkem, you probably just missed it - he did state that he is using an ESP8266.

 


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

@frogandtoad It happens more and more as I get older, plus I have several projects under way and one is esp32 based the other 8266 so I end up confusing myself. I just tried the mac sketch and when I included the esp8266 wifi lib then on error changed code as it suggested it threw in 18 other includes! Still it failed. Then I gave up.

I think at that point I figured it was easier to just use an ESP32 board. Besides working, they have other advantageous.

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.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
frogandtoad reacted
ReplyQuote
Russ Terry
(@russ-terry)
Member
Joined: 3 years ago
Posts: 16
 

@zander The board I have selected is the node32s, which has worked in earlier work. I set the error output to all and compiled. The attached text file is from the compile. It seems to say that there is no conflict with wifi.h and the version is 1.2.7 . I see that the board is version 2.0.2 though. Which were you referring to?

When I open the boards manager, the entry for ESP32 by espressif systems says the current version is 1.0.6 . What am I missing? I tried selecting several boards and compiled, getting the same output. 

 


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

@russ-terry I see you have a WiFi.h in your sketch folder library. Remove that and try again.

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.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


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

@russ-terry Actually in the text file you supplied it has verion 2.0.2. Just open the text file you provided and search on 2.0.2. That means the board is at that level.

How can you say

It seems to say that there is no conflict with wifi.h 

when the last line is an error in WiFiClass in the WiFi.h. There is no 'mode' member.

 

Look at the 2 included screen snaps. You are using a personal copy of WiFi.h at version 1.2.7. I suggest you remove that.

The 'official' WiFi.h is at 1.0.6 for esp32

Screen Shot 2022 04 18 at 08.17.05
Screen Shot 2022 04 18 at 08.16.46

I have seen several folks with these kinds of problems, and in EVERY case it's because they 'messed' with the libraries instead of using the standard methods. They all finally started over and didn't manually mess and it worked.

 

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.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
frogandtoad
(@frogandtoad)
Member
Joined: 5 years ago
Posts: 1458
 

@russ-terry

Posted by: @russ-terry

@zander The board I have selected is the node32s, which has worked in earlier work. I set the error output to all and compiled. The attached text file is from the compile. It seems to say that there is no conflict with wifi.h and the version is 1.2.7 . I see that the board is version 2.0.2 though. Which were you referring to?

When I open the boards manager, the entry for ESP32 by espressif systems says the current version is 1.0.6 . What am I missing? I tried selecting several boards and compiled, getting the same output. 

 

I'm sorry, but I thought you stated earlier that you were using the ESP8266 board?

Are you now saying that is not the case?


   
ReplyQuote
Russ Terry
(@russ-terry)
Member
Joined: 3 years ago
Posts: 16
 

@frogandtoad I was using an 8266 for another project (send to Gmail) and it worked. I then tried to get it working on esp32 and the compile failed. I shifted to another part of the project (ESP-NOW) with an esp32. At some point last week the mac address sketch worked, but a day or so ago it wouldnt.


   
ReplyQuote
frogandtoad
(@frogandtoad)
Member
Joined: 5 years ago
Posts: 1458
 

@russ-terry

Posted by: @russ-terry

@frogandtoad I was using an 8266 for another project (send to Gmail) and it worked. I then tried to get it working on esp32 and the compile failed. I shifted to another part of the project (ESP-NOW) with an esp32. At some point last week the mac address sketch worked, but a day or so ago it wouldnt.

I'm not sure how this answers or relates to my question?
Is it working now?
If so, which library did you actually install, and how?

This information will help many others here.

I shifted to another part of the project (ESP-NOW) with an esp32. At some point last week the mac address sketch worked, but a day or so ago it wouldnt.

I'm confused, so what are you actually using now?
ESP32 or ESP8266?

Likewise, please provide the current compiler error messages relevant to your current sketch.

Cheers.


   
ReplyQuote
Russ Terry
(@russ-terry)
Member
Joined: 3 years ago
Posts: 16
 

@zander When I say no conflict, the compile messages (extract.txt) said 

Alternatives for WiFi.h: [WiFi@1.2.7]
ResolveLibrary(WiFi.h)
-> candidates: [WiFi@1.2.7]

which (I think) told me it had found only one wifi.h and it was v 1.2.7. In the error message, 2.0.2 refers to hardware, doesnt it? 

...\\esp32\\hardware\\esp32\\2.0.2/to...

I deleted the wifi.h folder in sketches/libraries and got the results in extract 2.txt.

I removed the esp32 boards from the ide and reinstalled them. The only esp32 board download I found in the boards manager list was esp32 by espressif systems, and the highest version shown was 1.0.6. I reinstalled it, selected node32s and  compiled. error msg was no such file or directory. Opened library manager and selected wifi by Arduino, with the highest version being 1.2.7. Compile yields the same messages as in extract.txt, with the bottom section showing Using library WiFi at version 1.2.7 in folder: E:\Arduino\Sketches\libraries\WiFi . So where did the 2.0.2 come from and what version of wifi am I using? Maybe I will try compiling in Platform IO and see what it says.

 

 


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

@russ-terry It sounds like you undid some stuff, and then put it back the same. On My system there is only one WiFi.h it is in the esp32 hardware section as version 1.0.6 which I showed you in the large picture aboce, look at the path info at the bottom that is displayed as a result of me selecting the entry WiFi.h in the search result. Since you also have a WiFi.h in your personal library folder it overrides. you should not have that there.

Yes 2.0.2 is the esp32 hardware version. I got rid of that by deleting the entire Arduino15 dir and re-installing the arduino IDE. Then do NOT allow any updates, just ignore them when prompted to click no or knock down the dialogue box, just don't allow any updates yet.

The last line in extract2.txt says it all, no such file as WiFi.h. If you look at the screen snap below

I did a search on the Arduino15 directory. I searched for WiFi.h. The way the Mac default search works it will find any file with WiFi.h any case in the file name, so that is why there are 3 entries, they all have a pattern of *wifi.h where * is 0 to n characters. The only actual WiFi.h is in the directory that can be seen at the bottom of that screen snap. That is the esp32 at version 1.0.6 header file for that board. NOTE the version number of the header file is something else, 1.0.6 is the board version. Because you allowed an update to 2.0.2 the header file appears to have been deleted. 

If you goto the Arduino15 directory and issue a search for WiFi.h, does it find one. The compiler did NOT as it said in the second screen print below.

It says candidates, notice it is an empty list as denoted by []

Notice the message that says No such file or directory.

What does your search of Arduino15 return for WiFi.h?????

Screen Shot 2022 04 18 at 08.16.46
Screen Shot 2022 04 18 at 10.54.32

 

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.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Russ Terry
(@russ-terry)
Member
Joined: 3 years ago
Posts: 16
 

I had a long reply almost finished when Chrome closed on me and I lost it. I removed the esp32 boards and then went to arduino15, down in the C: tree, I found another esp32 folder (not 1.0.6). Deleted it and reloaded esp32 boards. Compile could not find wifi.h. went to 1.0.6 and copied wifi folder to E:arduino/sketches/libraries and the compile worked. I then deleted the folder from E and it compiles ok, except for this:

C:\Users\rs_te\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\cores\esp32\esp32-hal-spi.c: In function 'spiTransferBytesNL':
C:\Users\rs_te\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\cores\esp32\esp32-hal-spi.c:922:39: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
uint8_t * last_out8 = &result[c_longs-1];
^
C:\Users\rs_te\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\cores\esp32\esp32-hal-spi.c:923:40: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
uint8_t * last_data8 = &last_data;

Cpmpiled again and clean result. Closed arduino and started it again. Compile yielded the above. Recompile was clean. Since it was not an error and does not appear unless I have all compile messages selected, I am satisfied.

Now all I have to do is get my Unix machine to compile.

Thanks so much for your help.


   
ReplyQuote
Page 3 / 4