Sensor connection issues - MetaBase-Node

What would cause the sensor to not connect when it is within range of the MetaHub device? Currently the MetaHub is set to log on a schedule for X hours, download and restart. It works for short time periods (<= 1hr) but only works sporadically with longer time periods of logging. When it tries to reconnect, the message displayed is: "warn: could not find device: XX:XX:XX:XX:XX". Then it exits the program. Only one sensor is connected at a time.

I can set up some repeated connection attempts, but I am curious what the underlying cause is. Bluetooth? C++ code? If there's something I can adjust within the underlying code I'm happy to do so.

Comments

  • I would need to see code to comment more. Are you using the defacto metahub? How are you scheduling the download and restart?

  • Yes, it's the de facto MetaHub. The commands are run via a script that uses the exact commands provided in the README for the MetaNode-Base, then a sleep command in between each. It replicates what a user would do to download from a logging state. The commands script is started from a desktop icon script.

  • Following up on this. Multiple MMC sensors have been tried, and sometimes they will connect and log, but it is too unreliable to be of use in a project. Are there any fixes? I tried installing the latest JavaScript SDK, but that didn't seem to help.

  • @jjm345, @segfaultking, I will need more information to comment. What does your setup look like. Why is it unreliable? How is in unreliable and so on.

  • I am simply using the standard Metabase-Node setup and adding in the settings to the JSON file that are included in the README.
    For example, a sensor is setup to Download, it will attempt to connect, then a Warn message is received saying it can't connect or 'Failure to Initialize the SDK'. This happens frequently, like 7 times of 10 for example. The MetaHub was procured directly from MBientlab.

    I have changed MMC sensors, changed batteries, done a manual reset on the sensor using the mobile application. Does that help?

  • Hi @Laura,

    This is the script I am using. It was working fine, but after a few cycles of log/download - it will stop connecting.
    As you can imagine, this is frustrating when trying to collect data over long periods of time.

    #!/usr/bin/env sh
    
    cd ~/Apps/MetaBase-Node
    
    sudo npm start -- --config metabase-config.json --command log
    
    echo "logging sensor data"
    
    sleep 1h
    
    sudo npm start -- --config metabase-config.json --command download
    
    echo "downloaded"
    
    sleep 5s
    
  • I recommend reseting the device as often as your app allows it.

Sign In or Register to comment.