You need at least three hands for soldering.  :-)
You should verify that you haven't created a shortcut between two of the
pins.

Yes, -python3.8-smbus.tcz- is the correct extension.

If there are not shortcuts then we can search step by step for the
failure.

1) The kernel module -i2c_dev- is loaded? You can check if the command
was successful with

$ lsmod | grep i2c
One line of the output should start with i2c_dev:
i2c_dev                20480 2


2) The Python script should be executable. You can verify it with the
command "ls -l":

tc@SB-Kitchen:~/lux$ ls -l display-control.py
-rwxr-xr-x    1 tc       staff         4261 Mar 19 21:40
display-control.py

Important are the three 'x' for executable. If they are missing then you
can change it with

$ chmod 755 display-control.sh


3) Verify that the script measuring something.
The script is able to print the measuring results to stdout (i.e. your
command line). To enable this feature, you need to edit the script.
Change line 21 from 
DEBUG = False
to
DEBUG = True

If the script is still running in the background then we have to stop
it.

$ ps -ef | grep display
root      6647  6414  0 21:40 pts/0    00:00:00 /usr/local/bin/python3
/home/tc/lux/display-control.py
tc        7400  6414  0 21:53 pts/0    00:00:00 grep display

in this case, 6647 is the PID of the process 'display-control.py'. You
will get a different number.To stop the script, you need to kill the
process with 'sudo kill <PID>. In my case:

$ sudo kill 6647

Now we execute the script manually:

$ ./display-control.py

You should get output similar to the following (I used a electric torch
so that some values are extremely high):
Light Level : 25.00 lx
Display: 18
Light Level : 29.17 lx
Display: 19
Light Level : 450.00 lx
Display: 121
Light Level : 466.67 lx
Display: 125
Light Level : 2408.33 lx
Display: 255
Light Level : 16787.50 lx
Display: 255
Light Level : 29.17 lx
Display: 19
Light Level : 0.00 lx
Display: 11

4) Are you able to write to the file 
'/sys/class/backlight/rpi_backlight/brightness'. You can check it these
two commands:

$ echo 60 > /sys/class/backlight/rpi_backlight/brightness

and 

$ cat /sys/class/backlight/rpi_backlight/brightness
60

The first command should be executed without an error message and the
second should return value that you wrote into the file (in this case
60).

So, let's see how far you get with your tests.


------------------------------------------------------------------------
jd68's Profile: http://forums.slimdevices.com/member.php?userid=30795
View this thread: http://forums.slimdevices.com/showthread.php?t=112460

_______________________________________________
unix mailing list
unix@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/unix

Reply via email to