Closed LoopyFoot closed 4 years ago
Hello @LoopyFoot If you can connect melexis to the existing rpi i2c then you could clone my repo and use the code (modify at will ) https://github.com/abood91/RPiMLX90640
So I think I got it working! What would it take for me to display the Temp Data on an image, as opposed to as the individual pixel values in the command prompt? I was thinking that this could be accomplished with Python.
Or does your code create an image somewhere which I am not finding? I created a folder called "90640-vs-driver" and a sub-folder called "img", but I am not seeing any .bmp images pop up in that directory. Am I missing something in order to see the images?
Update: I am guessing that I need to call writeBMP. Any suggestions on where to call writeBMP and the arguments to use?
Hello @LoopyFoot First of all on my previous testing writeBMP did not really work so you need to create that functionality yourself (in python its much easier ). read the main.cpp carefully there is couple of comments added, in general Colorize()
function writes xxxxxxxx.rgb.txt file to ./img/ folder and display_Img()
writes xxxxxxxxx.temp.txt to that folder too. check the comments
I have added also #ifdef REMOVE_1H_OLD_FILES
you should enable this only if you want to delete the files that is older than 1 hour
I've got a false coloured, direct-to-framebuffer example up and running on the Raspberry Pi - see: https://github.com/pimoroni/mlx90640-library/blob/master/fbuf.cpp
This uses continuous mode, plus some fine-tuned timing in order to get the data out of the sensor with the fewest retries and the most sleep period. It works up to 64hz but that's really pushing the limit (and the resulting image is quite noisy). It sets the Pi's i2c bus to 1mhz, which, is incompatible with SMBus.
Timing is very, very finicky and if you don't sync with the data availability on the sensor then it'll churn through unnecessary i2c reads and just throw the data away.
I calculate the time it takes to read the sensor and display to the framebuffer so it can sleep for the appropriate amount of time. There's also a slight offset in there, since hitting 31.25ms dead on at 32hz seems to result in the data not being ready (implying the sensor isn't actually running at 32hz but perhaps closer to 31).
Here it is in action: https://twitter.com/Gadgetoid/status/1011984760623763456
Thanks for sharing the library! I think that I have it up and running on my Pi.
I was wondering if you have the functionality to save the array of data in a .csv file?
That's one of the first things I wrote before shifting to a framebuffer output- albeit I was outputting binary data and converting it to a series of PNG images and then finally an animated GIF with Python.
It's possible to capture one or more frames and save their output into a binary file. I don't see any reason why you couldn't do the same with CSV although 768 columns of temperature data would be some painful data to process!
What's your end goal with the CSV data? Reading it into another language for processing?
Hi Gadgetoid, Is there any way to add in your display more colours (p.ex: blue) and adapt the display resolution to a 1920 x 1080p screen?
The problem is: When I try to interpolate data more dan WIDTH4 or HEIGHT4 the display dose not show the entire image.
n=4 is the maximum number allowed.
Hello @LoopyFoot First of all on my previous testing writeBMP did not really work so you need to create that functionality yourself (in python its much easier ). read the main.cpp carefully there is couple of comments added, in general
Colorize()
function writes xxxxxxxx.rgb.txt file to ./img/ folder anddisplay_Img()
writes xxxxxxxxx.temp.txt to that folder too. check the comments I have added also#ifdef REMOVE_1H_OLD_FILES
you should enable this only if you want to delete the files that is older than 1 hour
do you know how to read data from mlx90640 with python? thanks!
hello @Gadgetoid. I am using https://github.com/pimoroni/mlx90640-library.git library for my camera on pi 3. I can get the readings and and outputs of step and test.cpp. I want to display the running image using rawrgb or fbub but the fbuf gives me cnt > 4 error continuously. wondering if I need to any better GUI to display or I am doing something wrong.
check /boot/config.txt dtparam=i2c1_baudrate=1000000
I have same problem as SushanTiwari above. I have set dtparam=i2c1_baudrate=1000000 but to no avail. I don't understand what FBUF actually does but it shouldn't give these errors - someone please advise.
On a raspberry pi, you might want to consider to use the pure python package: https://github.com/melexis-fir/mlx9064x-driver-py
On a raspberry pi, you might want to consider to use the pure python package: https://github.com/melexis-fir/mlx9064x-driver-py
Thanks, I'll definitely try that.
However, following advice from Pimoroni, I reduced the frame rate from 8 to 4 FPS in the source codes of the various examples that were giving the error. This basically solves the issue, although I still get a few CNT > 4 errors. It needs further investigation to assess the cause of the problem since I feel it should do 8 FPS. So I need to check the I2C baud rate really is 1 Meg and to try to determine if outputting to a 1600x1200 HDMI monitor has any effect - a lower resolution display might work better.
Hello sir,
First off, thank you for providing such a successful repository :)
I am trying to read the data from my MLX90640 sensor (which I have on a prototyping breadboard with pull-up resistors and decoupling capacitors) onto my Raspberry Pi. I am confused about steps needed to do in order to take the files which you have provided, and read the data from my MLX90640 sensor and perhaps visualize the individual pixel values.
From a high level, what steps are needed in order to take the files which you have provided here in this repository, and then read the data from the MLX90640 using my Raspberry Pi? I have the sensor successfully connected to my Raspberry Pi using the i2cdetect command, and I successfully see it at address 0x33.
I cloned your github repository; but I am unsure what my next steps should be. For example, do I need to create a Makefile, compile the project in Geany? How do I get to a point where I can visualize the data coming in from the sensor?
Any information or support is gratefully appreciated!