This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Smart Config Behaviour

Other Parts Discussed in Thread: CC3100, CC3200

I have found a small but potentially confusing bug with SmartConfig, that will affect some customers.

The problem is that during the SmartConfig process, a user will not be notified that their device has been successfully added to the network. This only occurs, if they have previously added the device, then deleted the profile, and tried re-adding the device, but this time giving it a different name.

Steps to Reproduce Bug.

1. Add device to Network
    a. Using SimpleLink App, add a new device to a Wifi Network using SmartConfig
    b. Make sure you give the device a name, say Garden.
    c. You will be notified when the device has been successfully added to the Network.

2. Delete Wifi Profile
    a. Access the SimpleLink internal website network setup page
    b. Delete the profile of the network added in step 1 above, or select Remove All Profiles

3. Re-add device to Network
    a. Using SimpleLink App, add the same device to the same Wifi Network using SmartConfig
    b. However, this time give it a different name, say Bedroom
    c. The device will be added to the Network, however there will be no notification letting the user know this has occurred.
    d. Also, when looking at the devices on the Network, you will notice the device was added with the name Garden and not Bedroom (i.e. the name be set it to in step 1)

Notes:

If re-adding with the same name (Step 3, with Garden), then notification will occur. This issue is related to the stored device name and mDNS. As the SmartConfig process is waiting for a mDNS notification for Bedroom, but never receives one, as the device sends out the old/stored device name (i.e Garden) instead of the new device name (i.e. Bedroom)

I am using the iOS SimpleLink App, but I suspect this issue would also occur with the Android version. As this issue is related to not updating the device name, when re-adding a profile. Though testing would be needed to confirm.

