How to revert to a standard ID number?

I can conceive of a preprogrammed Arduino (actually a DelTino) board being shipped with a standard ID (probably just the number 3) and also including code that allows it to accept a different number (from 4 to 250, say) which it can save in it's eeprom. The new number would be sent by wireless and there would be no physical connection between a PC and the board. From that moment onwards the board would respond to instructions to its new number and not to the number 3. It would also use the new number after every reset or power off-on.

What I can't figure out is how I could get the board to return to using the original number (3) if the new number is forgotten - only using the wireless connection and without re-uploading the sketch.

Has anyone any bright ideas?

...R

Could you have a serial number for the board as well as the ID. If the ID is forgotten then sending serial number plus some other magic numbers will reset device back to default ID.
Another idea would be a universal broadcast message that makes any node hearing it respond with it's ID. Not sure how you then work out what node is what if you have many in range.

Robin2:
how I could get the board to return to using the original number (3) if the new number is forgotten

What do you mean by 'forgotten'? You mean the client trying to connect wireless doesn't know the configured number, or the Arduino's storage of it's configured number gets lost?

If you mean the client doesn't know the configured number then you could define a protocol to let a specified device be reset. One such scheme is:

Each device is configured with a permanent ID and a comms address. The comms address defaults to the device ID. The comms protocol defines a 'broadcast' address and messages to the broadcast address will be received by all devices. The protocol provides a command to reset the comms address of a specified device back to its default value. I assume there is some system to identify a physical device and work out what it's ID is. If there isn't, you'd need to provide some other way to identify it, such as a switch which can be used to inform it that it is being reconfigured so that it would accept a broadcast message telling it it's new comms address.

By "forgotten" I mean that the the central (sun?) device has "lost" the number of a subsidiary (planet?) device. This might happen when the new number is being allocated if, for example, the Planet receives an incorrect code (for example 70 instead of 38 (a single bit error)) but the Sun doesn't know this and can no longer contact that particular Planet. Another situation might be where a user acquires a Planet that has already been used by someone else.

It would be "nice" if it was possible to get the errant Planet to reset itself to the standard ID purely by wireless.

It would be possible to have some mechanism to ground an I/O pin at startup to force it to reset - but that would be a lot less convenient for a user.

Maybe the simplest thing would be for the user to switch off all but the errant device and then the Sun could just work its way through all possible IDs until it makes contact.

...R

Robin2:
It would be "nice" if it was possible to get the errant Planet to reset itself to the standard ID purely by wireless.

You could achieve that with the approach I outlined.

Thanks Peter, but perhaps I am misunderstanding something...

What sort of system have you in mind "to identify a physical device and work out what it's ID is" because in my mind that could only be the ID - which has been forgotten?

...R

PeterH:
Each device is configured with a permanent ID and a comms address. The comms address defaults to the device ID. The comms protocol defines a 'broadcast' address and messages to the broadcast address will be received by all devices. The protocol provides a command to reset the comms address of a specified device back to its default value. I assume there is some system to identify a physical device and work out what it's ID is. If there isn't, you'd need to provide some other way to identify it, such as a switch which can be used to inform it that it is being reconfigured so that it would accept a broadcast message telling it it's new comms address.

What I mean is that when you program it with the default ID that default is stored permanently as the device ID and is also stored as the initial comms address. If you connect to it wirelessly and configure a different address that overwrites the previous comms address but does not overwrite the device ID. Subsequently you can use a broadcast specifying the device ID that you want to reset which will reset the comms address back to the default value - or some other address, if you prefer.

Thanks, I understand now. It would mean that the user would need to ensure all the other Planet devices were switched off as they would all have the same deviceID. But it would be simpler for the Sun device to send a command to a single ID than to scan through all possible IDs.

On the other hand it would also mean that you would need to switch off all other Planets when initially setting the ID for a new Planet.

It's the best idea so far ...

...R

Robin2:
It would mean that the user would need to ensure all the other Planet devices were switched off as they would all have the same deviceID.

I envisioned each device having a permanent and unique device ID which you know (or could find out e.g. by reading a label on the device).

I explained how you could modify the solution to supported devices with an unknown ID by using a physical input to indicate to the device that it should accept a reset command.

Thanks again Peter,

I understand what you have proposed. Things are very easy if the user can "do something" to the device or see it to read a number from it.

I have been wondering how to deal with the problem if neither of those is an option. (And I do realize there may not be any alternative).

...R

Robin2:
how to deal with the problem if neither of those is an option.

You need some way to designate which physical device you want to access. Only you can know what options are available - by having somebody read a label on the device with a unique identifier on it, or operate a switch on the device, or whatever other means you can come up with. Given any way to identify the device, it will be possible to come up with a way to access it.