Question: Getting the spectrometer to work with a Raspberry Pi?

anjohn12 is asking a question about spectrometry: Subscribe to answer questions on this topic

anjohn12 asked on April 14, 2016 18:48
1,148 | 1 answers | #12978


I am currently working on creating a program that will go to the spectral workbench page, login, take a spectrum reading, and export the data. I want this to run in the background and not open a web browser. I am running this program on a Raspberry PI 2 and am using python as my programming language.

I tried using the requests module to do this, but I ran into problems. Are there any good, easy to use modules that can be used for this, or are there any modules that the spectral workbench team would recommend for this? Thanks!



3 Comments

Hi! We just released a Node.js version of the core library here: https://github.com/publiclab/spectral-workbench.js

I think it'd be possible to take the image data and use the node-canvas module to extract data from an image headlessly; and there are node.js ways to capture from a webcam too. So you could try to run the whole thing offline using just Node.js.

I have an open issue for using node-canvas -- https://github.com/publiclab/spectral-workbench.js/issues/2

I don't know if you code any JavaScript but this seems like a good point to start from. Sounds interesting!


There's now been a lot of work on this via WebValley and @cristoforetti -- take a look at #webvalley posts, and we managed to get it working!


Also see this question on getting data off a Raspberry Pi via keyboard emulation: https://publiclab.org/questions/warren/04-29-2017/getting-a-raspberry-pi-to-output-data-by-emulating-a-keyboard


Log in to comment

1 Answers

@warren is there a chance to write a note about using a raspberry pi and post it as a build? I think others have had interest about this. Did we already do that and the fault is mine for not looking before I responded? lol. Forgive if so.


Yes, I think that's be great. I'm adding this as a "challenge" on the Spectrometry page, hope someone picks it up. Also see related: https://publiclab.org/notes/warren/09-28-2016/upgrade-a-diy-spectrometer-with-a-raspberry-pi-camera


We're also now collecting more info on this page: https://publiclab.org/w/raspberry-pi-spectrometer


Log in to comment

Sign up or Login to post an answer to this question.