how to add auto add device setup wizard

hirdeshsaxena112
Posts: 18
Joined: Fri Jun 16, 2017 1:48 am

how to add auto add device setup wizard

Post by hirdeshsaxena112 » Fri Feb 16, 2018 7:26 pm

hi i have uploaded the firmware but when i use this new feature that add io device from app it says this is not compatible something can u let me know how to achieve this

User avatar
fracz
Posts: 1531
Joined: Fri Oct 28, 2016 10:56 pm
Location: Rybna

Re: how to add auto add device setup wizard

Post by fracz » Fri Feb 16, 2018 11:34 pm

You need to have firmware 2.5+ in order to use the simplified devices registration.

hirdeshsaxena112
Posts: 18
Joined: Fri Jun 16, 2017 1:48 am

Re: how to add auto add device setup wizard

Post by hirdeshsaxena112 » Sun Feb 18, 2018 9:57 am

thankyou francz

dovico
Posts: 11
Joined: Wed Apr 04, 2018 5:33 am

Re: how to add auto add device setup wizard

Post by dovico » Thu Apr 12, 2018 7:26 am

fracz wrote:
Fri Feb 16, 2018 11:34 pm
You need to have firmware 2.5+ in order to use the simplified devices registration.
hi @fracz

i used firmware 2.6 build form supla-espressif IOT SDK

Image

and log

Code: Select all

ENTER CFG MODE
state: 5 -> 0 (0)
rm 0
pm close 7
del if0
usl
mode : softAP(b6:e6:2d:03:43:d7)
add if1
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
bcn 100

If i used firmware 2.53 of zybi, it ok

Image

do you know why?

User avatar
fracz
Posts: 1531
Joined: Fri Oct 28, 2016 10:56 pm
Location: Rybna

Re: how to add auto add device setup wizard

Post by fracz » Thu Apr 12, 2018 7:40 am

@pzygmunt?

User avatar
pzygmunt
Posts: 6448
Joined: Tue Jan 19, 2016 9:26 am
Location: Paczków
Contact:

Re: how to add auto add device setup wizard

Post by pzygmunt » Thu Apr 12, 2018 7:54 am

Which board?

dovico
Posts: 11
Joined: Wed Apr 04, 2018 5:33 am

Re: how to add auto add device setup wizard

Post by dovico » Thu Apr 12, 2018 9:28 am

pzygmunt wrote:
Thu Apr 12, 2018 7:54 am
Which board?
Board wifisocket

User avatar
pzygmunt
Posts: 6448
Joined: Tue Jan 19, 2016 9:26 am
Location: Paczków
Contact:

Re: how to add auto add device setup wizard

Post by pzygmunt » Thu Apr 12, 2018 9:34 am

Should work :/

dovico
Posts: 11
Joined: Wed Apr 04, 2018 5:33 am

Re: how to add auto add device setup wizard

Post by dovico » Thu Apr 12, 2018 9:48 am

wifisocket.c

Code: Select all

#define B_RELAY1_PORT      12
	#define B_RELAY2_PORT      13
	#define B_RELAY3_PORT      14


	#define B_CFG_PORT         0
	#define B_BTN2_PORT        4
	#define B_BTN3_PORT        5


void supla_esp_board_set_device_name(char *buffer, uint8 buffer_size) {
	ets_snprintf(buffer, buffer_size, "supla-Light switch");
}

