We are testing the XDK at our Company. As we had connecting issues and trust issues on written code, we checked the codes build at first. This includes documentation of XDK-C, XDK-FreeRTOS, API-Documentation, Sensorprograms, Wifi-Connection-Codes, Manuals for Wifi-build up, Dev-Portal-Forum-threads.
As we didn't have any success with the company router, we checked the builds with a private one just by entering SSID and PW in the header-files. Private Wifi-Access worked fine using DHCP with and without callback. Also success with private wifi and static IP. So we took it back to the institute. We are not using enterprise WPA2, we are generating a keyphrase and using one SSID, some IoT-Network-blabla. Now sometimes we get an IP from router, sometimes we don't. (Using DHCP option 1 and 2 - with or without your callback). The Scan for networks is fine and connects. The IP from router is 0.0.0.0 most of the time and it cannot keep a stable connection even without callback.
Now the one time it worked this was the output: It can be the MQTT wasn't sending data so subscribing wouldn't give an output. Still. The XDK keeps reconnecting - killing the wifi connection from itself. This source code here shows the most successful and only time it got that far - jumping back to AppController Fire to tell me the MQTT-Credentials won't work which we checked again with Mosquitto.
INFO | XDK DEVICE 1: Ready INFO | XDK DEVICE 1: C INFO | XDK DEVICE 1: _ INFO | XDK DEVICE 1: XMODEM Download Success INFO | XDK DEVICE 1: CRC of application area INFO | Application checksum 'd34f' successfully verified. INFO | Transmission successfully completed! INFO | Booting application... INFO | XDK DEVICE 1: Jumping to application INFO | Port 'COM4' has been disconnected INFO | Connecting to XDK device 'XDK Device 1' in port 'COM4'... INFO | Connection to port 'COM4' established INFO | XDK DEVICE 1: This is a CC3100R device INFO | XDK DEVICE 1: CHIP 0x4000000 INFO | XDK DEVICE 1: MAC 126.96.36.199.2 INFO | XDK DEVICE 1: PHY 188.8.131.52 INFO | XDK DEVICE 1: NWP 184.108.40.206 INFO | XDK DEVICE 1: ROM 0x3333 INFO | XDK DEVICE 1: HOST 220.127.116.11 INFO | XDK DEVICE 1: Connected to WPA network successfully INFO | XDK DEVICE 1: IP address of device 192.168.227.83 INFO | XDK DEVICE 1: Mask 255.255.254.0 INFO | XDK DEVICE 1: Gateway 192.168.226.1 INFO | XDK DEVICE 1: DNS 18.104.22.168 INFO | XDK DEVICE 1: WLANPersonalWPA2Connect : Connected to WPA network successfully. INFO | XDK DEVICE 1: AppControllerFire : MQTT connection to the broker failed INFO | XDK DEVICE 1: Error in WLAN package. INFO | XDK DEVICE 1: Package ID: 10 INFO | XDK DEVICE 1: Module ID: 3 INFO | XDK DEVICE 1: Severity code: 2 INFO | XDK DEVICE 1: Error code: 1 INFO | XDK DEVICE 1: Router connection was lost. Resetting the device. Check if network is available. Node will do a soft reset now. ERROR | Exception occured: null at purejavacomm.PureJavaSerialPort$2.available(PureJavaSerialPort.java:721) at com.bosch.cds.xdk.io.serial.impl.DelegatingSerialEventListener.serialEventReceived(DelegatingSerialEventListener.java:27) at com.bosch.cds.xdk.io.serial.AbstractDelegatingSerialEventListener.serialEvent(AbstractDelegatingSerialEventListener.java:42) at purejavacomm.PureJavaSerialPort.sendDataEvents(PureJavaSerialPort.java:92) at purejavacomm.PureJavaSerialPort.access$28(PureJavaSerialPort.java:89) at purejavacomm.PureJavaSerialPort$3.run(PureJavaSerialPort.java:1241) at java.lang.Thread.run(Thread.java:748)
If you are able to connect XDK with your private network and get proper IP address all the time successfully, Then the problem is not with XDK.
The problem might be in Wifi network setup. Generally Companies will be having Enterprise wifi network setup.First please make sure whether your company is using enterprise wifi network setup or personal wifi network setup. If your company uses enterprise wifi network setup, then you must enable enterprise option and provide proper values for the below parameters in header file:
Let me know which template application are you using or else if possible can you share your code, so that I will check from my end.