Glenn.

 

  • That's interesting.  I wonder if the old name is never getting unregistered and perhaps (likely), since only one name can be registered, the new name registration fails.  I have actually worked a bit with adding and removing profiles and hit something similar, but I assumed it was because I needed to unregister the old mDNS service.  There is an unregister method and according to the docs, if you pass in a null for the name, it will unregister all.  Perhaps, that should always be called before a new registration.      

    However, don't you think this is strictly an issue in the host code?  Or are you operating with AutoSmartConfig on and using no code other than the integrated web page? 

  • I don't think this is due to mDNS, as mDNS is just using the Device Name that is currently stored, so it seems to be working as expected. I believe the issue is with the Device Name not being updated by the Smart Config process, if there is already a Device Name stored.

    This process never interacts with the host code, it is all done within the NWP.

    I don't think this is anything to do with mDNS unregistering either, as the Device Name has not been changed when viewing it from the web configuration page.

    Glenn.

  • Hi Glenn,

    Thanks for your input, we will look into it and get back to you.

    Regards,
    Alon

  • Hi Alon,

    Just some more information regarding this issue. 

    I recently updated to the latest service pack (1.0.0.1), by formatting the serial flash and then loading on the new service pack.

    This then required me to rejoin my devices to my Wi-Fi Network with SmartConfig. I tried doing this by using the same Device Name I had previously on the devices. This successfully added the Device to the network (without notifying Smart Config...), however any call (see code below) to retrieve the Device Name results in a hang.

    sl_NetAppGet (SL_NET_APP_DEVICE_CONFIG_ID, NETAPP_SET_GET_DEV_CONF_OPT_DEVICE_URN, (unsigned char *)strlen((const char *)deviceName), deviceName);

    I was only able to get around this problem by not calling the Device Name and then changing the Device Name via the internal web server configuration. But this caused other issues, see steps below.

    1. Named device LivingRoom during Smart Config process (this caused hang retrieving Device Name)

    2. Went to internal web server configuration and changed name to Kitchen

    3. The Device Name on the internal web server configuration clearly states Kitchen

    4. The Device Name when I retrieve with code is called KivingRoom

    You now effectively have 2 different Device Names, one that is returned from the code as above, and one that is return via the web configuration.

    EDIT: There are actually 3 different Device Names, as mDNS is sending out LivingRoom as well.

    Basically, there are issues related to Device Name and Smart Config that need to be investigated and resolved. This issues will not be apparent for most user cases, as when just adding a device to a network and leaving it as such there will be no issues. But when working/developing with the Device, you often need to format, change network, change Device Name etc. and these all seem to lead to issues.

    I was under the assumption that formatting the serial flash will result in any record of the Device Name being removed....or does it store this information in an EEPROM or other form of non-volatile memory on the CC3100?

    Glenn.

  • Some more information to assist others and help in tracking down the problem.

    With my malfunctioning multi-name device, I tried formatting it and then re-adding with SmartConfig with a different name. This then ended up with the device obtaining an IP address, but not sending out any mDNS packets, and the internal web server was also not available to access.

    I then decided to format again, this time I formatted using Secure selected, and then formatted again with Secure un-selected. I then install the service pack and tried adding it to the network again using SmartConfig. This times I was successful in adding it to the network with the name Kitchen and everything now seems to be working as expected. The device name with mDNS matches the device name shown on the internal website and also the device name retrieved programmatically.

    So not sure how formatting as secure and then unsecure could have resolved this issue, but that is what I did.

    Glenn.

  • From what I can tell, removing the profile on the web page doesn't disconnect the device from the network. So, the web page is still accessible. Furthermore, as far as I can tell, you can't successfully re-provision a device with SmartConfig unless the red light is on on the board, and removing the profile does not make the light go on. I always assumed the red light meant the device is not connected to the network; if it is off, it is connected to the network. Is that accurate? I always have to (1) remove the profile, (2) reset the board (red light goes on), and (3) run SmartConfig again. Are we supposed to be able to successfully re-provision the device, with or without a new device name, per the steps outlined by Glenn?
  • Hi Mark,

    Regarding the LEDs, their behaviour is determined by the code, hence you will not get the same result when connecting, it will depend on the application.

    The issue I reported above was for the CC3100 and not the CC3200 LaunchPad. I have not experienced this issue since, so am suspecting it may have been resolved permanently by following the suggestion in my previous post.

    Yes, you should be able to re-provision using Smart Config, and if you leave Device Name empty, it will use what ever is currently stored, if you enter a new name for Device Name, it will set it to this new name.

    Glenn.
  • Hi Glenn,

    Yes, I am using a CC3200 Launchpad with the default, out of box, setup. The Launchpad, out of the box, definitely does not allow re-provisioning with a different device name (or the same device name), unless the profile is removed and the board is reset. As I said previously, just removing the profile for the device, using the internal web page, does not remove the device from the network. It is still provisioned at this point. I can still reach the website after removing the profile. At that point, it is not responding to any Smart Config provisioning attempt, whether you give it a new device name or not. Presumably that's because it is already provisioned, so it isn't listening for mDNS broadcasts (?). That's just my assumption.

    However, at a minimum, I would expect that if I were to go in to the internal web page and change the name of the device there (and apply the change), that mDNS discovery (via WiFi Starter iOS app) would pick up that new device name. It doesn't. Even though the device name on the web page shows the new name, the old device name is still being broadcast and picked up in the iOS app.

    Any ideas on this? Am I misunderstanding on how Smart Config is supposed to work? Maybe I'm making too many assumptions on what the internal web page functions (e.g. remove profile and change device name) are supposed to do too. Either way, I'm confused!

    Thanks.
    -Mark
  • Mark Beaty said:
    As I said previously, just removing the profile for the device, using the internal web page, does not remove the device from the network. It is still provisioned at this point.

    I have removed a profile so as to re-provision many times, so not exactly sure what is happening here. Make sure you have the latest service pack installed, also try deleting profile by selecting Remove All Profiles, instead of deleting a single one, and see whether that resolves this issue.

    Mark Beaty said:
    At that point, it is not responding to any Smart Config provisioning attempt, whether you give it a new device name or not. Presumably that's because it is already provisioned, so it isn't listening for mDNS broadcasts (?). That's just my assumption.

    This is correct....if it is already connected to a network, as it has been provisioned, you will not be able to use Smart Config, as this can only be triggered when you are not connected to a network.

    Mark Beaty said:
    However, at a minimum, I would expect that if I were to go in to the internal web page and change the name of the device there (and apply the change), that mDNS discovery (via WiFi Starter iOS app) would pick up that new device name. It doesn't. Even though the device name on the web page shows the new name, the old device name is still being broadcast and picked up in the iOS app.

    For changing the device name, check out the setDeviceName() function in the SimpleLink Library I have created - 

    Glenn.

  • Mark,

    If the above does not assist, then I suggest you create a new post, as your issue seems unrelated to the original post which I have not experienced since, nor have others reported.

    Glenn.
  • Thanks, Glenn. I have used Remove All Profiles. Same behavior. The device remains provisioned and connected to the network. I will see about installing the latest service pack, which appears to be 1.0.0.1.2. Is there a simple way to determine what service pack is currently installed?

    -Mark