Giter VIP home page Giter VIP logo

cayenne-plugin-sensehat's Introduction

Cayenne Sense HAT Plugin

A plugin allowing the Cayenne Pi Agent to access Sense HAT data and display it in the Cayenne Dashboard.

Requirements

Hardware

Software

Getting Started

Installation

From the command line run the following commands to install this plugin.

cd /etc/myDevices/plugins
sudo git clone https://github.com/myDevicesIoT/cayenne-plugin-sensehat.git
cd cayenne-plugin-sensehat
sudo python3 setup.py install
sudo service myDevices restart

Using the Sense HAT Emulator

If you do not have an actual Sense HAT board and would like to use the Sense HAT Emulator instead you will need to install and run the Emulator.

  1. Install the Sense HAT Emulator.

    sudo apt-get update
    sudo apt-get install python-sense-emu python3-sense-emu sense-emu-tools
    
  2. Launch the Sense HAT Emulator from the Pi desktop.

  3. Add this entry to the SenseHAT Temperature section in the sensehat.plugin file: init_args={"use_emulator": true}.

  4. Restart the Cayenne Agent.

    sudo service myDevices restart
    

    Temporary widgets for the plugin should now show up in the Cayenne Dashboard. You can make them permanent by clicking the plus sign.

    NOTE: If the temporary widgets do not show up try refreshing the Cayenne Dashboard or restarting the agent again using sudo service myDevices restart.

cayenne-plugin-sensehat's People

Contributors

jburhenn avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

melvinhtet

cayenne-plugin-sensehat's Issues

Doesn't work under Raspbian GNU/Linux 10 (buster)

The plug-in installs just fine, no errors, however none of the sensors show up. This is the latest buster image freshly copied onto a new SD card straight from Rpi site:

PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

Log file below, it seems to me that the plug-in can't communicate with the bare metal Hat, possibly due to the buster image? Otherwise the Hat is fully functional, I can read sensors from small py example code just fine.

2020-07-03 06:35:11 - myDevices - INFO - Sensors info: []
2020-07-03 06:35:11 - myDevices - INFO - Sense HAT service connection refused
2020-07-03 06:35:11 - myDevices - ERROR - [Errno 111] Connection refused
2020-07-03 06:35:11 - myDevices - INFO - Sense HAT service connection refused
2020-07-03 06:35:11 - myDevices - ERROR - [Errno 111] Connection refused
2020-07-03 06:35:11 - myDevices - INFO - Sense HAT service connection refused
2020-07-03 06:35:11 - myDevices - ERROR - [Errno 111] Connection refused
2020-07-03 06:35:11 - myDevices - INFO - Sense HAT service connection refused
2020-07-03 06:35:11 - myDevices - ERROR - [Errno 111] Connection refused
2020-07-03 06:35:11 - myDevices - INFO - Send changed data: [{'sys:cpu;load': 16.5}, {'sys:cpu;temp': 48.85}, {'sys:ram;usage': 302604288}, {'sys:storage:/;usage': 3119116288}, {'sys:net;ip': '192.168.166.94'}, {'dev:sensehat:4': 0}, {'dev:sensehat:5': 0.0}] + sys:gpio
2020-07-03 06:35:26 - myDevices - ERROR - Failed to get sensor data: Temperature GGMMo5GMCJpwLKG
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/myDevices-2.0.4-py3.7.egg/myDevices/sensors/sensors.py", line 322, in SensorsInfo
    value = self.CallDeviceFunction(func)
  File "/usr/local/lib/python3.7/dist-packages/myDevices-2.0.4-py3.7.egg/myDevices/sensors/sensors.py", line 264, in CallDeviceFunction
    result = func(*args)
  File "/usr/local/lib/python3.7/dist-packages/myDevices-2.0.4-py3.7.egg/myDevices/devices/sensor/__init__.py", line 116, in getCelsius
    return self.__getCelsius__()
  File "/usr/local/lib/python3.7/dist-packages/myDevices-2.0.4-py3.7.egg/myDevices/devices/sensor/tmpXXX.py", line 48, in __getCelsius__
    d = self.readBytes(2)
  File "/usr/local/lib/python3.7/dist-packages/myDevices-2.0.4-py3.7.egg/myDevices/devices/bus.py", line 157, in readBytes
    return bytearray(self.readDevice(size))
  File "/usr/local/lib/python3.7/dist-packages/myDevices-2.0.4-py3.7.egg/myDevices/devices/bus.py", line 153, in readDevice
    return os.read(self.fd, size)
OSError: [Errno 121] Remote I/O error
2020-07-03 06:35:26 - myDevices - INFO - Sensors info: []
2020-07-03 06:35:26 - myDevices - INFO - Sense HAT service connection refused
2020-07-03 06:35:26 - myDevices - ERROR - [Errno 111] Connection refused
2020-07-03 06:35:26 - myDevices - INFO - Sense HAT service connection refused
2020-07-03 06:35:26 - myDevices - ERROR - [Errno 111] Connection refused
2020-07-03 06:35:26 - myDevices - INFO - Sense HAT service connection refused
2020-07-03 06:35:26 - myDevices - ERROR - [Errno 111] Connection refused
2020-07-03 06:35:26 - myDevices - INFO - Sense HAT service connection refused
2020-07-03 06:35:26 - myDevices - ERROR - [Errno 111] Connection refused
2020-07-03 06:35:26 - myDevices - INFO - Send changed data: [{'sys:cpu;load': 0.0}, {'sys:cpu;temp': 45.084}, {'sys:ram;usage': 302784512}]

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.