Hi,
I refer to your schematic from post#3.
Let´s calculate with 9mA LED current.
Change R1 value to 100 Ohms and move it to the emitter path.
On 9mA there is a voltage drop of 9mA x 100 Ohms 900mV across R1.
So the LED current path is:
3.3V ..24V Supply -> LED -> BJT -> R1 -> GND (All is 9mA by ignoring the base current)
If supplied by 3.3V, we have the follwing voltages: 900mV across R1, 1.2V across LED, remaining 1.2V across CE. This should be enough for regulation.
Base voltage (wrt GND) is 900mV + 550mV V_BE = 1.45V
Now we need a voltage divider from V2= 3.3V -> 1.45V -> GND.
The voltage across R3 should be 1.45V and the voltage across R2 should be 3.3V - 1.45V = 1.85V
If we allow a current of 1mA, then resistance in kOhm is the same as the voltage. Thus R3 = 1.45k Ohm, R2 = 1.85 kOhm
Done.
For sure the current will drift with temperature, with V1 voltage and with V2 voltage. But I expect it to be within your 6mA ..12mA range.
Klaus