Git Product home page Git Product logo

mcci-catena-4430's Introduction

MCCI-Catena-4430 library

GitHub release GitHub commits

This library provides Arduino support for the MCCI Catena® 4430 Animal Activity Sensor Feather Wing.

Introduction

The MCCI Catena 4430 Animal Activity Tracker is an accessory for Adafruit Feather-compatible CPU boards such as the Adafruit Feather M0 or the MCCI Catena 4610. As the name suggests, it allows real-time tracking of the activity of research animals (mice, rats, and so forth) in cages. Data can be stored in an SD card and also transmitted over LoRaWAN networks such as The Things Network or Helium. Local accessories such as pellet feeders can also be controlled.

The product is available stand-alone, or built up into complete sensors, from the MCCI Store.

Picture of 4430 in case

With an MCCI Catena 4610 mounted, the assembly looks like this:

Picture of Catena 4430 outside case

Prior to assembly, the Catena 4430 looks like this:

Picture of Catena 4430 without Feather

The Catena 4430 adds the following functions to any compatible Feather-like board.

  • Passive Infrared (PIR) motion sensor. This can be mounted on the front or back or the board.

  • A battery-backed real-time clock (compatible with Adafruit's Adalogger FeatherWing).

  • An SD-card slot similar to the Adalogger, but different in a couple of ways. First the SD-card is electrically buffered going to and from the system; it can't interfere with the SPI bus when you're not using it. Second, the SD-card slot has a dedicated power supply that is off by default.

  • Three additional lights (red, green, and blue).

  • A JST XH-4 receptacle (in older units, a screw terminal) with four posts: two I/O signals, power, and ground. The power at the interconnect can be turned on and off under software control.

Key classes

cPCA9570 I2C GPIO controller

This class models the hardware of PCA9570 I2C GPIO expander. It has no knowledge of how the PCA9570 is wired up.

c4430Gpios Catena 4430 GPIO Control

This class models the GPIOs of the Catena 4430. It understands the wiring and polarities so that clients can use method like c4330Gpios::setBlue() to turn on the blue LED.

cPIRdigital PIR monitor class

This class monitors the digital output from the PIR and accumulates an activity estimate.

cTimer simple periodic timer class

This class simplifies the coding of periodic events driven from the Arduino loop() routine.

Integration with Catena 4610

The Catena 4610 has the following features.

  • LoRaWAN-compatible radio and software

  • Bosch BME280 temperature/humidity/pressure sensor

  • Silicon Labs Si1133 ambient light sensor

Example Sketches

The Catena4430_Test example sketch tests various features of the Catena 4430.

The Catena4430_Sensor example is a completely worked remote sensor sketch with power management.

Additional material

Check the extra directory for information about decoding data from LoRaWAN messages, JavaScript decoding scripts for The Things Network Console and Node-RED, and complete Node-RED flows and Grafana dashboards for saving and presenting the data using the MCCI Catena docker-ttn-dashboard.

Meta

License

This repository is released under the MIT license. Commercial licenses are also available from MCCI Corporation.

Support Open Source Hardware and Software

MCCI invests time and resources providing this open source code, please support MCCI and open-source hardware by purchasing products from MCCI, Adafruit and other open-source hardware/software vendors!

For information about MCCI's products, please visit store.mcci.com.

Trademarks

MCCI and MCCI Catena are registered trademarks of MCCI Corporation. LoRaWAN is a registered trademark of the LoRa Alliance. LoRa is a registered trademark of Semtech Corporation. All other marks are the property of their respective owners.

mcci-catena-4430's People

Contributors

dhineshkumarmcci avatar svelmurugan92 avatar terrillmoore avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

mcci-catena-4430's Issues

Incorrect error message "** no SD card and not provisioned!"

Configuration

V0.5.2 (and probably other versions)
2 MHz / hw serial / AU915

Repro instructions:

  1. remove battery on RTC
  2. remove power from 4430
  3. apply power
  4. install SD card
  5. disable LoRaWAN lorawan configure join 0
  6. reboot

Desired behavior:

system prints "RTC not set, not storing data"

Actual behavior

system prints "** no SD card and not provisioned!"

Here's a log. Note that dir and tree work, but the SD card is empty; we're not writing because the clock is not set.

------------------------------------------------------------------------
This is Catena4430_Sensor.ino v0.5.2-0.
Target network: The Things Network / au915
System clock rate is 2.097 MHz
Enter 'help' for a list of commands.
------------------------------------------------------------------------

FLASH found, put power down
cMeasurementLoop::fsmDispatch: enter stInactive
RTC is not running
?CatenaStm32L0::LoRaWAN::begin: Arduino_LoRaWAN:begin failed
?Catena461x::LoRaWAN::begin: Super::begin() failed
cMeasurementLoop::fsmDispatch: enter stWarmup
cMeasurementLoop::fsmDispatch: enter stMeasure
cMeasurementLoop::fsmDispatch: enter stTransmit
Vbat:    4200 mV
Vbus:    5259 mV
BME280:  T: 23 P: 98598 RH: 17
Si1133:  315735 White
cMeasurementLoop::fsmDispatch: enter stWriteFile
measurement time not valid
cMeasurementLoop::fsmDispatch: enter stAwaitCard
** no SD card and not provisioned!
cMeasurementLoop::fsmDispatch: enter stSleeping
using light sleep
dir
OK
tree
OK

prepare for release v0.4.0

  • update Catena4430_Sensor.ino to v0.4.0
  • update library.properties to v0.4.0
  • update Catena4430_version.h to v0.4.0
  • generate pull-request
  • merge into master
  • tag and release

Add firmware update via SD card

If using the trusted bootloader, we can implement firmware update by reading the firmware image from a file on the SD card.

Extra header column in SD logfile

There are 23 header columns but only 22 data columns. There are headers for “Vbat”, “Vsystem”, and “Vbus” but I think “Vsystem” is not being written? Can this value be written or the header column for Vsystem removed so the others line up?

Bootloader fails to load FW BIN file

The example Catena4430_Sensor is designed to end SPI2 and other peripherals if the device is not powered up with USB. This is designed to minimize the power consumption, as the device not enter deepsleep between lorawan transmissions.

And this causes bootloader to fail loading the firmware. and with the flash error Invalid flash manufacture id.

------------------------------------------------------------------------
This is Catena4430_Sensor.ino v0.5.1-0.
Target network: The Things Network / us915
System clock rate is 2.097 MHz
Enter 'help' for a list of commands.
------------------------------------------------------------------------

FLASH found, put power down
cMeasurementLoop::fsmDispatch: enter stInactive
RTC is running. Date: 2021-07-20 12:14:31Z
cMeasurementLoop::fsmDispatch: enter stWarmup
cMeasurementLoop::fsmDispatch: enter stMeasure
cMeasurementLoop::fsmDispatch: enter stTransmit
Vbat:    3688 mV
Vbus:    5 mV
BME280:  T: 30 P: 100585 RH: 50
Si1133:  586825 White
EV_TXSTART
EV_TXCOMPLETE
cMeasurementLoop::fsmDispatch: enter stWriteFile
cMeasurementLoop::fsmDispatch: enter stTryToUpdate
Attempting to load firmware from update.bin
Invalid flash manufacture id=D7

SD card generally doesn't come up

When running the catena4430-sensor example, it's very common for the SD card not to come up. The symptom is a bunch of error messages on the console, followed by "checkSdCard() failed".

It doesn't happen every time, but it happens a lot.

Create release v0.3.4

We have to be careful with release versions in libraries as opposed to example scripts; need to keep in sync. The library needs more work before going to v1.0.0, because the hardware-related SD card support and the measurement work need to be moved to the core library.

Update version to 0.5.2 for release

Unfortunately, we can't tag with 0.5.2 without also changing the library version. This is why examples should not be used for shipping apps, because you need to be able to version them separately from the library. Solution for now: bump the library version, too. (We missed this for a couple of prior releases, so this library probably confused the IDE.)

  • update Catena4430_version.h
  • update Catean4430_Sensor.ino
  • Update library.properties
  • Update README.md badges
  • Update README.md history
  • pull request
  • merge
  • release

Find better approach for double reset

The double-reset for toggling the lights worked great until we added the secure boot loader. That made it very hard to judge timing.
Need a better approach so that the user knows when to push reset a second time.

Add a few additional file management commands

we have "dir" and "tree". It would be nice to also have "cat" so we could look at files.

We could also add "rm", but this would need to be controlled by a password, as we don't necessarily want people removing files mid experiment unless they're authorized.

Need a flag to say (in uplinks) that the time is synchronized

If we know that the time is synchronized on the device (using the get-time mechanism) then Node-RED can use the time stamp from the message rather than the network time. But if we don't know that the time is valid, Node-RED should use the network time.

Hence, a bit in the uplink would be nice; or just send zero if we haven't yet synchronized. (Node-RED would then just use the network time as at present if the timestamp is zero.) We'd probably have to change the uplink format byte from 0x22 to something else... or different port number.

Need to decide and document.

Uplink Version #

Need a standard way to get the application version number. Does not have to be present on every uplink; could be sent on boot or once a day or something on a different port. Or could be sent on request. But it's important to know what is in the devices.

The report should include:

  • 32-bit version number (x.y.z-pre)
  • The SHA512 hash of the application

Extra points would be to add ability to query the versions of each library. For that, we'd need a tag for each library, along with the 32-bit version number. This might need to be GUID based for the library tag, otherwise there's not a good way to identify.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.