Moving a device from one product to another

Anyone have any tips/tricks of moving a device from one product to another and in particular from a “growth” plan back into a “sandbox”. I currently have 2 products one in growth and one in sandbox. I have a need to transition a handful of devices back from the growth plan back to the sandbox product.

As called out in the docs, the firmware within the device does have:
PRODUCT_ID(PLATFORM_ID);

My current steps are:

  1. Under the original product I would copy the device id of the device I’d like to move to the sandbox.

  2. I’d then click “remove device”
    image

  3. Within the sandbox product where I want to move it to, I’d then click add device, copy paste the device ID in and then the device would properly show up under sandbox.
    image

This seems to work just fine for anywhere between 5-30 minutes. Then sometime within that timeframe, the device would just magically show back up under the original product and not under the product I intended on moving it to.

Any thoughts on what would cause this or is there a different sequence of steps to make this work properly? I noticed this in the past when shuffling devices between sandbox and growth and generally speaking after trying 1-2 more times it finally stuck. In this particular instance, it worked for about 20-30 devices I needed to shuffle around but for some reason the last 4 keep reverting back. I think I’ve done the steps above at least 5-7 times.

Alright after spending the last several days hammering it with removing from one product and adding to the other, after about another 10-25 attempts, it seems the remaining 4 devices finally “stuck” and stayed with the sandbox product. One of the devices was particularly stubborn.

Does the Particle Cloud have some sort of cache that needed to be cleared or something that would of caused this. I think my issue is resolved for now but I intend on moving devices back and forth 1-2 times a year and would rather not have to attempt the move 10-20 times.

1 Like

The product should not be cached anywhere and should not go back to the old one, aside from one special situation.

The only time I can think of where a device goes back to the old product is if you explicitly set the PRODUCT_ID in the firmware:

PRODUCT_ID(1234);

and you changed the product while the device was asleep or offline. When the device comes back online, it will still have the old product ID from the old firmware, and will attempt to use it.

If the old product is set to auto-approve new Device IDs, the device will get added back to the old product automatically, overriding the change you made. The solution is to make sure the firmware is updated first, or turn off auto-approve.

If you have the wildcard product ID set

PRODUCT_ID(PLATFORM_ID);

then I’m not sure why that is happening.

Yeah that would make sense. I do have the product ID generic in the firmware like this:

Since ultimately after many many attempts it finally accepts the new product without changing firmware I don’t think this is the case. However, now that you mention it, the most stubborn devices seemed to be all the ones that were “online” at the time so being online vs offline seems to play a part.

I think next time I’ll open a support ticket vs just pounding on it until it moves. If someone from Particle is interested in looking retrospective at log files from the Particle Cloud side, I am happy to share the Device ID for the most stubborn device out of the bunch. You’ll see many many attempts (I’m guessing at least 20-25 over several days) at removing a device and adding the device to a product and somehow it getting added back to the original. Maybe there is a bread crumb trail someone in the logs.

I thought of one other thing to beware of: I believe that the product change only takes effect when the device reconnects to the cloud. Normally when you switch products the device will get a firmware update, which will cause a reconnection. However, if both products have the same firmware version number, it won’t get a firmware update as it doesn’t check the product ID or the app-hash, only the version (integer). This can have unintended consequences, though i don’t think it should behave exactly as you’ve described either.