Shelly Plus Plug S - GPIO 10 is missing

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
dsiggi
New user
Posts: 8
Joined: 12 Nov 2024, 21:31

Shelly Plus Plug S - GPIO 10 is missing

#1 Post by dsiggi » 12 Nov 2024, 21:36

Hi,
I flashed ESP_Easy_mega_20240822_energy_ESP32_4M316k.bin to an Shelly Plus Plug S.
This socket has an BL0937 chip which is connected to gpios 10, 19 and 22.
The problem is that gpio 10 is not in the gpio list when I configure the device.

Did I miss something? I hope someone can help me.

TD-er
Core team member
Posts: 9884
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Shelly Plus Plug S - GPIO 10 is missing

#2 Post by TD-er » 12 Nov 2024, 21:46

See "best pins to use on ESP32":
GPIO-10 is used for flash.

Also confirmed here: https://randomnerdtutorials.com/esp32-p ... nce-gpios/

So I wonder why it isn't on the Shelly...

Can you show which ESP model is detected (see sysinfo page) ?
Maybe this is one with embedded flash (should also be shown on the sysinfo page) and then there are more pins available for other uses.

dsiggi
New user
Posts: 8
Joined: 12 Nov 2024, 21:31

Re: Shelly Plus Plug S - GPIO 10 is missing

#3 Post by dsiggi » 12 Nov 2024, 21:49

Hi,
here are the infos.

Code: Select all

ESP Board
ESP Chip ID:	6218164 (0x5EE1B4)
ESP Chip Frequency:	240 [MHz]
ESP Crystal Frequency:	40 [MHz]
ESP APB Frequency:	80 [MHz]
ESP Chip Model:	ESP32-U4WDH
ESP Chip Features:	Wi-Fi bgn / BLE / Emb. Flash
ESP Chip Revision:	3.1
ESP Chip Cores:	2
ESP Board Name:	Espressif Generic ESP32 4M Flash ESPEasy 1810k Code/OTA 316k FS
Storage
Flash Chip ID:	Vendor: 0x20 Device: 0x4016 (Embedded)
Flash Chip Real Size:	4096 [kB]
Flash IDE Size:	4096 [kB]
Flash Chip Speed:	80 [MHz]
Flash IDE Speed:	80 [MHz]
Flash IDE Mode:	DIO
Flash Writes:	20 daily / 33 boot
Sketch Size:	1458 [kB] (2752 kB free)
Max. OTA Sketch Size:	2752 [kB] (2818048 bytes)
SPIFFS Size:	404 [kB] (250 kB free)
Page size:	256 [byte]
Block size:	8192 [byte]
Number of blocks:	50
The pin mapping is documented here: https://templates.blakadder.com/shelly_plus_plug_S.html

TD-er
Core team member
Posts: 9884
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Shelly Plus Plug S - GPIO 10 is missing

#4 Post by TD-er » 12 Nov 2024, 21:57

This is actually the first ESP32 (classic) I see with embedded flash, or at least that it correctly shows the embedded flash flag.

Can you try a 'solo1' build?
There is an energy_ESP32solo1_4M316k_LittleFS_ETH build

N.B. Since this is a different file system, it will erase the current settings.
It should however keep WiFi credentials.

The solo1 build will use different flags and should also have other GPIO pins marked as being used for flash.

Make sure you can recover from serial if needed, as I have not tested solo1 builds often.

dsiggi
New user
Posts: 8
Joined: 12 Nov 2024, 21:31

Re: Shelly Plus Plug S - GPIO 10 is missing

#5 Post by dsiggi » 12 Nov 2024, 22:27

Hi,
I flashed the solo1 firmware. Still no gpio 10.
Also I got this error in log.

Code: Select all

197047: ClearInFile: config.dat ERROR, Cannot save to file
197050: FS : Error while reading/writing config.dat in 1764
On the info site I see this:

Code: Select all

Little FS Size:	0 [kB] (0 kB free)

TD-er
Core team member
Posts: 9884
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Shelly Plus Plug S - GPIO 10 is missing

#6 Post by TD-er » 12 Nov 2024, 22:42

OK, so let's flash it back then and we must make some code changes to allow GPIO-10 to be used on ESP32-classic when "embedded flash" is detected.

TD-er
Core team member
Posts: 9884
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Shelly Plus Plug S - GPIO 10 is missing

#7 Post by TD-er » 12 Nov 2024, 23:24

