Discuss here different C compiler set ups, and compiling executables for the ESP8266

User avatar
By Bananis
#4535 Hi,

You're getting close now.

The makefile generates user1.bin and user2.bin directly in the /firmware directory, so no need for gen_misc_plus any longer. The makefile should generate the user1 and user2 bin files, provided that the gen_flashbin.py tool from the SDK can be found by and run.

The reason for the many binaries stored under /firmware is that the makefile both makes binaries for non-cloud update version 00000.bin and 40000.bin and also the temp binaries needed by gen_flashbin.py to create user1.bin and user2.bin

/Bananis
User avatar
By chandan2002x
#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.
User avatar
By Bananis
#4735 Hi Chandan,

Great that you made it work.
I had similar issues as you had with hard links of user1.bin and user2.bin to the "C:\inetpub\wwwroot\v1\device\rom", so I changed to soft links and it has worked with no issues ever since. I guess it might be someting with the Win7 security settings, as admin rights are needed for the inetpub (at least on my machine).

I tried your user1/user2 files and your AT+CIUPDATEC worked perfectly on my set-up. Thanks for the code. Your Thingspeak command looks reallly intresting, so I will try it next.

/Bananis
User avatar
By alonewolfx2
#4736
Bananis wrote:Hi Chandan,

Great that you made it work.
I had similar issues as you had with hard links of user1.bin and user2.bin to the "C:\inetpub\wwwroot\v1\device\rom", so I changed to soft links and it has worked with no issues ever since. I guess it might be someting with the Win7 security settings, as admin rights are needed for the inetpub (at least on my machine).

I tried your user1/user2 files and your AT+CIUPDATEC worked perfectly on my set-up. Thanks for the code. Your Thingspeak command looks reallly intresting, so I will try it next.

/Bananis

can you share your working project on here. attachment or drive link?