-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ethernet component under IDF v5 #82
Comments
Supported IDF version is ESP-IDF v5.1.1 |
Unfortunately I tried with v5.1 and the result is the same. I have checked the migrating guide and it does not mention anything about peripheral from v5.1 to v5.2, only v4 to v5, which I already did but no good. |
Ok so I must have broken something doing the upgrade to IDF v5 . I'll check as soon as I can. What you can try in the meantime is to find the original Ethernet Basic Example from IDF v5.1.1 and see if you can replace it in eth_interface. I took this example and adapted it to my needs but it is based on IDF v4.3 and that's probably the issue |
I did a quick check and it seems they changed a few things in this example. So there's gonna be some more work to do on that end I guess |
I attempted to port the newer example to this project, but interestingly it failed with the exact same problem. I am starting to think I got a broken environment, as I followed the suggestion exactly. I'll try again later with a fresh install of v5.1 in a Linux environment. |
@whc2001 ok I am a bit lost here ...
The only inclusion which is found seems to be I've tried adding Not sure if this is related but I found |
Ok so it seems you'll need to replace Cmakefilelist.txt content of eth_interface component by this
To make those inclusion errors go away. You'll still need to port the code afterwards. Not sure why the if else isn't working as expected anymore... |
I got a new Linux environment and tried this, still complaining about unable to find |
Can you please check this, seems like it's compiling for me. My ESP32 board does not have GPIO21 broken out so I need to get another one to test on hardware... https://github.com/whc2001/snapclient/tree/idf_v5_eth |
That's what I meant with my comment above. I'll try as soon as I can |
Seems no good. Added some debug print:
Not sure if it's the driver or the knockoff Waveshare LAN8720A module. Gonna inspect further later... |
I can't tell you @whc2001 how much I love the docker image. This IDF stuff is really annoying to install. So maybe use the docker image instead for getting your dev machine ready. I know that it's code related see this as a friendly suggestion;-) |
@whc2001 OK i found the problem. First you forgot to enable this in main.c
Altough I am not sure if you'll need this as I don't know how you provide the clock to your LAN8720. This is specific to the my board design. Another thing you need to add right after this line is
With these changes my Ethernet chip initializes and starts up correctly. I am looking forward to your pull request :) |
Thanks, I already got the environment ready for now.
I am using the WaveShare module where it contains the onboard active oscillator. I decided to ignore the GPIO5 clock inhibit signal for now (as we talked about making it a separate config in #79 before) and just reset multiple times until it boots. I tried to set the |
Nvm, silly error ;)
I'll do some test then generate a pull request for just migrating ethernet to IDF v5 for now. After that I'll look into splitting the clock inhibit signal into separate menuconfig. |
I totally agree with this logic. After doing this the However it does not seem to fix the issue. It still hangs just after connection for some reason. The green LED on the RJ45 does not blink often, and I cannot ping it. I am not sure what is happening and I might need to test this module with some other program to ensure that the module itself is working. I'll report back ASAP. Sorry for that. |
Good news, the LAN8720A module works perfectly; Bad news, now I'm not even sure where is the problem ;) |
Which board are you using? |
Did you enable sample insertion (still experimental) in menuconfig? If you did, try disabling it. |
I am using a generic ESP32-WROVER dev module (I didn't enable PSRAM for now because seems like it creates more problems) and a WaveShare LAN8720A clone. I have tested with Arduino and ESPHome that this configuration could work (make connection, obtain info from DHCP, ping from another host, connect to icanhazip.com and print out public IP).
I did, I just tried to disable it and there is no change. After ethernet just connected it would sometimes ping once or twice, but as soon as SnapClient starts running it's lost. |
Did you try using wifi to test if it works that way? |
If I use WiFi seems like the connection can be made, but it looks very unstable. |
Firstly really sorry for taking your time, it turns out I was a total idiot. The following two images speak themselves. I was gonna to wire up the MAX98357 just arrived, only when I realized I never change the default I2S pins which are occupied already by the ethernet MAC. After setting them to spare pins (there really aren't many since the LAN8720 already took a lot of pins) and recompiling again... 8bb85f5da1e2c4c4e02d06118c98a0c6.mp4Still two things to do, the first is the configurable clock inhibit GPIO which should be easy. Another is that if you pull the ethernet cable when it's working, the last audio frame would repeat indefinitely (if you ever experienced a bluescreen when there is audio playing you know how it sounds like) until it reconnected or reset is performed. It should somehow listen to the Unfortunately I will go on another trip which includes my graduation ceremony in June, so it might still take me some time... |
Ok good to know it mostly works now. Maybe we could do a sanity check regarding double use of gpios during cmake.
Good thinking. I've never unplugged the cables since I installed my clients :) |
Oh and congratulations 🎊 |
Clock enable GPIO is added to the menuconfig. Also I've added the functionality to opt for static IP instead of DHCP (although it would make more sense to configure a static lease in the DHCP server, but I needed a quick and dirty static IP when testing with direct ethernet connection to my computer w/o DHCP server, so why not). Tested with hardware and seems like it's working. However As for the network connection/disconnection detection, I am thinking about creating a new component (something like |
I'd love to see this implemented. The improv component could benefit from this too. |
Sorry for the long delay, but I'm really sorry that this issue might have to go stale. Firstly, I was increasingly busier recently and in the near future, and I may not have a lot of time for this. I later tested and was no longer able to reproduce the issue (after disconnecting the ethernet cable, the inner loop breaks eventually and it would go back to reconnecting). Secondly, frankly speaking I was looking at this issue because I assumed myself to have the need for wired ethernet. However later I found that WiFi connection is my only option due to interior layout, so I no longer have the motivation on it. And finally, as the last straw that broke the camel's back, I was no longer able to find my LAN8720A module anywhere, which I think I lost it by mistake in the trip. Considering I wouldn't need it in near future I decided I'm too lazy to buy a new one. Again I am really sorry that I cannot finish this issue. Although I think it still works somehow in the current state. |
No worries. I use wired ethernet and the only problem I found is when the server is restartet I have to power cycle all clients for some reason. Not sure if this happens with wifi too... |
I can confirm that on WiFi this seems not a problem. After the connection is dropped it will immediately attempt to reconnect to the server indefinitely. In my new issue I tested different server configuration for many times, after |
Testing with
sync_with_sample_stuffing
branch underESP-IDF v5.2.1
:After adding
eth_interface
into thePRIV_REQUIRES
statement inmain/CMakeList.txt
:Tried to add
REQUIRES driver
orPRIV_REQUIRES driver
to theidf_component_register
statement incomponents/eth_interface/CMakeLists.txt
, still the same error.The text was updated successfully, but these errors were encountered: