DORS/CLUC 2018: linux+sensor+device-tree+shell=IoT ?

You have one of those fruity *Pi arm boards and cheep sensor from China? Some buttons and LEDs? Do I really need to learn whole new scripting language and few web technologies to read my temperature, blink a led or toggle a relay? No, because your Linux kernel already has drivers for them and all you need is device tree and cat. Below is transcript of talk:
0:00:00.000,0:00:09.540
Hello. How are you?
This is the participation part, come on

0:00:09.540,0:00:19.619
you're not the first I time here!
OK, my name is Dobrica Pavlinušić and I will try to

0:00:19.619,0:00:25.019
persuade you today that you can do with
your Linux something which you might not

0:00:25.019,0:00:32.969
have thought of by yourself I hope in a
sense in last year and a half I noticed

0:00:32.969,0:00:38.610
that I am using microcontrollers for
less and less and that I'm using my

0:00:38.610,0:00:44.760
Linux more and more for more or less the
same tasks and in that progress process

0:00:44.760,0:00:51.239
I actually learned something which I
want to share with you today in a sense

0:00:51.239,0:00:57.059
my idea is to tell you how to do
something with your arm single board

0:00:57.059,0:01:05.729
computer in this lecture we will talk
mostly about Allwinner boards but if

0:01:05.729,0:01:12.119
you want a hint if you want to buy
some arm computer please buy the board

0:01:12.119,0:01:17.070
which is supported by armbian. armbian  is the project which actually

0:01:17.070,0:01:21.360
maintains the distribution for our
boards and is currently the best

0:01:21.360,0:01:27.689
distribution for arms aside from me
raspbian for Raspberry Pi but raspbian

0:01:27.689,0:01:32.909
supports only Raspberry Pi but if you have
any other board please take a look if

0:01:32.909,0:01:37.860
there is an armbian port. if there isn't
try to contribute one and if you are

0:01:37.860,0:01:41.850
just deciding which board to buy my
suggestion is buy the one which is

0:01:41.850,0:01:47.070
already supported on the other hand if
you already did something similar you

0:01:47.070,0:01:52.079
might have found some references on the
internet about device three and it

0:01:52.079,0:01:55.619
looked like magic
so we'll try to dispel some of that

0:01:55.619,0:02:03.180
magic today unfortunately when you start
playing with it one of the first things

0:02:03.180,0:02:10.459
you will want to do is recompile the
kernel on your board so be prepared to

0:02:10.459,0:02:15.810
compile additional drivers if they are
not already included. armbian again

0:02:15.810,0:02:21.890
wins because it comes with a lot of
a lot of drivers already included and

0:02:21.890,0:02:28.950
this year I will not say anything which
requires soldering which might be good

0:02:28.950,0:02:35.190
for you if you are afraid of the heat
but it will be a little bit more than

0:02:35.190,0:02:41.519
just connecting few wires not much more
for a start let's start with the warning

0:02:41.519,0:02:46.980
for example you have a arms in arms
small arm board and you want to have a

0:02:46.980,0:02:52.019
real clock in it you know the one which
keeps the time when the board is powered

0:02:52.019,0:02:57.239
off has the battery and so on if you buy
the cheapest one from China which is

0:02:57.239,0:03:02.879
basically for Arduino you will buy the
device which is 5 volt device which your

0:03:02.879,0:03:10.170
arm single board computer isn't. you can
modify the board removing two resistors

0:03:10.170,0:03:16.409
if you want to but don't tell anyone I2C, and will mostly talk about i2c

0:03:16.409,0:03:23.819
sensors here, should be 5 volt tolerant
so if you by mistake just connected and

0:03:23.819,0:03:30.569
your data signals are really 5 volt you
won't burn your board but if you are

0:03:30.569,0:03:35.129
supplying your sensor with 5 volts
please double-check that your that is

0:03:35.129,0:03:39.060
sure to connect it to your board and
nothing bad will happen this is the only

0:03:39.060,0:03:44.970
warning I have for the whole lecture in
this example I showed you a really

0:03:44.970,0:03:49.829
simple way in which you can take the
sensors run i2cdetect, detect its

0:03:49.829,0:03:59.370
address in this case it's 68 - and then
- load 1 kernel module and all of the

0:03:59.370,0:04:03.889
sudden your Raspberry Pi will have battery backed clock, just like your laptop does

0:04:03.889,0:04:12.569
but how did this journey all started for
me? about two years ago I was very

0:04:12.569,0:04:18.060
unsatisfied with the choice of pinouts
which you can download from the internet

0:04:18.060,0:04:23.820
I was thinking something along the lines
wouldn't be it wouldn't it be nice if I

0:04:23.820,0:04:27.060
could
print the pinout for any board I have

0:04:27.060,0:04:36.360
with perfect 2.54 millimeters pin
spacing which I can put beside my pins

0:04:36.360,0:04:43.440
and never make a mistake of plugging the
wire in the wrong pin and we all know

0:04:43.440,0:04:48.000
that plugging the wire in the wrong pin
is always the first problem you have on

0:04:48.000,0:04:54.120
the other hand you say oh this is the
great idea and you are looking at your

0:04:54.120,0:04:58.320
pin out which is from the top of the
board and you are plugging the wires

0:04:58.320,0:05:02.160
from the bottom of the board and all of
the sudden your pin out has to be

0:05:02.160,0:05:06.660
flipped but once you write a script
which actually displays the pin out it's

0:05:06.660,0:05:12.950
trivially easy to get to add options to
flip it horizontally or vertically and

0:05:12.950,0:05:18.870
create either black and white pin out if
you are printing it a laser or color pin

0:05:18.870,0:05:26.639
out if you are printing it on some kind
of inkjet so once you have that SVG

0:05:26.639,0:05:31.680
which you can print and cut with the
scissors and so on it's just a script on

0:05:31.680,0:05:38.370
your machine so you could also have the
common line output and then it went all

0:05:38.370,0:05:44.070
south I started adding additional data
which you can see on this slide in

0:05:44.070,0:05:50.250
square brackets with the intention of
having additional data for each pin for

0:05:50.250,0:05:56.250
example if I started SPI I want to see
that this pin is already used so I will

0:05:56.250,0:06:01.830
not by mistake plug something into the
SPI pins if I already have the SPI pin

0:06:01.830,0:06:08.150
started if I have the serial port on
different boards your serial might be

0:06:08.150,0:06:14.880
UART4 on this particular CPU but it's
the only serial in your Linux system so

0:06:14.880,0:06:21.270
it will be /dev/ttyS0 for
example so I wanted to see all the data

0:06:21.270,0:06:27.180
and in the process I actually saw a lot
of things which kernel know and I didn't

0:06:27.180,0:06:33.690
so today talking to you about it of
course in comment line because you might

0:06:33.690,0:06:36.990
rotate your board well plug in the wires
you can also do

0:06:36.990,0:06:45.540
all the flips and things you you already
saw in the in the graphic part so let's

0:06:45.540,0:06:50.190
start with the sensor okay I said cheap
sensor for eBay we'll get the cheap

0:06:50.190,0:06:54.840
sensors from eBay but this sensor is from
some old PowerPC Macintosh. It was

0:06:54.840,0:06:59.580
attached to the disk drive and the
Macintosh used it to measure the

0:06:59.580,0:07:04.890
temperature of the disk drive. you know
that was in the times before the smart

0:07:04.890,0:07:12.060
had a temperature and I said hmm this
is the old sensor, kernel surely

0:07:12.060,0:07:16.800
doesn't have support for it, but, oh look,
just grep through the kernel

0:07:16.800,0:07:21.900
source and indeed there is a driver and
this was a start I said hmm

0:07:21.900,0:07:29.580
driver in kernel, I don't have to use
Arduino for it - now that I know that

0:07:29.580,0:07:35.070
driver is there and I have kernel module compiled, we said that prerequisite

0:07:35.070,0:07:40.950
is that we can compile the kernel, what
do we actually have to program or do to

0:07:40.950,0:07:46.260
make this sensor alive? not more than
this a echo in the middle of the slide

0:07:46.260,0:07:52.200
you just echo the name of the module and
the i2c address the i2c addresses we saw

0:07:52.200,0:07:56.070
it before we can get it with i2cdetect by just connecting the sensor and

0:07:56.070,0:08:02.280
the new device will magically appear it
will be shown in the sensors if you have

0:08:02.280,0:08:06.840
lm-sensors package installed but if
you don't you can always find the same

0:08:06.840,0:08:14.160
data in /sys/ file system which is full
of wonders and as we'll see in non

0:08:14.160,0:08:19.350
formatted way so the first two digits
actually the last three digits digits

0:08:19.350,0:08:26.640
are the decimal numbers and the all the
other are the the integer celsius in

0:08:26.640,0:08:34.470
this case. but you might say - I
don't want to put that echo in my startup

0:08:34.470,0:08:40.380
script! or I would like to have that as
soon as possible I don't want to depend

0:08:40.380,0:08:43.980
on the userland
to actually start my sensor and believe

0:08:43.980,0:08:48.710
it or not because your smart phones have
various sensors in

0:08:48.710,0:08:52.790
them, there is a solution in the Linux kernel
for that and it's called the device tree

0:08:52.790,0:08:58.700
so this is probably the simplest form of
the device tree which still doesn't look

0:08:58.700,0:09:06.020
scary, but it i will, stay with me, and it
again defines our module the address

0:09:06.020,0:09:12.020
which is 49 in this case and i2c 1
interface just like we did in that echo

0:09:12.020,0:09:16.700
but in this case this module will be
activated as soon as kernel starts up

0:09:16.700,0:09:24.590
as opposed to the end of your boot up
process. one additional thing that kernel

0:09:24.590,0:09:31.000
has and many people do not use is
ability to load those device trees

0:09:31.000,0:09:35.750
dynamically the reason why those most
people don't use it is because they are

0:09:35.750,0:09:41.270
on to old kernels I think you have to
have something along the lines of 4.8

0:09:41.270,0:09:47.510
4.8 or newer to actually have the
ability to load the device trees live

0:09:47.510,0:09:54.470
basically you are you are using /sys/kernel/config directory and this script

0:09:54.470,0:10:00.620
just finds where you have it mounted and
loads your device tree live word of

0:10:00.620,0:10:09.200
warning currently although it seems like
you can do that on Raspberry Pi the API

0:10:09.200,0:10:14.270
is there the model is compiled,
everything is nice and Diddley, kernel

0:10:14.270,0:10:18.350
even says that device tree overlay is
applied, it doesn't work on the raspberry

0:10:18.350,0:10:24.950
pi because raspberry pi is different but
if you gave a any other platform live

0:10:24.950,0:10:31.670
loading is actually quite nice and
diddley. so now we have some sensor and it

0:10:31.670,0:10:37.310
works or it doesn't
and we somewhat suspect that kernel

0:10:37.310,0:10:43.040
developers didn't write a good driver
which is never ever the case if you

0:10:43.040,0:10:48.260
really want to implement some driver
please look first at the kernel source

0:10:48.260,0:10:52.220
tree there probably is the
implementation better than the one you

0:10:52.220,0:10:56.930
will write and you can use because the
kernel is GPL you can use that

0:10:56.930,0:11:00.970
implementation as a reference because in
my

0:11:00.970,0:11:05.890
small experience with those drivers in
kernel they are really really nice but

0:11:05.890,0:11:10.960
what do you do well to debug it?
I said no soldering and I didn't say but

0:11:10.960,0:11:15.010
it would be nice if I could do that
without additional hardware. Oh, look

0:11:15.010,0:11:20.890
kernel has ability to debug my i2c
devices and it's actually using tracing.

0:11:20.890,0:11:26.140
the same thing I'm using on my servers
to get performance counters. isn't that

0:11:26.140,0:11:30.340
nice. I don't have to have a logic
analyzer. I can just start tracing and

0:11:30.340,0:11:40.120
have do all the dumps in kernel. nice,
unexpected, but nice! so let's get to the

0:11:40.120,0:11:45.790
first cheap board from China so you
bought your arm single base computer

0:11:45.790,0:11:52.030
single board computer and you want to
add few analog digital converters to it

0:11:52.030,0:11:57.070
because you are used to Arduino and you
have some analog sensor or something and

0:11:57.070,0:12:05.620
you found the cheapest one on eBay and
bought few four five six because they

0:12:05.620,0:12:10.990
are just the $ each, so what do you do
the same thing we saw earlier you just

0:12:10.990,0:12:17.800
compile the models say the address of
the interface and it will appear and

0:12:17.800,0:12:23.770
just like it did in the last example so
everything is nice but but but you read

0:12:23.770,0:12:30.790
the datasheet of that sensor and the
sensor other than 4 analog inputs also

0:12:30.790,0:12:38.860
has 1 analog output which is the top
pin on the left denoted by AOUT, so you

0:12:38.860,0:12:42.850
want to use it
oh this kernel model doesn't is not very

0:12:42.850,0:12:46.900
good it doesn't have ability to control
that of course it does but how do you

0:12:46.900,0:12:50.680
find it?
my suggestion is actually to search

0:12:50.680,0:12:57.190
through the /sys/ for either address of
your i2c sensor, which is this

0:12:57.190,0:13:05.790
case is 48, or for the word output or
input and you will actually get all

0:13:05.790,0:13:12.400
files, because in linux everything is a
file, which are defined in driver of this

0:13:12.400,0:13:16.620
module, and if you
look at it, there is actually out0_output

0:13:16.620,0:13:24.630
out0_output file in which you can
turn output on or off so we are all

0:13:24.630,0:13:29.910
golden. kernel developers didn't forget
to implement part of the driver for this

0:13:29.910,0:13:38.910
sensor all golden my original idea was
to measure current consumptions of arm

0:13:38.910,0:13:44.490
boards because I'm annoyed by the random
problems you can have just because your

0:13:44.490,0:13:49.470
power supply is not powerful enough so
it's nice actually to monitor your power

0:13:49.470,0:13:55.740
usage so you will see what changes, for
example, you surely... we'll get that, remind

0:13:55.740,0:14:01.250
me to tell you how much power does the
 the additional button take

0:14:01.250,0:14:05.130
that's actually interesting thing which
you wouldn't know if you don't measure

0:14:05.130,0:14:10.950
current so you buy the cheapest possible
eBay sensor for current, the right one

0:14:10.950,0:14:16.560
is the ina219 which is
bi-directional current sensing so you

0:14:16.560,0:14:21.690
can put it between your battery and solar panel and you will see

0:14:21.690,0:14:26.160
whether the battery is charging or
discharging, or if you need more channels

0:14:26.160,0:14:34.020
I like an ina3221 which has 3 channels,
the same voltage

0:14:34.020,0:14:40.500
but 3 different channels, so you can
power 3 arm single computers from one

0:14:40.500,0:14:47.670
sensor if you want to. and of course once
you have that again the current is in

0:14:47.670,0:14:53.260
some file and it will be someting...

0:14:53.260,0:14:56.490
But, I promised you IOT? right? nothing

0:14:56.490,0:14:59.070
I said so far is IOT! where is the
Internet?

0:14:59.070,0:15:05.100
where are the things? buzzwords are missing! OK, challenge

0:15:05.100,0:15:08.550
accepted! Let's make a button! you know it's like a

0:15:08.550,0:15:15.029
blink LED. So buttons, because I was
not allowed to use soldering iron in

0:15:15.029,0:15:21.990
this talk, I'm using old buttons from old
scanner. nothing special 3 buttons, in

0:15:21.990,0:15:25.350
this case with hardware debounce, but we
don't care.

0:15:25.350,0:15:29.270
4 wires 3 buttons.
how hard can it be?

0:15:29.270,0:15:36.240
well basically it can be really really
simple  this is the smallest

0:15:36.240,0:15:42.638
font so if you see how to read this I
congratulate you! in this case I am

0:15:44.580,0:15:51.360
specifying that I want software pull up, in this first fragment on the top.

0:15:51.360,0:15:57.840
I could have put some
resistors, but you said no soldering

0:15:57.840,0:16:03.540
so here I am telling to my
processor. please do pull up on

0:16:03.540,0:16:09.540
those pins. and then I'm defining three
keys. as you can see email. connect and

0:16:09.540,0:16:15.660
print. which generate real Linux
keyboard events. so if you are in X and

0:16:15.660,0:16:20.730
press that key, it will generate that key,
I thought it would it would be better to

0:16:20.730,0:16:26.400
generate you know the magic multimedia
key bindings as opposed to A, B and C

0:16:26.400,0:16:31.940
because if I generated a ABC and was its
console I would actually generate

0:16:31.940,0:16:39.140
letters on a login prompt which I didn't
want so actually did it and it's quite

0:16:39.140,0:16:47.310
quite easy. In this case I'm using gpio-keys-polled which means that my CPU

0:16:47.310,0:16:52.500
is actually pulling every 100
milliseconds those keys to see whether

0:16:52.500,0:16:57.150
they their status changed and since the
board is actually connected through the

0:16:57.150,0:17:01.890
current sensing - sensor I mentioned earlier I'm

0:17:01.890,0:17:11.209
getting additional: how many mA?
every 100 milliseconds, pulling 3 keys?

0:17:13.010,0:17:19.350
60! I wouldn't expect my power
consumption to rise by 60 milliamps

0:17:19.350,0:17:24.480
because I am pulling 3 keys every 100
milliseconds! but it did and because I

0:17:24.480,0:17:32.430
could add sensors to the linux without
programming drivers, I know that! why am I

0:17:32.430,0:17:40.450
using polling because on allwinner
all pins are not interrupt capable so in

0:17:40.450,0:17:44.520
the sense all pins cannot generate
interrupts on allwinner

0:17:44.520,0:17:48.940
raspberry pi in this case is different
on raspberry pi every pin can be

0:17:48.940,0:17:54.279
interrupt pin on Allwinner that is not
the case. so the next logical question is

0:17:54.279,0:17:58.510
how do I know when I'm sitting in front
of my board whether the pin can get the

0:17:58.510,0:18:05.440
interrupt or not? my suggestion is ask
the kernel. just grap through the debug

0:18:05.440,0:18:10.720
interface of the kernel through pinctrl
which is basically the the thing

0:18:10.720,0:18:19.570
which configures the pins on your arm
CPU and try to find the irq

0:18:19.570,0:18:25.840
will surely get the list of the pins
which are which are irq capable take in

0:18:25.840,0:18:30.370
mind that this will be different on
different arm architectures so

0:18:30.370,0:18:34.419
unfortunately on allwinner
it will always look the same because it

0:18:34.419,0:18:41.020
is allwinner architecture. actually
sunxi ! but on the Raspberry Pi for

0:18:41.020,0:18:45.880
example this will be somewhat different
but the kernel knows, and the grep is

0:18:45.880,0:18:51.490
your friend. so you wrote the device
three you load it either live or some

0:18:51.490,0:18:57.279
something on some other way you connect
your buttons and now let's try does it really

0:18:57.279,0:19:03.580
work? of course it does! we will start
evtest which will show us all the

0:19:03.580,0:19:08.350
input devices we have the new one is the
gpio-3-buttons, which is the same name

0:19:08.350,0:19:14.559
as our device three overlay and we can see
 the same things we saw in

0:19:14.559,0:19:20.230
device three we defined three keys with
this event but we free-of-charge

0:19:20.230,0:19:25.990
got for example keyboard repeat because
this is actually meant to be used for

0:19:25.990,0:19:31.630
keyboards our kernel is automatically
implementing repeat key we can turn it

0:19:31.630,0:19:35.919
off but this is example of one of the
features which you probably wouldn't

0:19:35.919,0:19:43.330
implement yourself if you are connecting
those three keys to your Arduino but but

0:19:43.330,0:19:46.120
but this is still not the
internet-of-things

0:19:46.120,0:19:49.789
if this is the Internet it should have
some kind of

0:19:49.789,0:19:56.299
Internet in it some buzzwords for
example mqtt and it really can just

0:19:56.299,0:20:01.759
install trigger-happy demon which is
nice deamon which listens to

0:20:01.759,0:20:06.830
input events and write a free file
configuration which will send the each

0:20:06.830,0:20:15.139
key pressed order MQTT and job done i
did the internet button without a line

0:20:15.139,0:20:23.419
of code the configuration one side note
here if you are designing some some

0:20:23.419,0:20:30.919
Internet of Things thingy which even if
you are only one who will use it it's a

0:20:30.919,0:20:33.889
good idea but if you are doing it for
somebody else

0:20:33.889,0:20:41.119
please don't depend on the cloud because
I wouldn't like for my door to be locked

0:20:41.119,0:20:45.590
permanently with me outside just because
my internet connection isn't working

0:20:45.590,0:20:52.999
think about it of course you can use any
buttons in this case this was the first

0:20:52.999,0:20:57.070
try actually like the three buttons
better than this one that's why this

0:20:57.070,0:21:02.419
these buttons are coming second and this
board with the buttons has one

0:21:02.419,0:21:08.840
additional nice thing and that is the
LED we said that will cover buttons and

0:21:08.840,0:21:15.379
LEDs right unfortunately this LED is 5
volts so it won't light up on 3.3 volts

0:21:15.379,0:21:24.139
but when you mentioned LEDs something
came to mind how can I use those LEDs

0:21:24.139,0:21:29.029
for something more useful than just
blinking them on or off we'll see you

0:21:29.029,0:21:34.039
later then turning them on or off it is
also useful you probably didn't know

0:21:34.039,0:21:40.580
that you can use Linux triggers to
actually display status of your MMC card

0:21:40.580,0:21:47.720
CPU load network traffic or something
else on the LEDs itself either the LEDs

0:21:47.720,0:21:51.859
which you already have on the board but
if your manufacturer didn't provide

0:21:51.859,0:21:56.679
enough of them you can always just add
random LEDs, write device tree and

0:21:56.679,0:22:01.559
define the trigger for them, and this is
an example of that

0:22:01.559,0:22:08.219
and this example is actually for this
board which is from the ThinkPad

0:22:08.219,0:22:14.019
ThinkPad dock to be exact, which
unfortunately isn't at all visible

0:22:14.019,0:22:20.169
on this picture, but you will believe me,
has actually 2 LEDs and these 3

0:22:20.169,0:22:27.489
keys and 2 LEDs actually made the arm
board which doesn't have any buttons on

0:22:27.489,0:22:36.609
it or status LEDs somewhat flashy with
buttons. that's always useful on the

0:22:36.609,0:22:41.889
other hand here I would just want to
share a few hints with you for a start

0:22:41.889,0:22:47.320
first numerate your pins because if you
compared the the picture down there

0:22:47.320,0:22:54.579
which has seven wires and are numerated
which is the second try be the first

0:22:54.579,0:23:00.579
nodes on the up you will see that in
this case i thought that there was eight

0:23:00.579,0:23:06.999
wires so the deducing what is connected
where when you have the wrong number of

0:23:06.999,0:23:14.229
wires is maybe not the good first step
on the other hand we saw the keys what

0:23:14.229,0:23:21.639
about rotary encoders? for years I was
trying to somehow persuade Raspberry Pi

0:23:21.639,0:23:28.149
1 as the lowest common denominator of
all arm boards you know cheap slow and

0:23:28.149,0:23:33.789
so on to actually work with this exact
rotary encoder the cheapest one from the

0:23:33.789,0:23:41.589
Aliexpress of course see the pattern
I tried Python I try the attaching

0:23:41.589,0:23:48.579
interrupt into Python I tried C code and
nothing worked at least didn't work

0:23:48.579,0:23:56.859
worked reliably and if you just write
the small device tree say the correct

0:23:56.859,0:24:01.809
number of steps you have at your rotary
encoder because by default it's 24 but

0:24:01.809,0:24:08.589
this particular one is 20 you will get
perfect input device for your Linux with

0:24:08.589,0:24:11.579
just a few wires

0:24:12.390,0:24:20.260
amazing so we saw the buttons we saw the
LEDs we have everything for IOT except

0:24:20.260,0:24:25.840
the relay so you saw on one of the
previous pictures this relay box it's

0:24:25.840,0:24:31.980
basically four relays separated by
optocouplers which is nice and my

0:24:31.980,0:24:39.670
suggestion since you can't in device
three you can't say this pin will be

0:24:39.670,0:24:45.790
output but I want to initially drive it
high or I want to initially drive it low

