LoRa Node pHat for Pi - question about join-otaa

You say it easy, i mean the last part.
“Decide how many bits (or more crudely, bytes) are needed to encode the range of each value and concatenate them into a binary buffer, probably with struct.pack()”

That device project is going to be on an edge topology with a battery. By the way, before that i was playing with a Rak5205 join was not on the table the device operated unattended. Thing is i make this Pi from scratch.

Not complete illiterate on how i perceive Lorawan, but dont know everything either. So i ask for the guidance on the correct spot.
By the way, whats the correct sending sequence in lora once you joined using the pHat?

How are you going to make a pi-based system work on battery?