This is a ' Can you point me in the right direction' question.
Background to project :
I am building an Enigma machine ( Enigma machine - Wikipedia ) and have most of it worked out (plug boards, lightboards, keyboards, all the enigma encryption / decryption code). A key component of the device is the set of rotors. They each have 26 letters on them. The Enigma will use 3 or 4 rotors out of a choice of 11. Initially I plan to plug a (3D printed) item representing each of the rotors into electrically connected slots as part of the initialisation. Each 'rotor' will contain a different size resistor across the connection and that will determine the input to the ADC. I'm multiplexing the slot inputs into the ADC. When I have determined each ADC input, I map it to a specific rotorID stored in the code. At the moment the configuration of each rotor is stored against the rotorID in the code. That's all good for phase 1 but I would prefer to hold the rotor configuration in the rotor.
Question
Is there a way to store data in the 'rotor' device that could be activated / read when the 'rotor' is inserted? I want to avoid using WiFi if at all possible due to the nature of the project and the device.
I need to be able to access 26 unique identifiers, so it could be a string of characters, or an array of integers, etc.
My thoughts so far are : something akin to RFID, perhaps, or some form of non-volatile memory that I could program once, and then read as required? If so, how could it be made readable? Is there some sort of 'micro serial sender module' on the market ?
A possible solution
I have considered a D1 mini in each 'rotor' which would power up on insertion and connect the serial TX / RX pins in some form of connector. That could then send the configuration ( with quite a bit of error checking to ensure that we've sent and received a valid message). If I went down this road, would a USB-A connector be able to do what I wanted in combination with a D1 mini? If I did that though, I couldn't multiplex, so it would add its own complexities. Anyway.. any ideas welcome.
Why exactly do you want to move the config data to the rotor ? Is it because by doing so it makes changing the data easier than editing the sketch or is there another reason ?
It's really to make it a more realistic representation of the original, where the configuration is in the rotor : its electromechanical but that is where it lives.
The coding i've done is completed based on holding the data in the sketch, and that is fairly straightforward. That's why I'm going to go with that for V1, but this is an enhancement for V2.
Changing the data in the sketch is pretty trivial, tbh, other than the possibility that accessing the board once the physical setup is completed might be tricky.
I need the device to send data once it has been 'woken up' - however that is done. I'm thinking it needs to be sent over serial so that I can use one wire through a multiplexer. In that way, I can pick up the data out of each of the four separately, using one 8266. If I need to use SPI, then I'm going to need a lot more pins.
I've just looked at a data sheet and then I was deafened by the sound of whooshing above my head. I'll see if I can find an example of one in use, and then come back.
So each 'rotor' wants to store some data (different data on each one). When I plug into the socket I want it wake up and transmit the data it holds. There will be some code that controls the multiplexer to look at all the potential TXs in sequence and when they appear, read the data. Once I have the data for either 3 or 4 rotors, we are done.
I was thinking of using USB A connectors which can provide power and a signal line for each 'rotor'.
The info remains in a centralized location for better management.
Heck the dB can be locally hosted and no need for internet access. A RaspberryPi could serve as DbHost. I have 13 ESP32's connecting to a RPi for various things from dB access to TensorFlow thingies.
Yeah, I could do that, and it would definitely work, but as I mentioned above its a constraint that I have imposed on myself that I dont want to use WiFi. I want it to be fully self contained (and wired, in the spirit of the original). I guess a locally hosted DB might be a halfway house, though.... mmm. Edit : but then its conceptually the same as putting the data in an array in my code.