Reading a Seneye using a Raspberry Pi – USB devices

I recently purchased the excellent Seneye aquarium monitor. It is a small device with that sits in a fish tank and monitors various parameters.


I’d been looking for a simple device like this for some time – not too complex, not too expensive. It may not sense some parameters needed in a marine tank however it does do the basics such as temperature, in/out of water, ammonia and pH. As I mentioned before, water chemistry is difficult and you shouldn’t knock those who have tried. Other devices are more complex, expensive, or actually never successfully made it to market. In essence it reads the colour change of a litmus strip by comparing it to a sealed reference, as well as temperature and water refraction.

The challenge came about because although they have a cloud solution that transmits readings every 30 minutes, the device itself has to connect to a Windows PC and thence to the cloud. I’d looked at running a low-powered Windows SBC or even purchasing Seneye’s always-on connection device, but the easiest seemed to be to read the USB device.

USB devices

USB devices are a wonder to behold. They do a lot of work internally and the USB protocol spec runs for many pages. I looked for libraries to help me read the device and found a couple which work in Python, my language of choice. USB also delineates a special form of device known as the ‘HID’, or Human Interface Device. These are things such as USB mice, track-pads and keyboards. They have a simpler interface and only use a couple of the modes of transfer: control, and interrupt.

Walking the USB tree

As USB devices have a hierarchical protocol we need to find out some things about it.

  1. Device
  2. Configuration
  3. Interface
  4. Alternate setting
  5. Endpoint

We start by looking at the device itself using Linux commands and the udevadm command. The udevadm command may not be installed on your system and should be installed using your distro’s package manager.

Firstly, using lsusb we get to see where our device is sitting on the bus – and note that this changes every time we plug it in.

Bus 002 Device 089: ID 24f7:2204

… so our device is on the bus number 2, and is at device number 89. Now, using udevadm we can test this and get the device characteristics:

udevadm info -a -p $(udevadm info -q path -n /dev/bus/usb/002/089)
looking at device '/devices/pci0000:00/0000:00:14.0/usb2/2-1':
    ATTR{bNumInterfaces}==" 1"
    ATTR{manufacturer}=="Seneye ltd"
    ATTR{product}=="Seneye SUD v 2.0.16"
    ATTR{version}==" 2.00"

From this we can see that the device has one configuration and one interface. It also contains the device’s serial number. Other notable things are the maximum packet size, and the power requirements. That number of interfaces response is a little odd?


4 thoughts on “Reading a Seneye using a Raspberry Pi – USB devices

    1. Any single-board computer (RasPi 3, odroid, beaglebone, …) with a USB connection can read the Seneye and display the results. Just take my code and change it to write to a screen. But the challenge is that the Seneye accumulates readings and does not clear them until secret protocols are used. I did not attempt to discover these secret protocols, and only use the public ones released by the Seneye company.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s