gilestrolab / ethoscope

a platform from monitoring animal behaviour in real time from a raspberry pi
http://lab.gilest.ro/ethoscope/
GNU General Public License v3.0
17 stars 25 forks source link

Running Ethoscope without a node #166

Closed roaldarbol closed 2 years ago

roaldarbol commented 2 years ago

Hi! I've just come across Ethoscope and though I haven't yet tried it out, I must say I'm super impressed! I've been doing recordings of various smaller insects, mostly ants and ground beetles, in a setup that looks very similar (RPi controlled, IR lighting, camera above), but without the need to do high-throughput recordings yet. As I use the RPi as my "node" and data collector, I was wondering if it is somehow possible to run Ethoscope on the Pi alone, i.e. without the need of a node? The real-time tracking would be great for closed-loop experiments (as you obviously know), and if it would be sufficient to install the python package it would be much more suitable for a small lab like mine, while also making it easier bringing it out in the field as there's no reliance on wireless connections. :-) Thanks!

qgeissmann commented 2 years ago

Hi @roaldarbol, Thanks for your feedback! Quite exciting to hear that you are planning some fieldwork as well. would love to talk about it at some point. It is certainly possible with some tweaking. The important considerations are:

I am working on a field project at the moment, and built a portable node-like unit with its own router. This is very convenient as then you can use the web interface connecting to your own hotspot... That would work for the ethoscopes too. Happy to talk about it if you should me an email. Maybe the other contributors have ideas.

ggilestro commented 2 years ago

You do not need a node, in principle, no. Each ethoscope runs natively a webserver that is used as API. So, as long as you are on the same network you can control the ethoscope (stop, start, etc) with simple HTTP calls. The actual URLs are not fully documented but you can get an idea looking here:

https://github.com/gilestrolab/ethoscope/blob/dde6f9310a25cc8358b6fb2734bced87e015abbc/src/scripts/device_server.py#L36-L53

roaldarbol commented 2 years ago

Hi both, thanks for the swift replies! @qgeissmann I'll be starting out in the lab, and bringing it to the field is more of a vision of mine. ;-) And I'd be more than happy to talk about it, I'll shoot you an email! What have you done router-wise?

  1. Good question, I hadn't thought about that in a field setting. In the lab I currently just have a screen and remote keyboard/mouse attached to my RPi4 on which I run the experiments.
  2. Real-time would be absolutely brilliant. Since I'm also working on sleep, I think being able to present stimuli in closed-loop would be far better than doing it in open-loop. I currently have a good camera setup, save videos as files, and track them in TRex, so it would be mostly for the utility of real-time tracking.
  3. Not many, most likely max. 2 in the same lab space.

@ggilestro that's quite interesting. Maybe a stupid question: Does that mean that one could essentially use a phone/tablet as a node? Otherwise, I guess one could make a RPi touchscreen.

After spending a bit more time with the documentation, it actually seems quite a bit easier than what I first imagined. Just to clarify: If I download the node RPi image using the link, do I still need to make an image (everything in me says no, but then again... I'm wrong about stuff all the time)? Screenshot 2021-10-27 at 14 33 13

And a final side note, I'm making some design tweaks for the Ethoscope setup itself (like your Lego and cardboard versions) using MakerBeam and magnets for a super modular design where the structural components can be repurposed even when other parts of the design changes; as well as moving the Pi down to have the CoM lower, making the ethoscope more stable. I'll upload the design here on Github as soon as they're decent. I'd be super keen to contribute more to the project, and would be happy to discuss more.

ggilestro commented 2 years ago

If you download the RPI4 image you just need to burn it on an SD card and you'll have a node ready to go. The latest commit also adds some further options for controlling activities without using a node. See the ethoclient.py file for the actual code.

python ethoclient.py -s 192.168.1.125 -c stop