If your going to have a physical button to enable it to be reconfigured you dont have many options.
An idea may be to write something to flash storage after the first time its been configured and not allow additional setup attempts unless that file is removed but if someone has physical access to the device there's nothing stopping them connecting over uart and removing it via repl.
Alternatively. A physical preventative might be more suitable (lock it in a box)
@jcaron as of right now what I want to achieve:
Using a SCD30 sensor (which gets humidity, temperature and CO2 levels) read the data and save it, for that I intend to create (or modify based on other libraries) the library for the sensor.
I already have the adress of the sensor and the hexadecimal "commands" and I am trying to use the libraries of the Pysense sensors as a template
@juan_peroza JSON is not a protocol, it’s just a data representation. You can send whatever you want, but JSON is not very space efficient, and is usually not the best choice for data sent over a (very) low bandwidth link such as LoRa, SigFox, NB-IoT, or BLE. It’s usually better to use an optimised binary format in those cases.