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

Can't change WiFi mode #2

Open
dwarning opened this issue Jul 4, 2022 · 6 comments
Open

Can't change WiFi mode #2

dwarning opened this issue Jul 4, 2022 · 6 comments

Comments

@dwarning
Copy link

dwarning commented Jul 4, 2022

I am trying to configure station mode to connect to my home network. So I put in my home SSID and the wifi key. WiFi mode selector stands with blue on "Connect to an existing access point". After Save I disconnect and started new. But the NodeMCU is still an access point 10.1.1.1.
This I made with NodeMCU prog switch and without, doesn't matter.

@alvra
Copy link
Owner

alvra commented Jul 5, 2022

Thank you for trying it out! Which device are you using?
From your description it sounds like you've configured and saved the WiFi mode correctly so the question is why the mode isn't retained properly.
If you connect the device via serial over USB and read the debugging info, that might give some indication of what goes wrong. Here are some ideas though.

  1. Changing WiFi mode required a restart. The info page should show a yellow note reminding you that the currently saved configuration is not active yet until you restart. If you don't see this message then the config wasn't saved yet. You should also see the new config values in the config page (but not the info page).

  2. On startup, if the "boot mode" button is pressed, it overrides the stored config. If pressed shortly, the device falls back to access point. Of the button is held for 5 seconds (RESET_CONFIG_THRESHOLD), the config is reset to default.
    Maybe this button (pin 0 ; BOOT_MODE_BUTTON_PIN) is connected differently on your device, or is being pulled low for some reason?

  3. Are the WiFi name and password of the access point different as the one you're trying to connect to or is it using the default name (NMEA Bridge)? In other words; is the complete config not updating or is there a problem with just the WiFi mode?

I hope this is helpful. Let me know what you find :)

@dwarning
Copy link
Author

dwarning commented Jul 5, 2022

Thank you for the detailed answer.
My board is a "Serial wifi v1.0" board with esp8266, simple UART interface (instead usb), a switch for programming and uart operation mode, an a reset button. I am using Arduino IDE with USB-Serial board for programming. The NMEA transmission to wifi working fine and I can access the web interface 10.1.1.1. This is done as an access point.
I want change this as described above to connect to my home network by inserting ssid and wifi key and push "Save". If I change then to info page my changes are not shown - still the access point values. The yellow reminder appears.
If I make then an repower the access point is tarting as before. Same for pushing the reset button short or long 5s.
to 3.: I am using my home SSID and the WiFi key as I am using for other devices to connect to my network.
DEBUG macro is set, but serial output only indicating the access point starting with web server and web socket server.

EDIT: After studying the code I see few dependencies from boot mode button on pin 0. I think this for NodeMCU board and not for mine Serial wifi v1.0 board.

@alvra
Copy link
Owner

alvra commented Jul 26, 2022

If the pins are connected differently on your board, that would explain this issue. Maybe the "boot mode" pin is being held low which resets the config. If the led pin does matches the code, you should see a long_indicator_blink (1 second led on) in this case.

Have you tried changing the "boot mode" pin to match your board as you mentioned?
If you manage to get it working I will update the documentation accordingly.

@dwarning
Copy link
Author

This is my board:

c967036d00a139fb9e22f1cf239e5f617d771e06

The black switch (!) is for switching between uart and programming mode. I believe it is GPIO0 to gnd in prog. mode.
The white button is only reset.
For programming with your software everything is fine.
Question is: I I want change config e.g. baudrate over web interface will it written into flash? And have I to change the the switch from uart to prog?

@dwarning
Copy link
Author

Can you describe your used hardware in your documentation, especially the buttons and switches. It seems different and the reason for the nonfunctional web programming feature.

@Fire-Power
Copy link

I have experienced the problem switching to station Wi-Fi mode. I have concluded by looking at the debug output, that the reason it fails to successfully connect, is because it finds the router Wi-Fi OK and connects but the gateway address in the ESP8266 is still left set to 10.1.1.1. So the ESP8266 can not route, and the connection fails.

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