Made a pull request for this: https://github.com/letscontrolit/ESPEasy/pull/5161

Should be built in this GH-actions build: https://github.com/letscontrolit/ESPEas ... 1806764401

dsiggi
New user
Posts: 8
Joined: 12 Nov 2024, 21:31

Re: Shelly Plus Plug S - GPIO 10 is missing

#8 Post by dsiggi » 13 Nov 2024, 12:31

Super, thank you.

dsiggi
New user
Posts: 8
Joined: 12 Nov 2024, 21:31

Re: Shelly Plus Plug S - GPIO 10 is missing

#9 Post by dsiggi » 13 Nov 2024, 12:49

Okay,
I flashed the ESP_Easy_mega_20241112_energy_ESP32_4M316k.bin file from https://github.com/letscontrolit/ESPEas ... 1806764401 but still no gpio 10.

TD-er
Core team member
Posts: 9884
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Shelly Plus Plug S - GPIO 10 is missing

#10 Post by TD-er » 13 Nov 2024, 15:35

Hmm that's strange...
I will have another look to see if there is another piece of code which 'denies access' to this GPIO pin...

TD-er
Core team member
Posts: 9884
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Shelly Plus Plug S - GPIO 10 is missing

#11 Post by TD-er » 13 Nov 2024, 15:37

Does it show on the sysinfo page something about the presence of PSRAM?
Is it marked as 'internal'?

dsiggi
New user
Posts: 8
Joined: 12 Nov 2024, 21:31

Re: Shelly Plus Plug S - GPIO 10 is missing

#12 Post by dsiggi » 13 Nov 2024, 15:43

Hi,
the only info about RAM is the Free RAM: 228196 [byte] (208616 - ).

Code: Select all

Unit Number:	0
Local Time:	2024-11-13 15:41:35
Time Source:	NTP
Time Wander:	-18.718 [ppm]
Uptime:	02h54m
Load:	16.53 [%] (LC=13565)
Internal Temperature:	49.67 [°C]
CPU Eco Mode:	false
Boot:	Soft Reboot (1)
Reset Reason:	CPU0: Software reset CPU CPU1: for APP CPU, reset by PRO CPU
Last Action before Reboot:	Const Interval: TIMER_100MSEC
SW WD count:	0
Memory
Heap Size:	323908 [byte]
Heap Min Free:	208616 [byte]
Free RAM:	221524 [byte] (208616 - )
Heap Max Free Block:	110580 [byte]
Free Stack:	6736 [byte] (4848 - )
Network
IP Config:	DHCP
IP / Subnet:	192.168.5.219 / 255.255.255.0
Gateway:	192.168.5.1
Client IP:	192.168.5.108
DNS:	192.168.5.1 / 0.0.0.0
Allowed IP Range:	All Allowed
Connected:	00:27:55.383
Number Reconnects:	8
WiFi ?
WiFi Connection:	802.11n (HT20) (RSSI -66 dBm)
SSID:	xxx
WiFi TSF time:	3T04:16:24.134504
Channel:	11
Encryption Type:	WPA2/PSK
Last Disconnect Reason:	(200) Beacon timeout
Configured SSID1:	xxx
Configured SSID2:	
STA MAC:	E4:65:B8:5E:E1:B4
AP MAC:	00:00:00:00:00:00
WiFi Settings
Force WiFi B/G:	false
Restart WiFi Lost Conn:	false
Force WiFi No Sleep:	false
Periodical send Gratuitous ARP:	false
Connection Failure Threshold:	0
Max WiFi TX Power:	17.50 [dBm]
Current WiFi TX Power:	14.00 [dBm]
WiFi Sensitivity Margin:	3 [dB]
Send With Max TX Power:	false
Extra WiFi scan loops:	0
Use Last Connected AP from RTC:	false
Passive WiFi Scan:	true
Hidden SSID Slow Connect:	true
Include Hidden SSID:	false
Enable SDK WiFi Auto Reconnect:	false
Firmware
Build:⋄	20241112 - Mega32
System Libraries:⋄	ESP32 SDK 632e0c2-dirty
ESP-IDF Version:⋄	5.1.4
Git Build:⋄	HEAD_aff5c32
Plugin Count:⋄	60 ["Normal","Energy"]
Build Origin:	GitHub Actions
Build Time:⋄	Nov 12 2024 22:36:46
Binary Filename:⋄	ESP_Easy_mega_20241112_energy_ESP32_4M316k
Build Platform:⋄	Linux-6.5.0-1025-azure-x86_64-with-glibc2.35
Git HEAD:⋄	HEAD_aff5c32
System Status
Syslog Log Level:	None
Serial Log Level:	Info
Web Log Level:	None
Enable Serial Port Console:	true
Console Serial Port:	HW Serial0 RX:3 TX:1 @ 115942 baud
Network Services
Network Connected:	✔
NTP Initialized:	✔
ESP Board
ESP Chip ID:	6218164 (0x5EE1B4)
ESP Chip Frequency:	240 [MHz]
ESP Crystal Frequency:	40 [MHz]
ESP APB Frequency:	80 [MHz]
ESP Chip Model:	ESP32-U4WDH
ESP Chip Features:	Wi-Fi bgn / BLE / Emb. Flash
ESP Chip Revision:	3.01
ESP Chip Cores:	2
ESP Board Name:	Espressif Generic ESP32 4M Flash ESPEasy 1810k Code/OTA 316k FS
Storage
Flash Chip ID:	Vendor: 0x20 Device: 0x4016 (Embedded)
Flash Chip Real Size:	4096 [kB]
Flash IDE Size:	4096 [kB]
Flash Chip Speed:	80 [MHz]
Flash IDE Speed:	80 [MHz]
Flash IDE Mode:	DIO
Flash Writes:	6 daily / 6 boot
Sketch Size:	1509 [kB] (2752 kB free)
Max. OTA Sketch Size:	2752 [kB] (2818048 bytes)
SPIFFS Size:	404 [kB] (250 kB free)
Page size:	256 [byte]
Block size:	8192 [byte]
Number of blocks:	50

