- Fri Dec 12, 2014 5:24 am
#4649
Oh !
At last I am able to make it. Thanks a lot Bananis.
I am using your Makefile and the the generated user1.bin, user2.bin.
I am not running the script (gen_misc_plus.sh)
You will surprise to know the main issue which was inside "C:\inetpub\wwwroot\v1\device\rom". As per convention, the shortcut of original should work. But it did not. It was practically not downloading any code in user1 or user2 space, hence, the device was in different state.
Now, when I placed the actual bin files (not shortcut or link in WIndows-7) inside "C:\inetpub\wwwroot\v1\device\rom". It started working.
Some other interesting issue I have observed:
1. User1.bin and user2.bin seems identical but may not. After renaming one file to others, the update process works sometime, sometimes hang. So, better, not to use till it is not clear.
2. In some situation or LAN (specifically in my home, where I have a global IP and WLAN) it hangs after "+CIPUPDATE :4", but in office place when I am in intranet (with lot of proxy, VPN, routers are there) it works fine. So, some work needed to tune it.
3. The default.aspx script to be converted to simple form for that necessary "request" or "query" can be modified which are sent from at_upDate_recv() and at_upDate_connect_cb() function.
However, I have customized the AT command at some level for update and pasting here which may be tested. As of now, it is ok to work with. Now it will support to specify the local IP from console as [AT+CIUPDATEC="10.226.43.154"]. To do so, user may follow the below code inside:
Code: Select all//Below is the custom function BY CM
void ICACHE_FLASH_ATTR
at_setupCmdCiupdate_CUSTOM(uint8_t id,char *pPara)
{
char temp[64];
char ipTemp[64];
char field[4];
char len;
uint32 _ip;
pespconn = (struct espconn *)os_zalloc(sizeof(struct espconn));
pespconn->type = ESPCONN_TCP;
pespconn->state = ESPCONN_NONE;
pespconn->proto.tcp = (esp_tcp *)os_zalloc(sizeof(esp_tcp));
pespconn->proto.tcp->local_port = espconn_port();
pespconn->proto.tcp->remote_port = 80;
// UPDATE_CUSTOM=TRUE;
specialAtState = FALSE;
pPara++;
len = at_dataStrCpy(ipTemp, pPara, 20);
_ip = ipaddr_addr(ipTemp);
os_memcpy(&field, &_ip, 4);
//os_sprintf(temp,"%d,%d,%d,%d\r\n",field[0],field[1],field[2],field[3]);
// uart0_sendStr(temp);
if(host_ip.addr == 0 )
{
//os_memcpy(&pespconn->proto.tcp->remote_ip, &_ip, 4);
*((uint8 *) &pespconn->proto.tcp->remote_ip) = field[0];//192; //Host IP = 192.168.0.178
*((uint8 *) &pespconn->proto.tcp->remote_ip + 1) = field[1];//168;
*((uint8 *) &pespconn->proto.tcp->remote_ip + 2) = field[2];//0;
*((uint8 *) &pespconn->proto.tcp->remote_ip + 3) = field[3];//178;
espconn_regist_connectcb(pespconn, at_upDate_connect_cb);
espconn_regist_reconcb(pespconn, at_upDate_recon_cb);
espconn_connect(pespconn);
}
}
To use it, users have two options:
1. Users can use the function as custom AT command. They may place the code inside at_ipCmd.c, they need to update the at_cmd.h by adding [{"+CIUPDATEC", 10, NULL, NULL, at_setupCmdCiupdate_CUSTOM,NULL }] and also the #define at_cmdNum 34 //32+2 to be changed as per at command numbers.
2. Users may modify the existing at_exeCmdCiupdate(uint8_t id) function to at_exeCmdCiupdate(uint8_t id, char *pPara ).
I am adding sample user1.bin and user2.bin which can be flashed at 0x01000, 0x41000 respectively and following custom functions are added.
1. AT+CIUPDATEC="AA.BB.CC.DD" where AA.BB.CC.DD are the ip address of server (local or global)
2. AT+CWJAP="SSID","PASS" The function has been updated. If the same SSID is asked to connect, it will reply as "Already Connected"
3. AT+THINGSPEAK="Command string" Special function to transfer data to Thingspeak. Just send [GET /update?key=[THINGSPEAK_KEY]&field1=0] as "Command string".
Thanks.
You do not have the required permissions to view the files attached to this post.