Skip to content
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

Please add name support to the MQTT broker fields. #754

Open
marcobrianza opened this issue Mar 15, 2024 · 15 comments
Open

Please add name support to the MQTT broker fields. #754

marcobrianza opened this issue Mar 15, 2024 · 15 comments
Assignees

Comments

@marcobrianza
Copy link

ESPixelStick Firmware Version
4.0-ci8282977806

Hardware Version
Dig-Octa

Binary release or compiled yourself?
CI release

Describe the bug
The board is configured with this config
ESPixelStick-5C695A1B5AE0-static-ip.json

The configuration has a static IP on the ethernet port and AP mode on Wi-Fi
Sometimes at board power up correctly applying a static ip with this log:

[FileMgr] Configuration File: '/config.json' saved 655 bytes.
[WiFiDrv] WiFi Entering State: Connecting As AP
[WiFiDrv] WiFi SOFTAP: ssid: 'ESPixelStick-AP-esps-5C695A1B5AE0
[WiFiDrv] WiFi SOFTAP: IP Address: '0.0.0.0
[EthDrv] Entering State: Powering Up
[ 12551][E][esp32-hal-gpio.c:102] __pinMode(): Invalid pin selected
E (12545) gpio: gpio_set_level(227): GPIO output gpio_num error
[EthDrv] Entering State: Connecting
[EthDrv] ETH IP Before Start: 0.0.0.0
[EthDrv] Ethernet Connecting as esps-5C695A1B5AE0
[EthDrv] Connecting to Ethernet with Static IP
[EthDrv] Entering State: Wait for IP Address
[EthDrv] Entering State: Got IP
[Artnet] Subscribed to broadcast
[Artnet] Listening for 400 channels from Universe 1 to 1
[WebMgr] Web server listening on port 80
[ FPPD] FPPDiscovery subscribed to broadcast messages on port: 32320
[ FPPD] FPPDiscovery subscribed to multicast: 239.70.80.80:32320
[EthDrv] Ethernet Connected with IP: 192.168.72.90

Sometimes instead the boars get an IP in DHCP with this log:

[FileMgr] Configuration File: '/config.json' saved 655 bytes.
[WiFiDrv] WiFi Entering State: Connecting As AP
[WiFiDrv] WiFi SOFTAP: ssid: 'ESPixelStick-AP-esps-5C695A1B5AE0
[WiFiDrv] WiFi SOFTAP: IP Address: '0.0.0.0
[EthDrv] Entering State: Powering Up
[ 12856][E][esp32-hal-gpio.c:102] __pinMode(): Invalid pin selected
E (12850) gpio: gpio_set_level(227): GPIO output gpio_num error
[EthDrv] Entering State: Connecting
[EthDrv] ETH IP Before Start: 0.0.0.0
[EthDrv] Ethernet Connecting as esps-5C695A1B5AE0
[ 16495][E][ETH.cpp:432] config(): STA IP could not be configured! Error: 20487
[EthDrv] Connecting to Ethernet with Static IP
[EthDrv] Entering State: Wait for IP Address
[EthDrv] Entering State: Got IP
[Artnet] Subscribed to broadcast
[Artnet] Listening for 400 channels from Universe 1 to 1
[WebMgr] Web server listening on port 80
[ FPPD] FPPDiscovery subscribed to broadcast messages on port: 32320
[ FPPD] FPPDiscovery subscribed to multicast: 239.70.80.80:32320
[EthDrv] Ethernet Connected with IP: 192.168.72.137

I cannot trace the cause of the issue. I have tried in powering the board with 24V since by USB it was causing issues sometimes, but the issue still presents itself.

@marcobrianza
Copy link
Author

Setting Power Active Delay (MS) to 2000 instead of 1000 looks like reduces issue but still happens sometimes, going to 3000 does not help further. I still think there should be a software level intervention to fix it

@marcobrianza
Copy link
Author

For the sake of tracking down the issue I also tested a WT32-ETH01 board and the issue is also present

@MartinMueller2003
Copy link
Collaborator

The issue is happening in the lower level kernel code. Not sure there is much we can do about it at the application level.

This error comes from the kernel driver:
[ 16495][E][ETH.cpp:432] config(): STA IP could not be configured! Error: 20487

I will take a look at what it is complaining about, but there will be very little I can do about it.

@MartinMueller2003
Copy link
Collaborator

It looks like the issue should be fixed. However, based on your feedback it may still be broken in the IDF version we are using. I added a few delays per espressif/arduino-esp32#5733
You should be able to grab the build artifacts from my branch at 16:30 EDT and test.

@marcobrianza
Copy link
Author

Hi, I built your branch and did not get anymore a dynamic IP so far after at least 10 power cycles 🎉
great job as usual 🥇

@marcobrianza
Copy link
Author

While you are on the topic I noticed we don't have DNS entry for the static IP settings, I could turn handy in case someone needs for example to configure a MQTT server by name instead of IP

@MartinMueller2003
Copy link
Collaborator

i will add them

@MartinMueller2003 MartinMueller2003 self-assigned this Mar 17, 2024
@marcobrianza
Copy link
Author

I tested the latest CI release and consider this solved

@MartinMueller2003
Copy link
Collaborator

Added support for manually configured Primary and secondary DNS addresses used while in Static IP mode. PR Created.

@marcobrianza
Copy link
Author

Hi I quickly tested the feature and came across a related issue in the interface where the Broker IP is limited and cannot use a long name

broker

@marcobrianza marcobrianza reopened this Mar 18, 2024
@MartinMueller2003
Copy link
Collaborator

By design, we do not allow names in those fields they are intentionally limited to IP addresses.

@marcobrianza
Copy link
Author

do you intend to change it to allow names? if not the DNS filelds you just added becomes useless in my opinion.

@MartinMueller2003
Copy link
Collaborator

I could. However, I would want @forkineye to weigh in on this since he originally designed how this works and may have had a reason why it was done this way.

@forkineye
Copy link
Owner

There's no reason we couldn't. We just never had DNS configuration in the past.

@MartinMueller2003
Copy link
Collaborator

I will add support for using names in the MQTT broker config.

@MartinMueller2003 MartinMueller2003 changed the title Dig-Octa gets dynamic IP sometimes instead of static IP Please add name support to the MQTT broker fields. Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants