Webcamera does not work

Hi, I am testing the example code Webcamera. I have import the Webcamera to mbed Compiler, and changed the IP address to mine, but I cannot open web browser "192.168.x.x/web_top.htm". Do you know which step I might did wrong? Thanks in advance.

  • Hi,
    Don't you use DHCP ? Fixed IP ?
    Could you attach a display of serial monitor?
  • In reply to Okamiya Yuuki:

    Thanks for reply. I have fixed the IP address to mine, and tried to set "#define USE_DHCP  (0)" and " define USE_DHCP (1)" respectively. After compile the code, when I press reset button, the teraterm shows program start. But when I using web brower, it shows unable to connect.


  • In reply to Harmony:

    Hi Harmony,

    I cannot see IP address on your serial monitor. So it may not finish connecting a network.
    The examples should have codes like below. Could you tell me your code ?

    if (network.connect() != 0) {
    return;
    }
    Serial.print("MAC Address is ");
    Serial.println(network.get_mac_address());
    Serial.print("IP Address is ");
    Serial.println(network.get_ip_address());
    Serial.print("NetMask is ");
    Serial.println(network.get_netmask());
    Serial.print("Gateway Address is ");
    Serial.println(network.get_gateway());
    Serial.println("Network Setup OK\r\n");
  • In reply to Okamiya Yuuki:

    Hi Okamiya,

    Thanks for reply. I have similar code from example, they are:

    if (network.connect() != 0) {

           printf("Network Connect Error \r\n");

           return -1;

       }

       printf("MAC Address is %s\r\n", network.get_mac_address());

       printf("IP Address is %s\r\n", network.get_ip_address());

       printf("NetMask is %s\r\n", network.get_netmask());

       printf("Gateway Address is %s\r\n", network.get_gateway());

       printf("Network Setup OK\r\n");

    I have download a program called " Advanced IP scanner", but it cannot find out the IP address for GR Peach. I used command to check IP address.

      

    Below is the only code I have modified from the example code (I have tried used wireless IP address and Ethernet IP address,but non of them work):

    /**** User Selection *********/
    /** Network setting **/
    #define USE_DHCP (1) /* Select 0(static configuration) or 1(use DHCP) */
    #if (USE_DHCP == 0)
    #define IP_ADDRESS ("192.168.20.5") /* IP address */
    #define SUBNET_MASK ("255.255.255.0") /* Subnet mask */
    #define DEFAULT_GATEWAY ("192.168.20.1") /* Default gateway */
    #endif
    #define NETWORK_TYPE (0) /* Select 0(EthernetInterface) or 1(GR_PEACH_WlanBP3595) */

    Thanks for your help!

  • In reply to Harmony:

    If you use Fixed IP address, USE_DHCP should be set to (0).
    Since you have set the IP address of GR-PEACH to "192.168.20.5" and set the Subnet mask to "255.255.255.0", you need to set the IP address of the PC to "192.168.20.xx". (However, "192.168.20.5" is excluded)


     Setting of fixed IP address
    developer.mbed.org/.../Homepage

  • In reply to dkato:

     I have set the IP address to  "192.168.20.1", which is also default gateway address. But still, I cannot connect to web browser and the serial monitor shows network connect error. Here are some screen shots about my setting.

     

  • In reply to Harmony:

    In the first photo, the IP address of Ethernet is "169.254.97.7", but is this the picture before changing the Ethernet setting?

    Firstly press the OK button on the screen.
    developer.mbed.org/.../change_ip_eng_5.png

    Next you need to press the OK button on this screen as well.
    developer.mbed.org/.../change_ip_eng_4.png

    Are you connecting the PC and GR-PEACH directly with a LAN cable?
    If you use Fixed IP address, please connect directly with the LAN cable.

    "USE_DHCP" should be set to (0).
    #define USE_DHCP (0)
  • In reply to dkato:

    Thank you very much. I have fixed the settings, and blocked this sentence  //printf("MAC Address is %s\r\n", network.get_mac_address()); After these steps, Tera Term shows Network Setup OK, but I still cannot open web browser.

           

  • In reply to Harmony:

    It seems that the IP address of your PC and the IP address of GR-PEACH are set to be the same.
    You are directly connecting the PC and GR-PEACH with a LAN cable, right?
    How about setting the IP address of GR-PEACH to "169.254.97.8"?

    #define IP_ADDRESS ("169.254.97.8") /* IP address */
  • In reply to Harmony:

    Harmony,

    Have you resolved your issue?

    Mike Clements
    RenesasRulz Moderator