A set of tools that helps to automate measure/control processes of any Scientific / Industrial Lab. Current solution is using for:
mossbauer spectrometer);e-mail, Telegram)This software is a laboratory specific and made as example if you would like to automate your laboratory / industry please contact us using email in our organization info.

Mossbauer laboratory automation tool controls spectra measurements from SM2201 Mossbauer spectrometer and watches state of other equipment.
SM2201 spectrometer controlled by software that is running on Windows 98Wissance.MossbauerLab.Watcher is running - Raspberry Pi (v2) + Raspbian as OSMessbauer spectra accumulation process (monitoring auto save process) from SM2201 spectrometer (controll by date+time)
of file last change (on Windows98 machine system clock must be set right)There are 2 run profiles (Development and Production) and 2 possible configs variants of Wissance.Mossabuer.LabWatcher:
SM2201 config section
looks like:
"Sm2201SpectraStoreSettings": {
"Address": "192.168.10.212",
"Domain": "MOSSBAUERLAB",
"Folder": "Autosaves",
"UserCredentials": null
}
cifs.mount, because Directory in Linux doesn’t
understand Windows network Path, therefore SM2201 config section looks like:
"Sm2201SpectraStoreSettings": {
"Address": "",
"Domain": "MOSSBAUERLAB",
"Folder": "/mnt/sm2201/dev",
"UserCredentials": null
}
Solution could be run either on Windows or Linux
global section:
client min protocol = NT1client lanman auth = yesclient ntlmv2 auth = no
To check is there access to shared folder using smbclient use following command
smbclient //MICHAEL/Autosaves -m NT1 -w MOSSBAUERLAB
Where:
MICHAEL - computer nameMOSSBAUERLAB - workgroup nameAUTOSAVES - name of shared foldercifs(All names must be Uppercase):
sudo mount -t cifs -o user=guest,pass=,vers=1.0,sec=none,domain=MOSSBAUERLAB,ip=192.168.10.217,servern=MICHAEL //MICHAEL/AUTOSAVES /mnt/sm2201/dev
Where:
MICHAEL - computer nameMOSSBAUERLAB - workgroup nameAUTOSAVES - name of shared folderappsettings.Production.json before run and set Address to “” and set Folder to mount point if you are running
solution on Raspberry Pidotnet Wissance.MossbauerLab.Watcher.Web.dll --environment=ProductionTo run Wissance.MossbauerLab.Watcher.Web as a service it should be configured as systemd service:
sudo groupadd mossbauerlabwatcher - sudo useradd -r -g mossbauer -d /usr/local/sbin/labwatcher -s /sbin/nologin labwatcher[Install] WantedBy=multi-user.target
Recently, we Started to build **self-contained archive into single file** except `.pdb`(debug symbols) and configs, in this
case after copy published file `Wissance.MossbauerLab.Watcher.Web` must be made executable `+x` (via `chmod`):
```bash
sudo -u labwatcher chmod +x Wissance.MossbauerLab.Watcher.Web
after that change ExecStart in service file like this:
ExecStart=/usr/local/sbin/labwatcher/app/Wissance.MossbauerLab.Watcher.Web --environment=Production
mossbauer:labwatcher - sudo chown -R labwatcher:mossbauer /usr/local/sbin/labwatcherlabwatcher.service file to /etc/systemd/systemsudo systemctl daemon-reloadsudo systemctl enable labwatchersudo systemctl start labwatcherJan 08 18:14:32 LabControl mount.sh[495]: mount error(101): Network is unreachable
Jan 08 18:14:32 LabControl mount.sh[495]: Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) ...
there are many solutions but for me helpful was adding sleep 20s in .sh script prior to mount
There are following endpoints to receive/manage state from browser or other clients:
GET /api/Spectrum - list all spectra from database;

GET /api/Spectrum/{id} - return one spectrum by its id;GET /api/Spectrum/{id}/samples - return spectrum data including list of all intermediate measurements;GET /api/Spectrum/{id}/samples/{sampleName}/spectrum - return spectrum with file name = {sampleName}

There are the following commands:
listSpectra to get all spectragetSpectrumInfo {id} to get spectrum detailed info, assume passing required parameter - {id}, i.e. getSpectrumInfo 5getSpectrumFiles to get spectrum files , NOT Implemented yetcheckSpectrum to check hardware state