Announcement

Collapse
No announcement yet.

using HttpGetClientIpAddress possibly bricked my device

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • using HttpGetClientIpAddress possibly bricked my device

    Hello,

    I was busy adding some more functionality to a working project.

    The setup:
    I have a html page in the Xport pro that enables you to do some controls of our device (on, off, change parameters). I would like to obtain the ip adress of the computer doing those changes and save it in the syslog.

    I thought it would be possible obtaining the IP address using HttpGetClientIpAddress and so it did. At least at first,cause suddenly all http (and ftp) requests fail. As a result I cannot flash the device over the network and can't open my html pages stored in the device.

    I am able to ping my device and sometimes briefly can load the lantronix page or my html pages but at a refresh they are gone again (the xport doesn't reboot as the green led stays on all the time and i have a syslog message comming out).
    I've tried flashing (using serial restore) to standard and example program hello world. It prints out but the webpages does not work

    Below you can find the code snippets that i've added to the project.

    Kind Regards
    Rob

    Code:
    #include "evolution_stdio.h"
    #include "evolution_stdlib.h"
    #include "evolution_serial.h"
    #include "evolution.h"
    #include "evolution_cli.h"
    #include "evolution_http.h"
    #include "evolution_libs.h"
    #include "evolution_tlog.h"
    #include "startup.h"
    #include "evolution_libs.h"
    #include "crc.h"
    #include "motstruct.h"
    #include "math.h"
    #include "evolution_net.h"
    
    ...
    
    /*
     * Logging functions
     */
    static void log_IP_client(unsigned char ip[],char *cmd)
    {
    	snprintf(buffer, sizeof(buffer), "Time: %d:%d:%d %d/%d/%d IP: %d.%d.%d.%d command: %s",BOXGET.Current.hour, BOXGET.Current.min, BOXGET.Current.sec,BOXGET.Current.day,BOXGET.Current.month,BOXGET.Current.year,ip[0],ip[1],ip[2],ip[3],cmd);
    	SYSLOG(TLOG_FACILITY_LOCAL0,TLOG_SEVERITY_WARNING,buffer);
    }
    
    ...
    
    /*
    * The function my javascript communicates with
    */
    static bool dynamicWebMgrCallback(struct http_client *httpClient)
    {
    
    ...
        Iid resolve;
        HttpGetClientIpAddress(httpClient,&resolve);
    
    ...
    
    else if (strcmp(command, "setup") == 0)
        	    {
        		log_IP_client(&resolve.c[0],"Setup");
                 ....
                 }
    Last edited by Rob.Stoffels; 12-16-2011, 11:19 AM.

  • #2
    I've been able to debrick the devices by removing them from our PCB to the PCB from the EK and flashing them (also flash memmory). Strangely enouh now i am also able again to flash them on our PCB...

    Furthermore the program now works without any problems.
    I assume i've made some small error in the code but I wouldn't know where...

    Comment

    Working...
    X