void ICACHE_FLASH_ATTR supla_esp_board_gpio_init(void) {

		supla_input_cfg[0].type = INPUT_TYPE_BTN_MONOSTABLE;
		supla_input_cfg[0].gpio_id = B_CFG_PORT;
		supla_input_cfg[0].flags = INPUT_FLAG_PULLUP | INPUT_FLAG_CFG_BTN;
		supla_input_cfg[0].relay_gpio_id = B_RELAY1_PORT;
		supla_input_cfg[0].channel = 0;

		supla_input_cfg[1].type = INPUT_TYPE_BTN_MONOSTABLE;
		supla_input_cfg[1].gpio_id = B_BTN2_PORT;
		supla_input_cfg[1].flags = INPUT_FLAG_PULLUP;
		supla_input_cfg[1].relay_gpio_id = B_RELAY2_PORT;
		supla_input_cfg[1].channel = 1;

		supla_input_cfg[2].type = supla_esp_cfg.CfgButtonType == BTN_TYPE_BISTABLE ? INPUT_TYPE_BTN_BISTABLE : INPUT_TYPE_BTN_MONOSTABLE;
		supla_input_cfg[2].gpio_id = B_BTN3_PORT;
		supla_input_cfg[2].flags = INPUT_FLAG_PULLUP;
		supla_input_cfg[2].relay_gpio_id = B_RELAY3_PORT;
		supla_input_cfg[2].channel = 2;

	// ---------------------------------------
	// ---------------------------------------

		supla_relay_cfg[0].gpio_id = B_RELAY1_PORT;
		supla_relay_cfg[0].flags = RELAY_FLAG_RESTORE_FORCE;
		supla_relay_cfg[0].channel = 0;

		supla_relay_cfg[1].gpio_id = B_RELAY2_PORT;
		supla_relay_cfg[1].flags = RELAY_FLAG_RESTORE_FORCE;
		supla_relay_cfg[1].channel = 1;

		supla_relay_cfg[2].gpio_id = B_RELAY3_PORT;
		supla_relay_cfg[2].flags = RELAY_FLAG_RESTORE_FORCE;
		supla_relay_cfg[2].channel = 2;
}

void ICACHE_FLASH_ATTR supla_esp_board_set_channels(TDS_SuplaDeviceChannel_B *channels, unsigned char *channel_count) {
	
		*channel_count = 3;

		channels[0].Number = 0;
		channels[0].Type = SUPLA_CHANNELTYPE_RELAY;
		channels[0].FuncList = SUPLA_BIT_RELAYFUNC_POWERSWITCH \
								| SUPLA_BIT_RELAYFUNC_LIGHTSWITCH;
		channels[0].Default = SUPLA_CHANNELFNC_LIGHTSWITCH;
		channels[0].value[0] = supla_esp_gpio_relay_on(B_RELAY1_PORT);

		channels[1].Number = 1;
		channels[1].Type = channels[0].Type;
		channels[1].FuncList = channels[0].FuncList;
		channels[1].Default = channels[0].Default;
		channels[1].value[0] = supla_esp_gpio_relay_on(B_RELAY2_PORT);

		channels[2].Number = 2;
		channels[2].Type = channels[0].Type;
		channels[2].FuncList = channels[0].FuncList;
		channels[2].Default = channels[0].Default;
		channels[2].value[0] = supla_esp_gpio_relay_on(B_RELAY3_PORT);

}

void ICACHE_FLASH_ATTR supla_esp_board_send_channel_values_with_delay(void *srpc) {

	supla_esp_channel_value_changed(0, supla_esp_gpio_relay_on(B_RELAY1_PORT));
	supla_esp_channel_value_changed(1, supla_esp_gpio_relay_on(B_RELAY2_PORT));
	supla_esp_channel_value_changed(2, supla_esp_gpio_relay_on(B_RELAY3_PORT));

}
wifisocket.h

Code: Select all

#ifndef WIFISOCKET_H_
#define WIFISOCKET_H_

#define CFGBTN_TYPE_SELECTION

	#define LED_RED_PORT    15

void ICACHE_FLASH_ATTR supla_esp_board_send_channel_values_with_delay(void *srpc);

#endif

User avatar
pzygmunt
Posts: 6448
Joined: Tue Jan 19, 2016 9:26 am
Location: Paczków
Contact:

Re: how to add auto add device setup wizard

Post by pzygmunt » Thu Apr 12, 2018 9:57 am

Open list of the wifi networks and check that your device is visible. The name of the network should match the rules that you can find in this function:

https://github.com/SUPLA/supla-android/ ... .java#L820

Post Reply