TD-er
Core team member
Posts: 9884
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Shelly Plus Plug S - GPIO 10 is missing

#13 Post by TD-er » 13 Nov 2024, 15:55

Found the bug, there was another line of code just checking whether GPIO was 6...11 and not using the function which takes into account detected embedded flash...

Will make a new build.

TD-er
Core team member
Posts: 9884
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Shelly Plus Plug S - GPIO 10 is missing

#14 Post by TD-er » 13 Nov 2024, 16:42


dsiggi
New user
Posts: 8
Joined: 12 Nov 2024, 21:31

Re: Shelly Plus Plug S - GPIO 10 is missing

#15 Post by dsiggi » 13 Nov 2024, 21:46

Tank you, now it's working.

I build now a custom firmware by my self with an edited plugin for the BL0937. This plugin can now also read the energy consumption.
I hope I will find some time next week so I can make a pull request for this changes.

TD-er
Core team member
Posts: 9884
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Shelly Plus Plug S - GPIO 10 is missing

#16 Post by TD-er » 13 Nov 2024, 21:49

Looking forward to the PR and glad it is now working :)

dsiggi
New user
Posts: 8
Joined: 12 Nov 2024, 21:31

Re: Shelly Plus Plug S - GPIO 10 is missing

#17 Post by dsiggi » 13 Nov 2024, 22:19

So,
if someone would also like to use the Shelly Plus Plug S with ESPEasy here some short insturctions.

At first flash tasmota as descriped here: https://github.com/tasmota/mgos32-to-tasmota32.
From tasmota you can now flash ESPEasy.

Add the BL0937 as device.

Code: Select all

Device: Energy (AC) - HLW8012/BL0937
GPIO -> SEL: GPIO-19
GPIO <- CF1: GPIO-22
GPIO <- CF: GPIO-10

Device: Custom

SEL Current (A) Reading: LOW
CF1 Interrupt Edge: CHANGE
CF Interrupt Edge: CHANGE

Current Multiplier: 161.8
Voltage Multiplier: 145204.00
Power Multiplier: 1499487.5
Add the Switch as device.

Code: Select all

Device: Switch input - Switch
Internal PullUp: true
Inversed Logic: true
GPIO: GPIO-9
Switch Type: Switch
Switch Button Type: Push Button Active Low
Add the Relay as device.

Code: Select all

Device: Switch Input - Switch
GPIO: GPIO-4
Add the LEDs as device.

Code: Select all

Device: Output - NeoPixel (Basic)
GPIO -> DIN: GPIO-25
Led Count: 2
Stri Type: GRB
Rule to switch the relay with the button.

Code: Select all

// name depends on your device
On Switch#State Do
  //name depends on your device
  If [Relay#State]=0
    GPIO,4,1
  Else
    GPIO,4,0
  Endif
EndOn

Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests