Comments (33)
PHY_JL1101_compatible_RTL8201F.pdf
The jl1101 is more or less a clone of the rtl8201. Modell ID register values are different.
I added a driver for in Tasmota IDF 4.4 and IDF 5.1. The needed changes to support are done in Tasmota Arduino Core 2.0.12 until 2.0.14 and in alpha 3.0.0 builds.
Look for how it works for the rtl8201 and simply replace the name with jl1101.
Tasmota Ethernet driver where it is used / available https://github.com/arendst/Tasmota/blob/development/tasmota/tasmota_xdrv_driver/xdrv_82_esp32_ethernet.ino
With latest core 3.0.0 alpha build ETH address auto detection is supported.
Btw. i am not related to Dingtian nor i do sell anything. Don't even have such a board.
from espeasy.
Like I said, as soon as the major rewrite in Arduino code is done, I will do a major cleanup in the ESPEasy code to change all network-related code.
It would be a waste of time and effort to do it earlier as the upcoming changes in the Arduino network related code are so significant anything done now will have to be redone then.
I estimate it may take me like 3 full weeks to implement all the network code.
from espeasy.
That specific hardware configuration is currently not supported by the Espressif IDF 5.1 framework used, but that's the first version of the framework to add support for the jl1101 phy. The currently available options in ESPEasy is all that's technically possible to use.
It can be disappointing that some manufacturers, by thinking to implement something 'smart' to distinguish from the crowd, as a result create non-standard/unsupported hardware π
Have they provided information by which frameworks/versions their board is supported?
from espeasy.
Found some more info.
It seems that this board should actually work with the default GPIO17_INV signal for Clock, but the phy address has to be set to 0.
from espeasy.
I don't think it is even possible to select non-inverted GPIO-17 as those options are just an enum in the Arduino/ESP-IDF code.
For RMII based Ethernet boards it is quite important to have the phy address set correctly.
(less important for some SPI based Ethernet chips like the W5500)
from espeasy.
Found some more info. It seems that this board should actually work with the default GPIO17_INV signal for Clock, but the phy address has to be set to 0.
Log espeasy with the setting:
340: ETH PHY Type: JL1101 PHY Addr: 0 Eth Clock mode: 50MHz APLL Inverted Output on GPIO17 MDC: 23 MIO: 18 PWR: 0
341: ETH power ON
768: ETH : Failed to initialize ETH
from espeasy.
Found some more info. It seems that this board should actually work with the default GPIO17_INV signal for Clock, but the phy address has to be set to 0.
In that discussion thread, Jason2866 is the original developer and seller of the Dingtian series of boards
and there they talk about clk_mode: GPIO17_OUT , no inverted.
from espeasy.
Well, I do know Jason2866, so will ask him about it.
from espeasy.
Btw. i am not related to Dingtian nor i do sell anything. Don't even have such a board.
I apologize for the misinformation.
The seller's representative on WhatApp is also named Jason and he gave links to your github claiming that this is a patch made for their product.
from espeasy.
Yes, the patch or better adding a fully working IDF driver for the jl1101 was done to support the Dingitian relay board fully with Tasmota.
from espeasy.
Is there anything I can do to properly initialize Ethernet on a board with espeasy firmware?
Building the latest version from github is not working properly.
from espeasy.
I will have a look at the code, but I don't have such a board so I can't really test it myself.
Which exact build did you try yourself?
N.B. the ESP32-xx builds with LittleFS are using the latest ESP-IDF 5.1 code
from espeasy.
gpio define and ESP-IDF gpio test demo source code
https://github.com/dtlzp/relay_dev_demo
JL1101(compatiable with RTL8201F, only chip id is different)
https://github.com/dtlzp/relay_arduino_demo
this is JL1101 datasheet
https://github.com/dtlzp/relay_dev_demo/blob/main/datasheet/PHY_JL1101_compatible_RTL8201F.pdf
this ESP-IDF patch for JL1101
https://github.com/dtlzp/relay_dev_demo/blob/main/esp-idf-dt-patch/components/esp_eth/src/esp_eth_phy_jl1101.c
from espeasy.
https://github.com/dtlzp/relay_dev_demo/blob/main/esp-idf-dt-patch/components/esp_eth/src/esp_eth_phy_jl1101.c
the "esp_eth_phy_jl1101.c" the only different with "esp_eth_phy_rtl8201.c" is chip ID
JL1101 ID:
id1.oui_msb = 0x937C
id2.oui_lsb = 0x10
id2.vendor_model = 0x2
from espeasy.
@dtlzp I have wrote you a email, regarding support of jl1101 in upcoming Tasmota Arduino Core 3.0.0 (used by ESPEasy too).
from espeasy.
I will have a look at the code, but I don't have such a board so I can't really test it myself.
Which exact build did you try yourself? N.B. the ESP32-xx builds with LittleFS are using the latest ESP-IDF 5.1 code
This binary espeasy firmware
Build:β 20240229 - Mega32
System Libraries:β ESP32 SDK 5.1.2.240206
Binary Filename: ESP_Easy_mega_20240229_custom_ESP32_4M316k_LittleFS_ETH
not working with setting
2225: ETH PHY Type: JL1101 PHY Addr: -1 Eth Clock mode: 50MHz APLL Inverted Output on GPIO17 MDC: 18 MIO: 23 PWR: 0
2225: ETH power ON
2626: ethResetGPIOpins()
2732: ETH : Failed to initialize ETH
from espeasy.
And can you set the GPIO-0 pin on the hardware tab to "output high"?
Then reboot.
If that doesn't work, try to set it to "output low" on the Hardware tab, as it is also marked as a RST pin
See: https://github.com/dtlzp/relay_dev_demo/blob/main/gpio_pinout/8ch.png
from espeasy.
And can you set the GPIO-0 pin on the hardware tab to "output high"? Then reboot.
If that doesn't work, try to set it to "output low" on the Hardware tab, as it is also marked as a RST pin See: https://github.com/dtlzp/relay_dev_demo/blob/main/gpio_pinout/8ch.png
Both choices failed to successfully initialize ethernet.
Powering on phy works correctly.
This is confirmed by enable link indicator on network switch when booting this boars.
On the board itself the green diode also lights up and blinks in rhythm with the received packets.
from espeasy.
ESP-IDF v5.1 modify rtl8201 driver to JL1101 example
code link:
https://github.com/espressif/esp-idf/blob/release/v5.1/components/esp_eth/src/esp_eth_phy_rtl8201.c
JL1101 ID:
id1.oui_msb = 0x937C
id2.oui_lsb = 0x10
id2.vendor_model = 0x2
// modify rtl8201_init
static esp_err_t rtl8201_init(esp_eth_phy_t *phy)
{
esp_err_t ret = ESP_OK;
phy_802_3_t *phy_802_3 = esp_eth_phy_into_phy_802_3(phy);
/* Basic PHY init */
ESP_GOTO_ON_ERROR(esp_eth_phy_802_3_basic_phy_init(phy_802_3), err, TAG, "failed to init PHY");
/* Check PHY ID */
uint32_t oui;
uint8_t model;
ESP_GOTO_ON_ERROR(esp_eth_phy_802_3_read_oui(phy_802_3, &oui), err, TAG, "read OUI failed");
ESP_GOTO_ON_ERROR(esp_eth_phy_802_3_read_manufac_info(phy_802_3, &model, NULL), err, TAG, "read manufacturer's info failed");
//ESP_GOTO_ON_FALSE(oui == 0x732 && model == 0x1, ESP_FAIL, err, TAG, "wrong chip ID");
ESP_GOTO_ON_FALSE(oui == 0x24DF10 && model == 0x2, ESP_FAIL, err, TAG, "wrong chip ID");/* (0x0x937C << 6) | 0x10) == 0x24DF10 */
return ESP_OK;
err:
return ret;
}
from espeasy.
PHY_JL1101_compatible_RTL8201F.pdf The jl1101 is more or less a clone of the rtl8201. Modell ID register values are different. I added a driver for in Tasmota IDF 4.4 and IDF 5.1. The needed changes to support are done in Tasmota Arduino Core 2.0.12 until 2.0.14 and in alpha 3.0.0 builds. Look for how it works for the rtl8201 and simply replace the name with jl1101. Tasmota Ethernet driver where it is used / available https://github.com/arendst/Tasmota/blob/development/tasmota/tasmota_xdrv_driver/xdrv_82_esp32_ethernet.ino With latest core 3.0.0 alpha build ETH address auto detection is supported. Btw. i am not related to Dingtian nor i do sell anything. Don't even have such a board.
Mode in this tasmota driver
ETH_CLOCK_GPIO17_OUT
no mention of inversion
from espeasy.
For your information, we're using this cherry-picked branch of ESP-IDF: https://github.com/tasmota/esp-idf/blob/release/v5.1/components/esp_eth/src/esp_eth_phy_jl1101.c
@Jason2866 does maintain this branch and also a special cherry picked branch of espressif/Arduino so we are able to use IDF 5.1 and the latest Arduino code as a PlatformIO package.
This is needed as there is no official PlatformIO package for the latest ESP-IDF/Arduino code and we need to support the latest Espressif SoC's and Ethernet chips out there (e.g. SPI connected Ethernet)
Anyway, at first glance I don't see anything wrong in the code added by @Jason2866
from espeasy.
@tabunslonopotamov
Can you make the following change in platformio_core_defs.ini
in [core_esp32_IDF5_1__3_0_0]
platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/2151/framework-arduinoespressif32-release_v5.1-1a0b6e0.zip
This wil use the latest PlatformIO framework package @Jason2866 built last night.
from espeasy.
platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/2151/framework-arduinoespressif32-release_v5.1-1a0b6e0.zip
Thank you.
The firmware compiled with this version of idf successfully initialized Ethernet.
Parameters in ESPEasyGPIO β
Ethernet PHY type: JL1101
Ethernet PHY Address: 0
Ethernet MDC/CS pin: web: GPIO-23
GPIO β Ethernet MDIO/IRQ pin: GPIO-18
GPIO β Ethernet Power/RST pin: GPIO-0
Ethernet Clock: 50MHz APLL Inverted Output on GPIO-17
from espeasy.
Can you also check whether it does still work if you unplug the Ethernet connector and replug it?
from espeasy.
Can you also check whether it does still work if you unplug the Ethernet connector and replug it?
after disconnecting ethernet plug , the board did not ping to any of the 2x IP addresses (WiFi and Ethernet) for 5-10 seconds.
After turning the rj45 connector back on
ping to Ethernet IP was restored instantly, less than 1 second. ( Ping to WiFi IP immediately lost )
from espeasy.
WiFi probably had to perform a full scan, so that may take upto 6 sec.
Sounds like expected behavior.
from espeasy.
from espeasy.
If you perform the same unplug/plug test as before within 5 minutes from each test then the WiFi connection will be way more quickly.
If you have checked the checkbox "Use Last Connected AP from RTC" on the Tools->Advanced page , the WiFi reconnect may be near instant (< 1 sec)
from espeasy.
If you perform the same unplug/plug test as before within 5 minutes from each test then the WiFi connection will be way more quickly. If you have checked the checkbox "Use Last Connected AP from RTC" on the Tools->Advanced page , the WiFi reconnect may be near instant (< 1 sec)
thanks for the tip
Is it possible to make both IPs available all the time?
from espeasy.
Nope, currently there is no support for 'routing' between interfaces.
This might be added later as there is support in ESP-IDF for multiple Ethernet interfaces (mainly SPI with interface)
But right now the support for multiple interfaces and IP routing in Arduino is "minimal" to put it mildly.
As soon as the pending pull request in the Arduino code to redesign the complete network code is complete, I will also do a large overhaul in the ESPEasy network code as it has grown (mainly the WiFi code) to a big kludge of way too complex code due to working around undocumented bugs in the WiFi code. (most of it related to ESP8266)
from espeasy.
Making both IPs reachable does not mean routing. With Tasmota the device is reachable via the WiFi and the Ethernet IP at the same time when both are connected.
from espeasy.
I have made it deliberately a XOR state in ESPEasy as in my opinion it often only causes issues if both interfaces are in the same subnet.
When the PR for network rewrite is done, I will make it configurable which interface is enabled, which is the preferred one to act as a gateway, etc.
And also add some predefined order of states when only a single interface should be active. (e.g. when Ethernet is not plugged in, consider WiFi as fallback)
from espeasy.
I have made it deliberately a XOR state in ESPEasy as in my opinion it often only causes issues if both interfaces are in the same subnet. When the PR for network rewrite is done, I will make it configurable which interface is enabled, which is the preferred one to act as a gateway, etc. And also add some predefined order of states when only a single interface should be active. (e.g. when Ethernet is not plugged in, consider WiFi as fallback)
We consider WiFi as a backup. But I would like to be able to monitor that the backup route is βaliveβ and available before the Ethernet fails.
from espeasy.
Related Issues (20)
- RFID - Wiegand / Problem with values name HOT 2
- [Test build] Testers for new upcoming build (March '24) HOT 25
- [FR] Support Elecrow ESP32 HMI Touch panels HOT 4
- [P008] on ESP32-C3 not receive correct data HOT 12
- ESP8266 MQTT disconnecting & reboot ESP 1-3 minutes HOT 11
- HX711 temp compensation[FR] HOT 2
- New Release HOT 6
- [BUG] ESP32-C3/-C6 not working well in latest build HOT 4
- [BUG] Plugin 135 - SCD4x freeze after some times HOT 19
- [FR]Provide storage information in JSON output HOT 2
- WIFI Connection after cold boot HOT 44
- [FR] add OLED display support for sh1107 128x128px HOT 2
- lost in build ;o) HOT 4
- no module named 'recommonmark' HOT 3
- the revenge of issue with rs232 HOT 2
- [BUG]No AP showing up when the sensor can't connect to known SSID HOT 4
- [FR] VL53L0x & VL53L1x ToF sensors - Add Direction value HOT 5
- Information of which set contains which plugin HOT 7
- RTTL Buzzer HOT 6
- OW list unsupported devices HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from espeasy.