We present an experimental scheme performing scalar magnetometry based on the fitting of Rb D 2 line spectra recorded by derivative selective reflection spectroscopy from an optical nanometric-thick cell. To demonstrate its efficiency, the magnetometer is used to measure the inhomogeneous magnetic field produced by a permanent neodimuim-iron-boron alloy ring magnet at different distances. The computational tasks are realized by relatively cheap electronic components: an Arduino Due board for the external control of the laser and acquisition of spectra, and a Raspberry Pi computer for the fitting. The coefficient of variation of the measurements remains under 5% in the magnetic field range of 40 -200 mT, limited only by the size of the oven and translation stage used in our experiment. The proposed scheme is expected to operate with a high measurement precision also for stronger magnetic fields (> 500 mT), in the hyperfine Paschen-Back regime, where the evolution of the atomic transitions can be calculated with a high accuracy.