Automate your BioReactor
Automatice su Biorreactor
Learn how to schedule tasks to control your devices automatically. Perfect for circadian rhythm experiments or timed agitation.
Important:
Importante:
- Always use the IP address displayed on the device's LCD screen. The examples below use placeholders.
- The devices only support 2.4GHz WiFi networks. Higher frequencies (5GHz, 6GHz) are not supported.
Batch Script (.bat)
Script por Lotes (.bat)
Create a file named set_light.bat:
@echo off
:: Set BioLighting to Warm White
curl -X POST http://192.168.1.50/api/light ^
-H "Content-Type: application/json" ^
-d "{\"r\":255,\"g\":180,\"b\":100,\"intensity\":100}"
pause
Scheduling (Task Scheduler)
Programación (Programador de Tareas)
- Open "Task Scheduler" from the Start Menu.
- Click "Create Basic Task" and name it "BioLight Morning".
- Set the Trigger to "Daily" and choose the time (e.g., 08:00 AM).
-
Action: "Start a Program". Browse and select your
set_light.batfile. - Finish and save. Your lights will now turn on automatically every morning!
Shell Script
Script Shell
Create a file named set_rpm.sh and make it executable (chmod +x set_rpm.sh):
#!/bin/bash
# Set IAShaker to 120 RPM
curl "http://192.168.1.51/rpm?value=120"
Scheduling (Automator)
Programación (Automator)
- Open "Automator" and create a "Calendar Alarm".
- Drag "Run Shell Script" from the actions library.
- Paste the content of your script or execute the file path.
- Save. Calendar will open; set the event time and repeat interval (e.g., every day at 9 AM).
Bash Script
Script Bash
Create a file named experiment_start.sh:
#!/bin/bash
# Turn on Light and Start Shaker
curl -X POST http://192.168.1.50/api/light -d '{"r":0,"g":255,"b":0,"intensity":100}' -H "Content-Type: application/json"
curl "http://192.168.1.51/rpm?value=150"
Scheduling (Crontab)
Programación (Crontab)
Edit your crontab with crontab -e and add a line:
# Run every day at 08:00 AM
00 08 * * * /path/to/experiment_start.sh