PINE64
What I2C driver solution to use? Thermal imaging - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PinePhone (https://forum.pine64.org/forumdisplay.php?fid=120)
+--- Forum: PinePhone Software (https://forum.pine64.org/forumdisplay.php?fid=121)
+--- Thread: What I2C driver solution to use? Thermal imaging (/showthread.php?tid=12366)



What I2C driver solution to use? Thermal imaging - jnpine - 11-30-2020

Hi All, 

The main question is if you can provide direction on selecting a generic driver that can be later used with applications. 

I am working on a project to add an AMG8833 thermal sensor to the PinePhone, the flex board to expose the pogo pins works, the PCB that holds the AMG8833 is also working fine and it is already being detected. Now on the software side I am not that good so I hope I can get your help on this. 

[Image: IMG-0224.jpg]

Code:
[root@manjaro-arm Raspberry-Pi-Installer-Scripts]# i2cdetect -y 3
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --                

Address has been set with a pulldown resistor on the sensor so it is 0x68.

I can read from the sensor and get temperature values: 
Code:
[root@manjaro-arm Raspberry-Pi-Installer-Scripts]# i2cget 3 0x68 0x80
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will read from device file /dev/i2c-3, chip address 0x68, data address
0x80, using read byte data.
Continue? [Y/n] Y
0x4a

I have tried with Adafruit circuit python with no success to use its examples as I get stuck in needing to install libgpiod which needs a higher version of linux headers than the ones I have installed and are available in Manjaro Beta 2. 
Code:
configure: error: "libgpiod needs linux headers version >= v5.10.0"
Code:
[root@manjaro-arm Raspberry-Pi-Installer-Scripts]# uname -r
5.9.1-9-MANJARO-ARM
[root@manjaro-arm Raspberry-Pi-Installer-Scripts]# pacman -S linux-pinephone-headers
resolving dependencies...
looking for conflicting packages...

Packages (1) linux-pinephone-headers-5.9.9-1

Total Installed Size:  44.91 MiB
Net Upgrade Size:       0.00 MiB

:: Proceed with installation? [Y/n]
Maybe I need to try a different PinePhone distribution? Any recommendations?  

I would like to hear from other users experiences and what they use for I2C drivers.  Do you use a generic driver or write your own from scratch? 

The end purpose is to create a portable infrared camera on your pocket.  

Cheers!.


RE: What I2C driver solution to use? Thermal imaging - Lousy Fisherman - 11-30-2020

Try Arch, it is closer to the amputee ward than Manjaro. I think Manjaro started cause a bunch of sysadmins got upset the Arch's updates would break their systems. Smile
On aarch64 if it is not in Arch you may be able to find Debian/Mobian libraries or apps you can debtap or port.

HTH
LF


RE: What I2C driver solution to use? Thermal imaging - jnpine - 12-01-2020

Thanks for your reply, I will try another OS but also I am experimenting with docker containers and by passing the /dev/i2c-3 when running the container so not to mess with the host OS.


RE: What I2C driver solution to use? Thermal imaging - wibble - 12-04-2020

This might be a start - no progress recently:
https://github.com/vuorioi/amg88xx-kernel-driver

This app uses wiringPi for its i2c access - no idea how portable that is:
https://github.com/ayaromenok/RaspberryPiCameraForAMG8833