sensor monitor demo: wifi not working
응답
16. 7. 13 오전 7:08

Hello,

we tried to use the application demo sensor monitor. 

We are using a Windows 7 PC, a TP-LINK stock wifi router and the Bosch XDK. 

We also tried the SendDataViaUDP demo with the same setup and this is working fine (so the wifi setup works in principal).

However when we flash the sensor monitor demo, the XDK is not visible in the network at all. 

Is there something we are overlooking from the demo? Is there any specific flags that need to be set?

In principal the demo is working, because we were able to read values into the GUI over USB.

 

I also tried to set the DEBUG flag and the XDK_SERIAL_TRACE flag (I just put it in main.c), however the printfs from the system didn't came through to the console of the XDK-Workbench. I am pretty sure I am doing sth. wrong here. Any guidance would be appreciated.

 

Thanks,

Richard

0 (0 투표)
RE: sensor monitor demo: wifi not working
응답
16. 7. 13 오전 10:36 as a reply to Richard Linke.

Hello Richard,

in general you don't need to make change to any flags. What you can do to get all executed commands in the console is to expanse the log level to all executed commands. I attached a screenshot where you can find the needed configuration.

Additionally to this you can use printf debugging. But these commands are not threadsafe and printfs in the first 10 milliseconds of the systemstart are executed, but do not appear in the console. This is caused by the not established usb connection to your operating system.

Nevertheless you can use them, but you should implement them where the primal implementation for the wifi for example is defined. There you can check if the wifi connection is established.

Back to the topic, I tested the SensorMonitorDemo over USB and both wlan configurations. All configurations worked without issues. I guess it could be an issue with your SD card.

Have you format the SD card as recommended and made the correct configurations in config.txt ?

Kind regards,
Franjo

0 (0 투표)
RE: sensor monitor demo: wifi not working
응답
16. 7. 21 오전 10:11 as a reply to Franjo Stjepandic.

I have an update, and we got it to work ... kind of.

luckily we ordered 2 devices. With one device and unchanged source code everything works as expected and with the 2nd device (unfortunately the one we used for all our initial tests) the connection doesnt work.

I am unsure who to blame but seeing that the same code works fine on device 1 and fails to work on the device 2 seems to point at the XDK.

We have made the following test:

We set up our Wifi accesspoint to give both our XDK a fixed IP address identified by their MAC via DHCP.

 

Wifi - AP: 192.168.5.254

XDK1 (MAC: F4-B8-5E-3B-1B-37) --> IP address 192.168.5.150

XDK2 (MAC: F4-B8-5E-3E-80-9E) --> IP address 192.168.5.151

 

However checking the debug output from the USB interface (and checking wireshark) one of the two devices doesn't activate the correct ip address.

Instead it uses ip 192.168.2.111 and 192.168.2.1 as gateway.

So we have XDK1 and XDK2 with the same project downloaded onto each device.

XDK1: mounts the IP address being given via the DHCP AP

XDK2: mounts an arbritary IP address 

 

 INFO | XDK DEVICE 2:  Connected to WPA network successfully 

 INFO | XDK DEVICE 2:   Ip address of the device 192.168.2.111 

 

Is there some switch or internal setting for a XDK to not mount the DHCP address and instead use some static stock IP address settings?

Maybe there is some error in the code still but I find it hard to believe because we have the same code running on both XDK1 and XDK2.

0 (0 투표)
RE: sensor monitor demo: wifi not working
응답
16. 7. 21 오후 2:12 as a reply to Richard Linke.

Hello Richard,

DHCP in the default Wi-Fi configuration is ON. Additionally you can activate the DHCP mode with this code directly before connecting:

NCI_return_t retStatusSetIp;
retStatusSetIP = NCI_setIpDhcp(0);
if (retStatusSetIp == NCI_SUCCESS) {
 // Waiting for IP
} else {
       // Setting Ip over DHCP failed
}

If the XDK doesn’t get an IP address, the IP will be self assigned.

I really understand that is annoying that exactly the same code is working on one device only.
Anyway, there are a few possibilities what the cause may be.

- Just to make sure, please check if the MAC address that you registered in your router is exactly the same.
- Additionally, would you be so kind to add the code above in your application

Last, if the XDK doesn’t get the IP assigned via DHCP, it is a firmware problem that we need to analyse.
Therefore, I would suggest you to post your email address in here that I can contact you directly.

Kind regards,

Franjo

 

0 (0 투표)
RE: sensor monitor demo: wifi not working
응답
16. 7. 26 오전 8:10 as a reply to Franjo Stjepandic.

I tried adding the code fragment in the init function of the module.

However after flashing the binary file, the system never really comes online. Neither the connect nor the connect error path are executed (i.e. both printf's don't come through).

 

    connectSSID = (WLI_connectSSID_t) WLAN_CONNECT_WPA_SSID;
    connectPassPhrase = (WLI_connectPassPhrase_t) WLAN_CONNECT_WPA_PASS;

    if (WLI_SUCCESS == WLI_connectWPA(connectSSID, connectPassPhrase, NULL))
    {
        NCI_getIpSettings(&myIpSettings);
        *IpaddressHex = Basics_htonl(myIpSettings.ipV4);
        (void) Ip_convertAddrToString(IpaddressHex, (char *) &ipAddress);
        printf("Connected to WPA network successfully \r\n ");
        printf("Connected to %s \r\n ", WLAN_CONNECT_WPA_SSID);
        printf(" Ip address of the device %s \r\n ", ipAddress);
    }
    else
    {
        printf("Error occurred connecting %s \r\n ", WLAN_CONNECT_WPA_SSID);
        return;
    }

 

my mail address is richard.linke@boschrexroth.de

0 (0 투표)
RE: sensor monitor demo: wifi not working
응답
16. 7. 27 오전 11:27 as a reply to Richard Linke.

Hello Richard,

thanks for your reply. If the XDK can’t establish a connection to the Wi-Fi network, if will try to connect forever. There is a thread that might be interesting for you. See here.

I will contact you, to analyse the project and find out, if it is working in general.

Kind regards,
Franjo

0 (0 투표)