Giter Site home page Giter Site logo

adafruit_amg88xx_python's Introduction

DEPRECATED LIBRARY Adafruit_AMG88xx_python

This library has been deprecated!

We are currently only supporting the circuitpython version of this library - it works great on Raspi/Linux and easier for us to maintain.

we are leaving the code up for historical/research purposes but archiving the repository.

check out this guide for using the amg8833 with python! https://learn.adafruit.com/adafruit-amg8833-8x8-thermal-camera-sensor

adafruit_amg88xx_python's People

Contributors

brennen avatar caternuson avatar deanm1278 avatar dhalbert avatar ladyada avatar martinohanlon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adafruit_amg88xx_python's Issues

Hiccups in data reading (based on "thermalcam.py")

Hello all

running some code based off AdaFruit's examples using AMG8833 module + Raspberry Pi Zero W.

The python code below reads the pixels in as quickly as it can, formats it as an OSC message and sends to a designated IP where I'd like to signal process in Max to compose some responsive media.

`
from Adafruit_AMG88xx import Adafruit_AMG88xx
from time import sleep
from os import putenv
from OSC import OSCClient, OSCMessage
from socket import gethostname

putenv('SDL_FBDEV', '/dev/fb1')

#get socket/hostname
id = gethostname()

#initialize the sensor
sensor = Adafruit_AMG88xx()
sleep(.1)

#initialize OSC client
client = OSCClient()
client.connect(('192.168.200.246', 9876))
#224.0.0.1

#run code, read sensor
while(True):

    client.send( OSCMessage("/thermal/"+id, sensor.readPixels()))

`
screen shot 2018-07-11 at 5 13 08 pm

However I am running into a hiccup, and I am not sure the source (it could be the python code, streaming over the network, or some interrupting background process in the Raspbian stretch OS)

After receiving the data, I receive at a smooth frame rate (~80ms) for about 4 seconds, then a hiccup. This is entirely regular. See the screenshot of the visualization of the frame rate in Max Msp (attached).

I have tried experimenting with a time.sleep in the while loop at different intervals but the frame rate decreases and the hiccup persists. I have also tried experimenting with some overclocking settings, etc. I am wondering if anyone has run into a similar problem and knows what the source of the hiccup is and how to fix it! Thanks.

HDMI output example

Is it possible to show an example of running the thermal cam via HDMI. Currently, I've commented out the os.putenv line, expecting it to work, but the screen goes black and nothing is drawn.

Perhaps i'm missing something?

Python 3 compatibility - bitfield

There is an error when using this library with Python 3

Traceback (most recent call last):
  File "examples/pixels_test.py", line 40, in <module>
    sensor = Adafruit_AMG88xx()
  File "/usr/local/lib/python3.5/dist-packages/Adafruit_AMG88xx/Adafruit_AMG88xx.py", line 91, in __init__
    self._pctl = Adafruit_bitfield([('PCTL', 8)])
  File "/usr/local/lib/python3.5/dist-packages/Adafruit_bitfield/Adafruit_bitfield.py", line 8, in __init__
    for key, value in self._structure.iteritems():
AttributeError: 'collections.OrderedDict' object has no attribute 'iteritems'

The error originates from Adafruit-bitfield. I was going to fix and provide a PR but I cant find the repo - pypi points to https://github.com/adafruit/Adafruit_bitfield_python but it doesn't exist.

Missing module named Adafruit_bitfield

when attempting to run the example codes that imports Adafruit_AMG88xx, which then imports Adafruit_bitfield, error is raised that no such module is found

temp calc for negative numbers not correct

the calculation for the pixel values is not correct.
the adafruit spec sheet from panasonic states: https://cdn-learn.adafruit.com/assets/assets/000/043/261/original/Grid-EYE_SPECIFICATIONS%28Reference%29.pdf?1498680225
on page 14

""(11) Temperature Register
Register for reading only to indicate temperature data per 1 pixel.
Temperature Data of each pixel is 12 bit data and 2 byte data.
1 LSB has 12 bit resolution (11 bit + sign) which is equivalent to 0.25℃
and it is indicated as two's complement form.""

the correct conversion should be:

def twoCompl12(self, val):
       if  0x7FF & val == val:
           return float(val)
       else:
           return float(val-4096 )

for the thermistor it is correct

def signedMag12ToFloat(self, val):
       #take first 11 bits as absolute val
       if  0x7FF & val == val:
           return float(val)
       else:
           return  - float(0x7FF & val)

Panasonic has apparently used 2 different forms to do negative numbers for the thermistor and the pixels.

This was tested with ice and in the freezer: the new formula seems to show the proper numbers, using the posted python formulas one gets wrong numbers for negative C surfaces

Karl

Calculation for the positive pixel values is not correct.

Please, my sensor has values between 20º and 25º when the temperatures are actually lower or higher than those shown. Can anyone help me explain how to calibrate the temperature values shown for real?
I'm a nooby in python and I have not found a satisfactory material on how we can do this.
Tks!

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.