adafruit / adafruit_amg88xx_python Goto Github PK
View Code? Open in Web Editor NEWAMG88xx Grid-EYE
License: MIT License
AMG88xx Grid-EYE
License: MIT License
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.
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
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()))
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.
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!
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
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.