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

Warning, do not update to dev release 0.5.108 or greater if you don´t have the pinout on your desk #812

Closed
rmayergfx opened this issue Mar 27, 2023 · 14 comments
Assignees
Labels

Comments

@rmayergfx
Copy link

rmayergfx commented Mar 27, 2023

Dev. Fix 0.5.108

merge: PR SPI pins configureable (ESP32) #807, #806

Will break your connection to your nrf24l01+ as the additional GPIO Settings will be set to default.
in my case with a board from Solarmodule-Gladbeck the nrf24l01+ is no longer available until you change
the default settings. My working settings was for this board is up to v0.5.107:
CS: GPIO5
CE: GPIO33
IRG: GPIO27

both LED off, but red one still is on.

Pin description from manufacturer for the circuit board:

MISO: 19
MOSI: 23
CLK: 18
IRQ: 27
EN: 33
CS: 5

@lumapu
Please change Default Settings MISO, MOSI, CLK not to 0!

@markusdd
Copy link
Contributor

markusdd commented Mar 27, 2023

Hi, these do not get changed to 0, but it might be required to erase the settings store and re-import or re-set them.

If you use a generic build, this is what happens:

ahoy/src/config/config.h

Lines 46 to 66 in 1d0860f

#if defined(ESP32)
// this is the default ESP32 (son-S) pinout on the WROOM modules for VSPI,
// for the ESP32-S3 there is no sane 'default', as it has full flexibility
// to map its two HW SPIs anywhere and PCBs differ materially,
// so it has to be selected in the Web UI
#define DEF_CS_PIN 5
#define DEF_CE_PIN 4
#define DEF_IRQ_PIN 16
#define DEF_MISO_PIN 19
#define DEF_MOSI_PIN 23
#define DEF_SCLK_PIN 18
#else
#define DEF_CS_PIN 15
#define DEF_CE_PIN 2
#define DEF_IRQ_PIN 0
// these are given to relay the correct values via API
// they cannot actually be moved for ESP82xx models
#define DEF_MISO_PIN 12
#define DEF_MOSI_PIN 13
#define DEF_SCLK_PIN 14
#endif

The compile defaults do not break legacy, so the pinout for CLK/MISO/MOSI are the same they have implicitly been for ESP8266 and ESP32 all the time.

We might not be able to save everyone from re-doing some of the settings though as to accomodate the new SPI pins we had to modify the settings storage.

@Argafal
Copy link
Contributor

Argafal commented Mar 27, 2023

To summarize: any user that upgrades to v108 or higher has to update their settings.

ESP8266 users have to save and restart without actual changes, as they cannot configure MISO, MOSI, SCLK. Those Pins are fixed on ESP8266. However, the save and restart of ahoy is required once. (at least it was like that for me)

ESP32 users need to keep CS, CE, IRQ as they always were and change MOSI, MISO and SCLK as follows:

MISO: 19
MOSI: 23
CLK: 18

Correct?

@markusdd
Copy link
Contributor

as long as they do not have some exotic ESP32 board yes. (as ahoy could never change these pins that should hold for all users, only OpenDTU could do that until now).

@Argafal
Copy link
Contributor

Argafal commented Mar 27, 2023

So far no one could have had an ESP32 board with Ahoy were SPI wasn't 19/23/18. So I don't expect that to be an issue. Maybe @rmayergfx can change the title of this issue, cause one doesn't need a specific pinout to resolve this, it's always the same. It just needs to be manually set once.

@markusdd
Copy link
Contributor

let me make a quick PR that updates the docs as well.

@rmayergfx
Copy link
Author

rmayergfx commented Mar 27, 2023

So when it is not changed why does a user need to setup this after update? why not set this to default settings instead of 0 after update? Would be great to have working defaults, also if the storage changes or not.

@markusdd
Copy link
Contributor

markusdd commented Mar 27, 2023

because we have no way to tell. If there is a 0 in the flash at that position, that could well mean pin0.

Only if we would see an erased cell at 255, that could prompt us to use the default.

This si s developing project, and the non-configurability of SPI pins was a shortcoming coming from the 8266-only days.

There can be instances where an update introduces slightly breaking changes. Also, this is a devlopment branch. You should be able to deal with something like this, or not use it.

@rmayergfx
Copy link
Author

What about a hint in the GUI near the Settings to show the "default" Settings? Just to give a hint what GPIO should be there?
e.g. SCLK (def. GPIO18)
Think this will be great to new or non technic users.

@markusdd
Copy link
Contributor

The defaults only apply to standard ESP32 boards.
For new ESP32-C3 and S3 there is absolutely no way to tell what a sane default is.
And for new users which flash a new device the defaults will be set.

This only happens to users that have a pre-existing config.

Please test by making a full erase and flash it like a new device.
Then the pin setting should be the correct default.

@rmayergfx
Copy link
Author

Siehe #838
Da werden auch noch mehr kommen. Können wir nicht per Default die Standardwerte setzen?

@duracell
Copy link

duracell commented Apr 1, 2023

Ah, ich bin auch in die Falle getappt :(
Könnte man es ansonsten nicht in die Release-Notes schreiben? (Also wenn es nicht irgendwo stand und ich es übersehen habe.)

@markusdd
Copy link
Contributor

markusdd commented Apr 1, 2023

es steht in den release notes des commits, und auch im getting started. leider nicht in denen der release area. @lumapu kann man das ggf noch fixen?

@lumapu
Copy link
Owner

lumapu commented Apr 1, 2023

@markusdd ich hoffe so wie ich es jetzt eingetragen habe ist es korrekt

@markusdd
Copy link
Contributor

markusdd commented Apr 1, 2023

@markusdd ich hoffe so wie ich es jetzt eingetragen habe ist es korrekt

Traumhaft! Danke dir.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants