Mongoose Disconnects Streaming Time Series Data

NOTE: MongoDB Defaults installation on the Raspberry Pi to 4.4, not 6.0.5, so when you specify install of 6.0.5 it’ll install 4.4 which is why time series won’t work, so now I need to figure out whether to get rid of the Pi and go with something else, or get rid of MongoDB and use something else for this project. I will look and see what I can maybe do with just Realm and Apollo for the local devices.

Following this guide: https://www.mongodb.com/docs/manual/core/timeseries/timeseries-procedures/
My webpage connects to the Atlas Cluster totally just fine, but then when I run execution of time series data to populate points from this guide, and listing time series collections etc.

I get an error saying Atlas isn’t connected, or I get connection time-out.

But then I do other tasks and things, and it works totally fine without any sort of errors. Is there something specific with calling up time series data with Mongoose I need to put into consideration? I’m trying to avoid the Node.JS Driver due to its size as this web app needs to be as small and compact as possible to fit on embedded devices for a project bid I’m working on for a Marine based IoT system, that will be using real-time tracking.

Already using Apollo GraphQL Client, and Realm Node.JS SDK on the devices themselves, but I need a working dashboard for a device a ship or boat can mount in the bridge or another location. The more compact it is the better due to storage and power limitations.

Device specs for Marine Device:

  • LoRaWAN Long-Range transmission
  • Zigbee for local proximity inter transmissions of data between devices for “hopping” as needed
  • 8V rechargeable battery
  • PV Charging to onboard battery pack
  • Wind and GPS based on Garmin
  • Built from Raspberry Pi 4 2GB RAM with Ubuntu Server
  • 3.5 inch display
  • Apache Web Server
  • Ubuntu Server
  • Python, Node.JS, and Rust.
  • MQTT
  • APOLLO GraphQL Client
  • Node.JS SDK
  • WiFi 6 module

Dashboard Unit

  • Zigbee and LoRaWAN integrated board to I/O for Pi 4 w/ 8GB RAM
  • 13 inch display
  • Apache Web Server
  • WiFi 6 module and ethernet connection.
  • Node.JS, Python, and React.JS
  • MongoDB 4.4 for location collection when in range without WiFi or satellite internet access with gateway to customer Atlas once internet is available.
  • MQTT
  • Node.JS SDK
  • Mongoose
  • Apollo GraphQL Server

Devices are all intended to automatically send updates to atlas when network connection is available.

Right now this is all just proof of concept, so everything is local and just connected to WiFi in a SOHO, network connection speeds are 50Mb up and 171 down so it’s not internet connection related.

Node.JS SDK isn’t setup yet on dashboard unit, is intended and designed to work as redundancy to ensure the data gets to Atlas, due to the extreme remote nature of these devices and services the ships and submersibles will be operating.

NOTE: Reason for choice of Mongoose over Node.JS Driver, is due to Node.JS Driver size and needing 61.55% more power to use over Mongoose. Node.JS SDK also consumes approx 19% less power than the Driver. I have to try and cut as much power consumption as possible, even working on beefing up the battery to a 24V and building step-down buck converter boards if I have to, but am trying to avoid anything that takes more power than necessary.

EDIT NOTE:
The reason this won’t work as I’m realizing, is wrong version of MDB got installed on the local devices.

On the Raspberry Pi’s the installation defaulted to 4.4 instead of 6.0.5, which now makes sense as I forgot 6.0.5 isn’t supported on the Raspberry Pi 4 due to the CPU. So only Realm would work for this unfortunately.

So this project either needs to go to a different computer board, or can’t use MongoDB on the local devices, so will look at just the Node.JS SDK instead.

I should have used

mongod --version

And checked what version was in use, so that’s why Mongoose disconnected or timed out, it apparently doesn’t throw back the error that the feature isn’t supported which is why it keeps “disconnecting.” Atlas is on 6.0 but all the Pi’s are on 4.4…

At this point it’s either going to end up being Redis or Realm for this as the main DB on the local device, I’d rather not use Redis for this use case due to it being more horizontal scale in needs vs vertical scale where Redis would be more suited.

Realm will be a gamble for this project but I’ll see how it goes, as I was planning the Realm Node.JS SDK anyway. GraphQL can handle the time series data with the custom scalars via the Apollo Client, and Realm handle the sensor data, but then I’m running in compliance problems I’ll have to figure out and sort out.

Any advice appreciated on this.