0:24:45.790,0:24:52.330
it seems like you can say that it's
documented in documentation it's just

0:24:52.330,0:24:56.440
not implemented there on every arm
architecture so you can write it in

0:24:56.440,0:25:02.440
device three but your device tree will
ignore it. you but you can and this might be

0:25:02.440,0:25:07.240
somewhat important because for example
this relay is actually powering all your

0:25:07.240,0:25:11.220
other boards and you don't want to
reboot them just because you reboot the

0:25:11.220,0:25:16.270
machine which is actually driving the
relay so you want to control that pin as

0:25:16.270,0:25:24.310
soon as possible so my suggestion is
actually to explain to Linux kernel that

0:25:24.310,0:25:30.310
this relays is actually 4 LEDs which is
somewhat true because the relay has the

0:25:30.310,0:25:36.460
LEDs on it and then use LEDs which do
have the default state which works to

0:25:36.460,0:25:41.410
actually drive it as soon as possible as
the kernel boot because kernel will boot

0:25:41.410,0:25:45.640
it will change the state of those pins
from input to output and set them

0:25:45.640,0:25:52.000
immediately to correct value so you
hopefully want want power cycle your

0:25:52.000,0:25:56.410
other boards, and then you can use the
LEDs as you would normally use them in

0:25:56.410,0:26:01.420
any other way
if LEDs are interesting to you have in

0:26:01.420,0:26:06.340
mind that on your on each of your
computers you have at least two LEDs but

0:26:06.340,0:26:10.810
this caps lock and one is non lock on
your keyboard and you can use those same

0:26:10.810,0:26:15.190
triggers I mentioned earlier on your
existing Linux machine using those

0:26:15.190,0:26:20.980
triggers so for example your caps lock
LED can blink as your network traffic

0:26:20.980,0:26:29.380
does something on your network really
it's fun on the other hand if you have a

0:26:29.380,0:26:36.370
Raspberry Pi and you defined everything
correctly you might hit into some kind

0:26:36.370,0:26:42.370
of problems that particular chip has
default pull ups which you can't turn on

0:26:42.370,0:26:49.059
for some pins which are actually
designed to be clocks of this kind or

0:26:49.059,0:26:54.220
another so even if you are not using
that pin as the SPI clock whatever you

0:26:54.220,0:26:59.110
do in your device tree you won't be able to
turn off, actually you will turn

0:26:59.110,0:27:04.240
off the the setting in the chip to for
the pull up but the pull up will be

0:27:04.240,0:27:08.140
still there actually thought that there
is a hardware resistor on board but

0:27:08.140,0:27:14.980
there isn't it's inside the chip just
word of warning so if anything I would

0:27:14.980,0:27:21.309
like to push you towards using Linux
kernel for the sensors which you might

0:27:21.309,0:27:25.570
not think of as the first choice if you
just want to add some kind of simple

0:27:25.570,0:27:32.080
sensor to to your Linux instead of
Arduino over serial port which I did and

0:27:32.080,0:27:38.049
this is the solution which might with
much less moving parts or wiring pie and

0:27:38.049,0:27:43.090
in the end once you make your own shield
for us but if I you will have to write

0:27:43.090,0:27:49.480
that device tree into the EEPROM anyway so
it's good to start learning now so I

0:27:49.480,0:27:53.890
hope that this was at least useful very
interesting and if you have any

0:27:53.890,0:28:02.140
additional questions I will be glad to
to answer them and if you want to see

0:28:02.140,0:28:07.780
one of those all winner board which can
be used with my software to show the pin

0:28:07.780,0:28:12.460
out here is one board which kost
actually borrowed me yesterday and in which

0:28:12.460,0:28:18.549
yesterday evening I actually ported the
my software which is basically just

0:28:18.549,0:28:22.330
writing the definition of those pins
over here and the pins on the header

0:28:22.330,0:28:26.950
which I basically copy pasted from the
excel sheet just to show that you can

0:28:26.950,0:28:32.830
actually do that for any board you have
with just really pin out in textual file

0:28:32.830,0:28:36.370
it's really that simple
here are some additional

0:28:36.370,0:28:38.300
links and do you have any questions?

0:28:39.420,0:28:41.420
[one?]