The speckle pattern arising from a thin random, disordered scatterer may be used to detect the transversal mode of an incident beam. On the other hand, speckle patterns originating from meter-long multimode fibers can be used to detect different wavelengths. Combining these approaches, we develop a method that uses a thin random scattering medium to measure the wavelength of a near-infrared laser beam with picometer resolution. The method is based on the application of principal component analysis, which is used for pattern recognition and is applied here to the case of speckle pattern categorization.