-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcamp2023-57012-eng-Building_a_cloud-free_digital_voice_assistant_with_FOSS_opus.srt
1720 lines (1290 loc) · 43.1 KB
/
camp2023-57012-eng-Building_a_cloud-free_digital_voice_assistant_with_FOSS_opus.srt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1
00:00:00,000 --> 00:00:10,000
[MUSIC]
2
00:00:10,000 --> 00:00:38,000
Welcome back on the Nordic Stage for the next talk.
3
00:00:38,000 --> 00:00:40,000
This talk will be in English.
4
00:00:40,000 --> 00:00:47,000
Unfortunately, there will be no translations, but you will be able to follow, I guess, if you came here.
5
00:00:47,000 --> 00:00:50,000
I hope you have all nice places.
6
00:00:50,000 --> 00:01:01,000
And I welcome Jürgen Papel, who will talk about building a cloud-free digital voice assistant with free and open source software.
7
00:01:01,000 --> 00:01:09,000
Please give him a warm welcome and enjoy the talk.
8
00:01:09,000 --> 00:01:11,000
Thank you.
9
00:01:11,000 --> 00:01:15,000
Okay, so first slide, I guess, is always about who's talking up there.
10
00:01:15,000 --> 00:01:18,000
I'm from Cologne, Cologne.
11
00:01:18,000 --> 00:01:29,000
I work in security management, and I build stuff mostly for my kids, and I break stuff, whatever needs to be broken.
12
00:01:29,000 --> 00:01:37,000
So first we're going to talk about what our voice assistants actually composed of.
13
00:01:37,000 --> 00:01:41,000
Then we're going to do a demo.
14
00:01:41,000 --> 00:01:55,000
You are probably not going to be able to see what's happening on the display, but we'll get audio, so you'll be able to hear what the hell has to say.
15
00:01:55,000 --> 00:02:13,000
Then I'm going to talk about what is it that actually comprises this voice assistant, and then there's what's left to do for release 1.0, and what's on the agenda for beyond that.
16
00:02:13,000 --> 00:02:17,000
And at the end, there will be a Q&A.
17
00:02:17,000 --> 00:02:26,000
So when you're talking about voice assistants, there's really five components that make up the core logic.
18
00:02:26,000 --> 00:02:28,000
There's the wake word detector.
19
00:02:28,000 --> 00:02:35,000
And you presumably know this because it's, okay, Google, Alexa, Siri, whatever.
20
00:02:35,000 --> 00:02:37,000
That's the wake word detector.
21
00:02:37,000 --> 00:02:48,000
Because you don't want whatever voices you have to always just try to make sense of what's being spoken and interpret that as commands.
22
00:02:48,000 --> 00:02:52,000
So the wake word detector activates the assistant.
23
00:02:52,000 --> 00:03:00,000
Then there's speech to text, so it's recording whatever someone has to say, translates that into text.
24
00:03:00,000 --> 00:03:07,000
And the next part is the intent parser, so trying to make sense of what's being said.
25
00:03:07,000 --> 00:03:12,000
Skills, that's the execution of whatever the person requested.
26
00:03:12,000 --> 00:03:15,000
And then text to speech for the feedback.
27
00:03:15,000 --> 00:03:18,000
So that didn't work or whatever.
28
00:03:18,000 --> 00:03:22,000
So let's look at each of these just briefly.
29
00:03:22,000 --> 00:03:26,000
The wake word detector is a presumably easy task.
30
00:03:26,000 --> 00:03:31,000
You can do sort of like pattern matching on the acoustic signal, et cetera.
31
00:03:31,000 --> 00:03:43,000
But the issue here is that you want a really, really high or a very, very low false positive rate.
32
00:03:43,000 --> 00:03:50,000
Because otherwise the assistant will be going like, oh, yeah, what do you want from me every couple minutes?
33
00:03:50,000 --> 00:03:52,000
And that's very annoying.
34
00:03:52,000 --> 00:03:58,000
And of course the environment is, you know, as it is.
35
00:03:58,000 --> 00:04:00,000
We don't know.
36
00:04:00,000 --> 00:04:04,000
And I don't know how it will behave on here.
37
00:04:04,000 --> 00:04:06,000
I haven't tested it, so we'll see.
38
00:04:06,000 --> 00:04:15,000
And of course everybody has a different voice, so that task isn't really that easy.
39
00:04:15,000 --> 00:04:20,000
So as far as free open source implementation, there's Microsoft Precise.
40
00:04:20,000 --> 00:04:26,000
And the true and tried Parkinson's.
41
00:04:26,000 --> 00:04:27,000
And there's others.
42
00:04:27,000 --> 00:04:31,000
You know, I'm not trying to list everything here.
43
00:04:31,000 --> 00:04:40,000
And the selections is really more or less what I played with in my project.
44
00:04:40,000 --> 00:04:44,000
So the next part is the speech to text.
45
00:04:44,000 --> 00:04:47,000
So there's really two parts.
46
00:04:47,000 --> 00:04:54,000
There's the software that actually tries to make sense of whatever the audio signal is.
47
00:04:54,000 --> 00:04:57,000
And then there's the language model.
48
00:04:57,000 --> 00:04:59,000
You need a different language model for each language.
49
00:04:59,000 --> 00:05:09,000
And essentially the language model contains the words that are known to be able to be translated.
50
00:05:09,000 --> 00:05:15,000
So the critical parameter here, just like with the weight word detector, the false positive rate here,
51
00:05:15,000 --> 00:05:17,000
it's the word error rate.
52
00:05:17,000 --> 00:05:20,000
We'll get back to that later on.
53
00:05:20,000 --> 00:05:25,000
And again, two open source implementations, Mozilla Deep Speech, somewhat recent,
54
00:05:25,000 --> 00:05:34,000
and Kali that is really fairly old by today's means, but still a good system.
55
00:05:34,000 --> 00:05:37,000
So the next is the intent parser.
56
00:05:37,000 --> 00:05:47,000
So independent of whether I tell them turn yourself off, execute system shutdown, or go to run level zero,
57
00:05:47,000 --> 00:05:49,000
the intent is the same.
58
00:05:49,000 --> 00:05:54,000
So intent parser derived the meaning from what's being said.
59
00:05:54,000 --> 00:06:04,000
So in this case, it would map to the skill system shutdown with a default parameter now because I didn't tell him otherwise.
60
00:06:04,000 --> 00:06:08,000
Onto the skills.
61
00:06:08,000 --> 00:06:13,000
And that's really completely implementation specific.
62
00:06:13,000 --> 00:06:18,000
There are some that have already a lot of skills included.
63
00:06:18,000 --> 00:06:21,000
Some come at a bare minimum.
64
00:06:21,000 --> 00:06:29,000
And there's pretty much always some API or SDK that you have to implement additional skills.
65
00:06:29,000 --> 00:06:38,000
So text to speech, again, language model, training data.
66
00:06:38,000 --> 00:06:46,000
So of course, the function is to give the user feedback on what has happened.
67
00:06:46,000 --> 00:06:58,000
And two of the rather older ones, the F-Lite and Mary TTS, and very recent, I think last year, was MyCroftMimic 3.
68
00:06:58,000 --> 00:07:08,000
So with that in mind, we'll do the demo.
69
00:07:08,000 --> 00:07:11,000
I'm going to just leave this right here.
70
00:07:11,000 --> 00:07:13,000
I have a USB cable.
71
00:07:13,000 --> 00:07:14,000
That's just power.
72
00:07:14,000 --> 00:07:17,000
So I'm plugging it in right now.
73
00:07:17,000 --> 00:07:23,000
And it'll take a while.
74
00:07:23,000 --> 00:07:25,000
What's coming now?
75
00:07:25,000 --> 00:07:26,000
Oh, yeah.
76
00:07:26,000 --> 00:07:31,000
Disclaimer, I have taken some audio from the movie.
77
00:07:31,000 --> 00:07:33,000
So that's being used here.
78
00:07:33,000 --> 00:07:37,000
That's not part of the project because obviously you can't distribute that.
79
00:07:37,000 --> 00:07:43,000
According to German law, what I do is legal.
80
00:07:43,000 --> 00:07:48,000
So it's booting up for the Linux system boot up.
81
00:07:48,000 --> 00:07:50,000
It's roughly 30 seconds.
82
00:07:50,000 --> 00:07:55,000
And in the time in between, it's showing some animations.
83
00:07:55,000 --> 00:08:00,000
I have the animation on the slide right now.
84
00:08:00,000 --> 00:08:16,000
And what I did is essentially just rip artwork from two different projects and constructed something that would sort of make sense for the boot up phase.
85
00:08:16,000 --> 00:08:26,000
And once it booted up, there'll be the red eye popping up and I should say that I'm fully functional.
86
00:08:26,000 --> 00:08:29,000
And I haven't heard him.
87
00:08:29,000 --> 00:08:36,000
But we can, I guess, switch over to the hell now.
88
00:08:36,000 --> 00:08:39,000
Let me just take a look.
89
00:08:39,000 --> 00:08:40,000
It seems to be-- yep.
90
00:08:40,000 --> 00:08:41,000
It seems so.
91
00:08:41,000 --> 00:08:44,000
Two buttons or rotary encoders on top.
92
00:08:44,000 --> 00:08:50,000
For the volume and turning volume up.
93
00:08:50,000 --> 00:08:51,000
I don't think anybody can see it.
94
00:08:51,000 --> 00:08:57,000
There's like a volume indicator just like a tachometer on the car.
95
00:08:57,000 --> 00:09:05,000
So the wake word is OK hell.
96
00:09:05,000 --> 00:09:06,000
That didn't seem to work.
97
00:09:06,000 --> 00:09:15,000
Let me come around.
98
00:09:15,000 --> 00:09:19,000
OK hell.
99
00:09:19,000 --> 00:09:21,000
OK hell.
100
00:09:21,000 --> 00:09:27,000
OK demos are demos.
101
00:09:27,000 --> 00:09:32,000
So I can trigger this manually.
102
00:09:32,000 --> 00:09:35,000
Probably easier from down there.
103
00:09:35,000 --> 00:09:38,000
One button is the volume control.
104
00:09:38,000 --> 00:09:42,000
And the other button is an onscreen menu.
105
00:09:42,000 --> 00:09:44,000
And I have a menu voice command.
106
00:09:44,000 --> 00:09:49,000
When I push the button, the wake word detector triggered.
107
00:09:49,000 --> 00:09:56,000
So what it's doing now is actually loading the language model right now.
108
00:09:56,000 --> 00:10:01,000
So the first request is like a 10 second delay.
109
00:10:01,000 --> 00:10:03,000
And I want to move that into the boot up phase.
110
00:10:03,000 --> 00:10:08,000
So it doesn't have to be on the first spoken request.
111
00:10:08,000 --> 00:10:11,000
Hello Dave.
112
00:10:11,000 --> 00:10:12,000
Hello Dave.
113
00:10:12,000 --> 00:10:13,000
OK.
114
00:10:13,000 --> 00:10:18,000
Now it should work right away.
115
00:10:18,000 --> 00:10:22,000
So let's try that again.
116
00:10:22,000 --> 00:10:26,000
What date is it?
117
00:10:26,000 --> 00:10:34,000
It's processing now and rendering the speech output and maybe it will work.
118
00:10:34,000 --> 00:10:36,000
I'm sorry Dave.
119
00:10:36,000 --> 00:10:45,000
I'm afraid I can't do that.
120
00:10:45,000 --> 00:10:49,000
I guess it's still a good demo right?
121
00:10:49,000 --> 00:10:58,000
So I can power this down from telling me to turn yourself off etc.
122
00:10:58,000 --> 00:11:06,000
What happens then is it shuts down the system, shows the animation.
123
00:11:06,000 --> 00:11:10,000
And you probably can't see it right here but it will be in the recording.
124
00:11:10,000 --> 00:11:14,000
So it's the live animations, the live lines that go flat.
125
00:11:14,000 --> 00:11:19,000
And once it's gone flat, it's dead.
126
00:11:19,000 --> 00:11:23,000
So now I'll plug it off.
127
00:11:23,000 --> 00:11:28,000
But I actually have one more demo to show.
128
00:11:28,000 --> 00:11:31,000
So I'm going to plug it back in.
129
00:11:31,000 --> 00:11:38,000
And that's the part, well how do you configure that thing?
130
00:11:38,000 --> 00:11:45,000
So it has a web interface actually that I'm going to connect to in a second.
131
00:11:45,000 --> 00:11:49,000
And what I can do there is essentially configure the whole thing.
132
00:11:49,000 --> 00:11:57,000
I can configure commands that it should listen to, what actions to take etc.
133
00:11:57,000 --> 00:12:12,000
So we'll see whether or not that will work in a minute.
134
00:12:12,000 --> 00:12:18,000
Okay, let's boot it.
135
00:12:18,000 --> 00:12:27,000
So maybe you can see right here, just barely.
136
00:12:27,000 --> 00:12:31,000
Of course it has to be in the style of the movie.
137
00:12:31,000 --> 00:12:36,000
And so the first button is orders.
138
00:12:36,000 --> 00:12:42,000
So we did try what date is today.
139
00:12:42,000 --> 00:12:44,000
So that's this order.
140
00:12:44,000 --> 00:12:47,000
So it listens to the prompts.
141
00:12:47,000 --> 00:12:51,000
What is the date? What is today's date? What is today's date?
142
00:12:51,000 --> 00:13:01,000
And why that is exactly the way it is right there is something we'll talk about later on.
143
00:13:01,000 --> 00:13:08,000
So let's leave it at that for the demo.
144
00:13:08,000 --> 00:13:14,000
And get back to the slides.
145
00:13:14,000 --> 00:13:18,000
Oh, there it is.
146
00:13:18,000 --> 00:13:28,000
So what are the key takeaways from the demo, except for the demo gods weren't that good to me.
147
00:13:28,000 --> 00:13:30,000
There is the speech interface.
148
00:13:30,000 --> 00:13:35,000
Of course that's the main purpose of the voice assistant.
149
00:13:35,000 --> 00:13:45,000
But there's the physical interface, turning the knobs, getting feedback on the display, anything.
150
00:13:45,000 --> 00:13:50,000
And there's also a lot of little things that need attention.
151
00:13:50,000 --> 00:13:53,000
So the eye candy, these boot animations.
152
00:13:53,000 --> 00:13:57,000
Other people did the work, I just cut everything together.
153
00:13:57,000 --> 00:14:00,000
But that needs to be done.
154
00:14:00,000 --> 00:14:12,000
It is actually something where you know what is the device's date, so you can expect what is it going to do when you interact with it.
155
00:14:12,000 --> 00:14:19,000
The configuration and of course error handling and many, many other things.
156
00:14:19,000 --> 00:14:23,000
Why am I listing these? Because that's the core of my project.
157
00:14:23,000 --> 00:14:33,000
The actual voice part, so wake word detector, text to speech, intent parsing, etc.
158
00:14:33,000 --> 00:14:40,000
Is something that I'm using other software for.
159
00:14:40,000 --> 00:14:45,000
But as always, you fiddle with it and then you adapt it a little bit.
160
00:14:45,000 --> 00:14:51,000
So that part is also a little bit of part of my product.
161
00:14:51,000 --> 00:14:57,000
So what is essentially the idea, the goal?
162
00:14:57,000 --> 00:15:01,000
I want a voice assistant that is actually usable.
163
00:15:01,000 --> 00:15:12,000
So response times, boot up time, processing of commands is important so the user doesn't get bored while waiting for the response.
164
00:15:12,000 --> 00:15:17,000
Error rates, you want it to just work.
165
00:15:17,000 --> 00:15:23,000
And also important, everything should be done on the device.
166
00:15:23,000 --> 00:15:29,000
No connectivity required except for maybe skill executions.
167
00:15:29,000 --> 00:15:35,000
Then of course, or at least in this setting, it's open source.
168
00:15:35,000 --> 00:15:40,000
And it should be as easy as possible to build.
169
00:15:40,000 --> 00:15:52,000
And there's a couple of things like 3D printed enclosures. They were designed so that the print models are as easy to print as possible.
170
00:15:52,000 --> 00:15:55,000
So in the entire model, there's just one overhang.
171
00:15:55,000 --> 00:15:57,000
Well, actually, no, the second one is in there.
172
00:15:57,000 --> 00:16:06,000
But I essentially tried to make it as easy to build as possible.
173
00:16:06,000 --> 00:16:12,000
And also use components that are rather readily available.
174
00:16:12,000 --> 00:16:18,000
And yes, pies are hard to get nowadays, but the situations get better.
175
00:16:18,000 --> 00:16:24,000
So we hope that they become available again.
176
00:16:24,000 --> 00:16:27,000
Especially not a project goal was the price.
177
00:16:27,000 --> 00:16:35,000
So the components in here run up to roughly 120 to 200 euro, depending on what you put in there.
178
00:16:35,000 --> 00:16:38,000
So I put also an ID card reader in there.
179
00:16:38,000 --> 00:16:41,000
You know, you don't need it.
180
00:16:41,000 --> 00:16:44,000
Then you don't need that.
181
00:16:44,000 --> 00:16:51,000
So what's in there?
182
00:16:51,000 --> 00:16:54,000
We have the pie zero two.
183
00:16:54,000 --> 00:16:57,000
And that's where the Linux system is running on.
184
00:16:57,000 --> 00:17:02,000
And that's the greenish thing up here.
185
00:17:02,000 --> 00:17:07,000
Below it is the display with a microcontroller.
186
00:17:07,000 --> 00:17:12,000
And below that is essentially a sound board.
187
00:17:12,000 --> 00:17:17,000
It has two microphones and a speaker connector.
188
00:17:17,000 --> 00:17:23,000
And then we have a GPIO extender.
189
00:17:23,000 --> 00:17:26,000
So more pins to connect to.
190
00:17:26,000 --> 00:17:35,000
And in my part of the project, I have a requirement for RFID card because my kids have RFID cards.
191
00:17:35,000 --> 00:17:42,000
They put in a reader and the Peppa Pig or whatever starts playing.
192
00:17:42,000 --> 00:17:46,000
So I wanted that to be part of this project also.
193
00:17:46,000 --> 00:17:50,000
But that's just the bare components.
194
00:17:50,000 --> 00:17:52,000
How do we need to connect them?
195
00:17:52,000 --> 00:17:59,000
So the first part is we connect the pie zero with the hat.
196
00:17:59,000 --> 00:18:08,000
And that's actually, if you could get the camera right here, that's actually a cable in here.
197
00:18:08,000 --> 00:18:11,000
Is that in the picture?
198
00:18:11,000 --> 00:18:20,000
And it just runs down and connects the hat that's down here behind the wire mesh.
199
00:18:20,000 --> 00:18:23,000
So those are connected now.
200
00:18:23,000 --> 00:18:28,000
Then we have next the connection from the pie zero to the display with the microcontroller.
201
00:18:28,000 --> 00:18:31,000
That's just a regular USB cable.
202
00:18:31,000 --> 00:18:37,000
And that provides power and data channel to the microcontroller.
203
00:18:37,000 --> 00:18:43,000
Then I2C connection from the microcontroller to the GPIO board.
204
00:18:43,000 --> 00:18:55,000
Because maybe you can also just get the idea that these displays with microcontrollers, they don't have too many pinouts.
205
00:18:55,000 --> 00:19:04,000
So then I2C connection from the GPIO extender to my RFID reader.
206
00:19:04,000 --> 00:19:11,000
And then, of course, and I already mentioned this, we have the microphones on the board.
207
00:19:11,000 --> 00:19:13,000
Then we have a speaker.
208
00:19:13,000 --> 00:19:16,000
And then we need power.
209
00:19:16,000 --> 00:19:20,000
And now we're pretty much almost ready to go.
210
00:19:20,000 --> 00:19:25,000
Except we didn't talk about the rotary encoders as the user interface.
211
00:19:25,000 --> 00:19:30,000
So they wire up to the GPIO extender.
212
00:19:30,000 --> 00:19:35,000
And you need five connections per rotary encoder.
213
00:19:35,000 --> 00:19:38,000
It has a push button, so that's ten cables.
214
00:19:38,000 --> 00:19:48,000
And then we have quite a lot of cables in a very constrained area.
215
00:19:48,000 --> 00:19:54,000
So that's getting quite a bit fiddly at times.
216
00:19:54,000 --> 00:19:56,000
But wait, there's more.
217
00:19:56,000 --> 00:19:58,000
There's I2C polling.
218
00:19:58,000 --> 00:20:03,000
I2C is a command response protocol.
219
00:20:03,000 --> 00:20:16,000
So there's no way that a device that has an event, so the rotary controller, when you move it, it changes the state on the pins.
220
00:20:16,000 --> 00:20:20,000
I2C has no way to say, okay, hey, here's something that's happening.
221
00:20:20,000 --> 00:20:24,000
So you need to poll this.
222
00:20:24,000 --> 00:20:31,000
The microcontroller polls the states of the GPIOs every, I think, ten milliseconds.
223
00:20:31,000 --> 00:20:37,000
And when something changes, then it knows, okay, the button has been pushed or whatever.
224
00:20:37,000 --> 00:20:42,000
And obviously that's not such a nice solution.
225
00:20:42,000 --> 00:20:45,000
But what is the alternative?
226
00:20:45,000 --> 00:20:59,000
Well, this GPIO extender from Adafruit has two pins that you can actually use to notify the system that something has happened.
227
00:20:59,000 --> 00:21:01,000
Something has changed.
228
00:21:01,000 --> 00:21:08,000
And you connect that down into the song board.
229
00:21:08,000 --> 00:21:13,000
It has an additional pin out board.
230
00:21:13,000 --> 00:21:15,000
It's a growth port.
231
00:21:15,000 --> 00:21:19,000
And then at least you could detect right there, okay, something has happened.
232
00:21:19,000 --> 00:21:20,000
What has happened?
233
00:21:20,000 --> 00:21:21,000
We don't know.
234
00:21:21,000 --> 00:21:23,000
We need to poll that using I2C.
235
00:21:23,000 --> 00:21:37,000
And then you also connect the RFID card reader with that and have then also a means to get events from the card reader.
236
00:21:37,000 --> 00:21:38,000
I stopped there.
237
00:21:38,000 --> 00:21:39,000
I didn't do this.
238
00:21:39,000 --> 00:21:42,000
Yes, it would be the nicer solution.
239
00:21:42,000 --> 00:22:07,000
But with this small space and that many cables in there already, I was like, okay, no, let's leave it at I2C polling and no outside channel that notifies that there is an event just because of already the amount of stuff in there.
240
00:22:07,000 --> 00:22:34,000
So one thing that we also have to consider is when we were to connect these cables, the notification lines, so to say, that some I2C event would be or some GPIO change has occurred so that big poll.
241
00:22:34,000 --> 00:22:40,000
We need to talk about the voltages because the Raspberry Pi zeros are not five volt tolerant.
242
00:22:40,000 --> 00:22:51,000
So the I2C powering system and I2C is both three three or five volts capable or.
243
00:22:51,000 --> 00:23:01,000
Compliant, so you would have to pick a microcontroller with a display that runs on a three three system for for the I2C.
244
00:23:01,000 --> 00:23:07,000
Otherwise, you fry your pie zero or you need to do a level shifter, which adds even more stuff to that package.
245
00:23:07,000 --> 00:23:17,000
So I left it at that minimal set up, so to say.
246
00:23:17,000 --> 00:23:23,000
OK, this is the current state.
247
00:23:23,000 --> 00:23:27,000
There have been some components that were swapped out.
248
00:23:27,000 --> 00:23:39,000
So before the pie zero two came out, I did have a pie three B in there, which, of course, filled up that that that case even more.
249
00:23:39,000 --> 00:23:43,000
So I was glad that the Python
250
00:23:43,000 --> 00:23:53,410
to Pi 0.2 does have enough power, at least with some overclocking, to bring usable performance.