Controlling a Device with more than two states

Allendrome_
Posts: 14
Joined: Tue Jan 12, 2021 1:22 pm

Post

klew wrote: Wed Jun 19, 2024 2:39 pm Missing symbol is Supla::Html::DisableUserInterfaceCfgTag
It should be in some header file in src/supła/network/html.
Try to look for it there and add include
I've added "#include <supla/network/html/disable_user_interface_parameter.h>" to my sketch and verified that "Supla::Html::DisableUserInterfaceCfgTag" is returning the string defined there, but it's still giving me the same error.

As far as I can tell, the "cannot call member function 'virtual bool Supla::Config::setUInt8(const char*, uint8_t)' without object" error message is telling me that I can't call the setUInt8() function without create a "Supla::Config" object, so I tried:

Code: Select all

Supla::Config* a;
a->setUInt8(Supla::Html::DisableUserInterfaceCfgTag, 1);
a->saveWithDelay(1000);
It compiled like that, but threw an exception to the console when it tried to set up:

Code: Select all


load 0x4010f000, len 3424, room 16 
tail 0
chksum 0x2e
load 0x3fff20b8, len 40, room 8 
tail 0
chksum 0x2b
csum 0x2b
v00085100
~ld
����n�{��o|�l�d`c��<{�$�'��n�$`��s�l�$��Supla - starting initialization
Main storage not configured
LittleFsConfig: config file size 438
LittleFsConfig: initializing storage from file...
LittleFsConfig: init result 1
Security level: 0
RemoteDeviceConfig: Registering field 0x00000001
RGBWBase[0] button control type: 0
RGBW: 0,255,0,0,0
GUID: 1FF2E666E3FC4E0A370E3CF4B7A6678
Device name: SUPLA-ESP8266
Device software version: SDK 24.06-dev
Initializing network layer
[Wi-Fi] Network AP/hostname: SUPLA-ESP8266-2CF4323CD732
Using Supla protocol version 23
Current status: [5] SuplaDevice initialized
Enter normal mode

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

Exception (0):
epc1=0x4020617c epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

>>>stack>>>

ctx: cont
sp: 3ffffe60 end: 3fffffd0 offset: 0150
3fffffb0:  feefeffe feefeffe 3fff1f34 4021ee20  
3fffffc0:  feefeffe feefeffe 3fffdab0 40100ea1  
<<<stack<<<

--------------- CUT HERE FOR EXCEPTION DECODER --------------
Was the pointer 'cfg' there in your example because that's how it was set up somewhere else, or should there be a 'cfg' pointer established by the supla libraries?

Thanks!
User avatar
klew
Posts: 9728
Joined: Thu Jun 27, 2019 12:16 pm
Location: Wrocław

Post

Allendrome_ wrote: Wed Jun 19, 2024 8:32 pm
Just:

Code: Select all

  auto cfg = Supla::Storage::ConfigInstance();
  cfg->.....
Kiedy będzie Supla Offline Party / SOP#2025 ?
Allendrome_
Posts: 14
Joined: Tue Jan 12, 2021 1:22 pm

Post

klew wrote: Wed Jun 19, 2024 8:43 pm
Allendrome_ wrote: Wed Jun 19, 2024 8:32 pm
Just:

Code: Select all

  auto cfg = Supla::Storage::ConfigInstance();
  cfg->.....
Yup, that seems to be working, thanks!

I've uploaded the new code and tried power cycling a few times - as I understand the default parameters, it should trigger cfg mode when the device had been restarted 3 times with a less than 5 second one time each time? I've tried this and tried restarting a few more times, but it boots into normal mode every time. Is there something else I need to set up?
User avatar
klew
Posts: 9728
Joined: Thu Jun 27, 2019 12:16 pm
Location: Wrocław

Post

Allendrome_ wrote: Thu Jun 20, 2024 10:19 am
klew wrote: Wed Jun 19, 2024 8:43 pm
Allendrome_ wrote: Wed Jun 19, 2024 8:32 pm
Just:

Code: Select all

  auto cfg = Supla::Storage::ConfigInstance();
  cfg->.....
Yup, that seems to be working, thanks!

I've uploaded the new code and tried power cycling a few times - as I understand the default parameters, it should trigger cfg mode when the device had been restarted 3 times with a less than 5 second one time each time? I've tried this and tried restarting a few more times, but it boots into normal mode every time. Is there something else I need to set up?
When 3 is configured, then it should enter cfg mode on 4th boot.
App should have time to start, so don't reset it to fast.
Please share logs
Kiedy będzie Supla Offline Party / SOP#2025 ?
Allendrome_
Posts: 14
Joined: Tue Jan 12, 2021 1:22 pm

Post

klew wrote: Thu Jun 20, 2024 10:33 am When 3 is configured, then it should enter cfg mode on 4th boot.
App should have time to start, so don't reset it to fast.
Please share logs
I've tried leaving different amounts of time between resets, but nothing seems to be triggering so far. From looking through the library there seems to be some functionality to output the current power cycle to the monitor, but only in test mode, which I'm not sure how to boot into!

Code: Select all

12:13:41.923 -> Device name: SUPLA-ESP8266
12:13:41.923 -> Device software version: SDK 24.06-dev
12:13:41.923 -> Initializing network layer
12:13:41.923 -> [Wi-Fi] Network AP/hostname: SUPLA-ESP8266-2CF4323CD700
12:13:41.923 -> Using Supla protocol version 23
12:13:41.923 -> Current status: [5] SuplaDevice initialized
12:13:41.923 -> Enter normal mode
12:13:41.923 -> WiFi: establishing connection with SSID: "EE-TXC2RR"
12:13:42.225 -> Channel(0) value changed to RGB(0, 255, 0), colBr(0), bright(0)
12:13:49.176 -> Supla - starting initialization
12:13:49.328 -> Main storage not configured
12:13:49.328 -> LittleFsConfig: config file size 457
12:13:49.328 -> LittleFsConfig: initializing storage from file...
12:13:49.328 -> LittleFsConfig: init result 1
12:13:49.328 -> Security level: 0
12:13:49.328 -> RemoteDeviceConfig: Registering field 0x00000001
12:13:49.328 -> RGBWBase[0] button control type: 0
12:13:49.328 -> RGBW: 0,255,0,0,0
12:13:49.328 -> GUID: 1FF2E666E3FC4E0A370E3CF4B7A6C657
12:13:49.328 -> Device name: SUPLA-ESP8266
12:13:49.328 -> Device software version: SDK 24.06-dev
12:13:49.328 -> Initializing network layer
12:13:49.328 -> [Wi-Fi] Network AP/hostname: SUPLA-ESP8266-2CF4323CD700
12:13:49.350 -> Using Supla protocol version 23
12:13:49.350 -> Current status: [5] SuplaDevice initialized
12:13:49.350 -> Enter normal mode
12:13:49.350 -> WiFi: establishing connection with SSID: "EE-TXC2RR"
12:13:49.718 -> Channel(0) value changed to RGB(0, 255, 0), colBr(0), bright(0)
12:13:55.140 -> Supla - starting initialization
12:13:55.275 -> Main storage not configured
12:13:55.275 -> LittleFsConfig: config file size 457
12:13:55.275 -> LittleFsConfig: initializing storage from file...
12:13:55.275 -> LittleFsConfig: init result 1
12:13:55.275 -> Security level: 0
12:13:55.275 -> RemoteDeviceConfig: Registering field 0x00000001
12:13:55.275 -> RGBWBase[0] button control type: 0
12:13:55.308 -> RGBW: 0,255,0,0,0
12:13:55.308 -> GUID: 1FF2E666E3FC4E0A370E3CF4B7A6C657
12:13:55.308 -> Device name: SUPLA-ESP8266
12:13:55.308 -> Device software version: SDK 24.06-dev
12:13:55.308 -> Initializing network layer
12:13:55.308 -> [Wi-Fi] Network AP/hostname: SUPLA-ESP8266-2CF4323CD700
12:13:55.308 -> Using Supla protocol version 23
12:13:55.308 -> Current status: [5] SuplaDevice initialized
12:13:55.308 -> Enter normal mode
12:13:55.308 -> WiFi: establishing connection with SSID: "EE-TXC2RR"
12:13:55.674 -> Channel(0) value changed to RGB(0, 255, 0), colBr(0), bright(0)
12:13:59.141 ->Supla - starting initializatio
User avatar
klew
Posts: 9728
Joined: Thu Jun 27, 2019 12:16 pm
Location: Wrocław

Post

Allendrome_ wrote: Thu Jun 20, 2024 11:28 am I've tried leaving different amounts of time between resets, but nothing seems to be triggering so far. From looking through the library there seems to be some functionality to output the current power cycle to the monitor, but only in test mode, which I'm not sure how to boot into!
There are no logs from this EnterCfgModeAfterPowerCycle class, so I guess, that you haven't add it?

Code: Select all

new Supla::Device::EnterCfgModeAfterPowerCycle;
Add proper include as well
Kiedy będzie Supla Offline Party / SOP#2025 ?
Allendrome_
Posts: 14
Joined: Tue Jan 12, 2021 1:22 pm

Post

klew wrote: Thu Jun 20, 2024 11:37 am There are no logs from this EnterCfgModeAfterPowerCycle class, so I guess, that you haven't add it?

Code: Select all

new Supla::Device::EnterCfgModeAfterPowerCycle;
Add proper include as well

That's done it, it's working great now, and seems to boot back into normal mode after cfg mode has been set if you power cycle again after the timeout, which is exactly what I was hoping for :)

That's everything I was hoping to set up, thanks so much for all your help!

Return to “General discussion”