/
loggable_devices.py
7369 lines (7243 loc) · 275 KB
/
loggable_devices.py
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
# -*- coding: utf-8 -*-
"""
brickv (Brick Viewer)
Copyright (C) 2012, 2014 Roland Dudko <roland.dudko@gmail.com>
Copyright (C) 2012, 2014 Marvin Lutz <marvin.lutz.mail@gmail.com>
Copyright (C) 2017 Ishraq Ibne Ashraf <ishraq@tinkerforge.com>
loggable_devices.py: Util classes for the data logger
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
"""
#### skip here for brick-logger ####
import time
from collections import namedtuple
from queue import Queue, Empty
if 'merged_data_logger_modules' not in globals():
from brickv.data_logger.event_logger import EventLogger
from brickv.data_logger.utils import LoggerTimer, CSVData, \
timestamp_to_de, timestamp_to_us, \
timestamp_to_iso, timestamp_to_unix, \
timestamp_to_de_msec, timestamp_to_us_msec, \
timestamp_to_iso_msec, timestamp_to_unix_msec, \
timestamp_to_strftime
# Bricks
try:
from brickv.bindings.brick_dc import BrickDC
BrickDC_found = True
except ImportError:
BrickDC_found = False
try:
from brickv.bindings.brick_imu import BrickIMU
BrickIMU_found = True
except ImportError:
BrickIMU_found = False
try:
from brickv.bindings.brick_imu_v2 import BrickIMUV2
BrickIMUV2_found = True
except ImportError:
BrickIMUV2_found = False
try:
from brickv.bindings.brick_master import BrickMaster
BrickMaster_found = True
except ImportError:
BrickMaster_found = False
try:
from brickv.bindings.brick_servo import BrickServo
BrickServo_found = True
except ImportError:
BrickServo_found = False
try:
from brickv.bindings.brick_silent_stepper import BrickSilentStepper
BrickSilentStepper_found = True
except ImportError:
BrickSilentStepper_found = False
try:
from brickv.bindings.brick_stepper import BrickStepper
BrickStepper_found = True
except ImportError:
BrickStepper_found = False
try:
from brickv.bindings.brick_hat import BrickHAT
BrickHAT_found = True
except ImportError:
BrickHAT_found = False
try:
from brickv.bindings.brick_hat_zero import BrickHATZero
BrickHATZero_found = True
except ImportError:
BrickHATZero_found = False
# Bricklets
try:
from brickv.bindings.bricklet_accelerometer import BrickletAccelerometer
BrickletAccelerometer_found = True
except ImportError:
BrickletAccelerometer_found = False
try:
from brickv.bindings.bricklet_accelerometer_v2 import BrickletAccelerometerV2
BrickletAccelerometerV2_found = True
except ImportError:
BrickletAccelerometerV2_found = False
try:
from brickv.bindings.bricklet_air_quality import BrickletAirQuality
BrickletAirQuality_found = True
except ImportError:
BrickletAirQuality_found = False
try:
from brickv.bindings.bricklet_ambient_light import BrickletAmbientLight
BrickletAmbientLight_found = True
except ImportError:
BrickletAmbientLight_found = False
try:
from brickv.bindings.bricklet_ambient_light_v2 import BrickletAmbientLightV2
BrickletAmbientLightV2_found = True
except ImportError:
BrickletAmbientLightV2_found = False
try:
from brickv.bindings.bricklet_ambient_light_v3 import BrickletAmbientLightV3
BrickletAmbientLightV3_found = True
except ImportError:
BrickletAmbientLightV3_found = False
try:
from brickv.bindings.bricklet_analog_in import BrickletAnalogIn
BrickletAnalogIn_found = True
except ImportError:
BrickletAnalogIn_found = False
try:
from brickv.bindings.bricklet_analog_in_v2 import BrickletAnalogInV2
BrickletAnalogInV2_found = True
except ImportError:
BrickletAnalogInV2_found = False
try:
from brickv.bindings.bricklet_analog_in_v3 import BrickletAnalogInV3
BrickletAnalogInV3_found = True
except ImportError:
BrickletAnalogInV3_found = False
try:
from brickv.bindings.bricklet_analog_out_v2 import BrickletAnalogOutV2
BrickletAnalogOutV2_found = True
except ImportError:
BrickletAnalogOutV2_found = False
try:
from brickv.bindings.bricklet_analog_out_v3 import BrickletAnalogOutV3
BrickletAnalogOutV3_found = True
except ImportError:
BrickletAnalogOutV3_found = False
try:
from brickv.bindings.bricklet_barometer import BrickletBarometer
BrickletBarometer_found = True
except ImportError:
BrickletBarometer_found = False
try:
from brickv.bindings.bricklet_barometer_v2 import BrickletBarometerV2
BrickletBarometerV2_found = True
except ImportError:
BrickletBarometerV2_found = False
try:
from brickv.bindings.bricklet_can import BrickletCAN #NYI FIXME: has to use frame_read callback to get all data
BrickletCAN_found = True
except ImportError:
BrickletCAN_found = False
try:
from brickv.bindings.bricklet_can_v2 import BrickletCANV2 #NYI FIXME: has to use frame_read callback to get all data
BrickletCANV2_found = True
except ImportError:
BrickletCANV2_found = False
try:
from brickv.bindings.bricklet_co2 import BrickletCO2
BrickletCO2_found = True
except ImportError:
BrickletCO2_found = False
try:
from brickv.bindings.bricklet_co2_v2 import BrickletCO2V2
BrickletCO2V2_found = True
except ImportError:
BrickletCO2V2_found = False
try:
from brickv.bindings.bricklet_color import BrickletColor
BrickletColor_found = True
except ImportError:
BrickletColor_found = False
try:
from brickv.bindings.bricklet_color_v2 import BrickletColorV2
BrickletColorV2_found = True
except ImportError:
BrickletColorV2_found = False
try:
from brickv.bindings.bricklet_compass import BrickletCompass
BrickletCompass_found = True
except ImportError:
BrickletCompass_found = False
try:
from brickv.bindings.bricklet_current12 import BrickletCurrent12
BrickletCurrent12_found = True
except ImportError:
BrickletCurrent12_found = False
try:
from brickv.bindings.bricklet_current25 import BrickletCurrent25
BrickletCurrent25_found = True
except ImportError:
BrickletCurrent25_found = False
try:
from brickv.bindings.bricklet_dc_v2 import BrickletDCV2
BrickletDCV2_found = True
except ImportError:
BrickletDCV2_found = False
try:
from brickv.bindings.bricklet_distance_ir import BrickletDistanceIR
BrickletDistanceIR_found = True
except ImportError:
BrickletDistanceIR_found = False
try:
from brickv.bindings.bricklet_distance_ir_v2 import BrickletDistanceIRV2
BrickletDistanceIRV2_found = True
except ImportError:
BrickletDistanceIRV2_found = False
try:
from brickv.bindings.bricklet_distance_us import BrickletDistanceUS
BrickletDistanceUS_found = True
except ImportError:
BrickletDistanceUS_found = False
try:
from brickv.bindings.bricklet_distance_us_v2 import BrickletDistanceUSV2
BrickletDistanceUSV2_found = True
except ImportError:
BrickletDistanceUSV2_found = False
try:
from brickv.bindings.bricklet_dmx import BrickletDMX
BrickletDMX_found = True
except ImportError:
BrickletDMX_found = False
try:
from brickv.bindings.bricklet_dual_button import BrickletDualButton
BrickletDualButton_found = True
except ImportError:
BrickletDualButton_found = False
try:
from brickv.bindings.bricklet_dual_button_v2 import BrickletDualButtonV2
BrickletDualButtonV2_found = True
except ImportError:
BrickletDualButtonV2_found = False
try:
from brickv.bindings.bricklet_dual_relay import BrickletDualRelay
BrickletDualRelay_found = True
except ImportError:
BrickletDualRelay_found = False
try:
from brickv.bindings.bricklet_dust_detector import BrickletDustDetector
BrickletDustDetector_found = True
except ImportError:
BrickletDustDetector_found = False
try:
from brickv.bindings.bricklet_energy_monitor import BrickletEnergyMonitor
BrickletEnergyMonitor_found = True
except ImportError:
BrickletEnergyMonitor_found = False
try:
from brickv.bindings.bricklet_gps import BrickletGPS
BrickletGPS_found = True
except ImportError:
BrickletGPS_found = False
try:
from brickv.bindings.bricklet_gps_v2 import BrickletGPSV2
BrickletGPSV2_found = True
except ImportError:
BrickletGPSV2_found = False
try:
from brickv.bindings.bricklet_gps_v3 import BrickletGPSV3
BrickletGPSV3_found = True
except ImportError:
BrickletGPSV3_found = False
try:
from brickv.bindings.bricklet_hall_effect import BrickletHallEffect
BrickletHallEffect_found = True
except ImportError:
BrickletHallEffect_found = False
try:
from brickv.bindings.bricklet_hall_effect_v2 import BrickletHallEffectV2
BrickletHallEffectV2_found = True
except ImportError:
BrickletHallEffectV2_found = False
try:
from brickv.bindings.bricklet_humidity import BrickletHumidity
BrickletHumidity_found = True
except ImportError:
BrickletHumidity_found = False
try:
from brickv.bindings.bricklet_humidity_v2 import BrickletHumidityV2
BrickletHumidityV2_found = True
except ImportError:
BrickletHumidityV2_found = False
try:
from brickv.bindings.bricklet_imu_v3 import BrickletIMUV3
BrickletIMUV3_found = True
except ImportError:
BrickletIMUV3_found = False
try:
from brickv.bindings.bricklet_industrial_counter import BrickletIndustrialCounter
BrickletIndustrialCounter_found = True
except ImportError:
BrickletIndustrialCounter_found = False
try:
from brickv.bindings.bricklet_industrial_digital_in_4 import BrickletIndustrialDigitalIn4
BrickletIndustrialDigitalIn4_found = True
except ImportError:
BrickletIndustrialDigitalIn4_found = False
try:
from brickv.bindings.bricklet_industrial_digital_in_4_v2 import BrickletIndustrialDigitalIn4V2
BrickletIndustrialDigitalIn4V2_found = True
except ImportError:
BrickletIndustrialDigitalIn4V2_found = False
try:
from brickv.bindings.bricklet_industrial_dual_0_20ma import BrickletIndustrialDual020mA
BrickletIndustrialDual020mA_found = True
except ImportError:
BrickletIndustrialDual020mA_found = False
try:
from brickv.bindings.bricklet_industrial_dual_0_20ma_v2 import BrickletIndustrialDual020mAV2
BrickletIndustrialDual020mAV2_found = True
except ImportError:
BrickletIndustrialDual020mAV2_found = False
try:
from brickv.bindings.bricklet_industrial_dual_ac_in import BrickletIndustrialDualACIn
BrickletIndustrialDualACIn_found = True
except ImportError:
BrickletIndustrialDualACIn_found = False
try:
from brickv.bindings.bricklet_industrial_dual_ac_relay import BrickletIndustrialDualACRelay
BrickletIndustrialDualACRelay_found = True
except ImportError:
BrickletIndustrialDualACRelay_found = False
try:
from brickv.bindings.bricklet_industrial_dual_analog_in import BrickletIndustrialDualAnalogIn
BrickletIndustrialDualAnalogIn_found = True
except ImportError:
BrickletIndustrialDualAnalogIn_found = False
try:
from brickv.bindings.bricklet_industrial_dual_analog_in_v2 import BrickletIndustrialDualAnalogInV2
BrickletIndustrialDualAnalogInV2_found = True
except ImportError:
BrickletIndustrialDualAnalogInV2_found = False
try:
from brickv.bindings.bricklet_industrial_dual_relay import BrickletIndustrialDualRelay
BrickletIndustrialDualRelay_found = True
except ImportError:
BrickletIndustrialDualRelay_found = False
try:
from brickv.bindings.bricklet_industrial_ptc import BrickletIndustrialPTC
BrickletIndustrialPTC_found = True
except ImportError:
BrickletIndustrialPTC_found = False
try:
from brickv.bindings.bricklet_industrial_quad_relay import BrickletIndustrialQuadRelay
BrickletIndustrialQuadRelay_found = True
except ImportError:
BrickletIndustrialQuadRelay_found = False
try:
from brickv.bindings.bricklet_industrial_quad_relay_v2 import BrickletIndustrialQuadRelayV2
BrickletIndustrialQuadRelayV2_found = True
except ImportError:
BrickletIndustrialQuadRelayV2_found = False
try:
from brickv.bindings.bricklet_io16 import BrickletIO16
BrickletIO16_found = True
except ImportError:
BrickletIO16_found = False
try:
from brickv.bindings.bricklet_io16_v2 import BrickletIO16V2
BrickletIO16V2_found = True
except ImportError:
BrickletIO16V2_found = False
try:
from brickv.bindings.bricklet_io4 import BrickletIO4
BrickletIO4_found = True
except ImportError:
BrickletIO4_found = False
try:
from brickv.bindings.bricklet_io4_v2 import BrickletIO4V2
BrickletIO4V2_found = True
except ImportError:
BrickletIO4V2_found = False
try:
from brickv.bindings.bricklet_joystick import BrickletJoystick
BrickletJoystick_found = True
except ImportError:
BrickletJoystick_found = False
try:
from brickv.bindings.bricklet_joystick_v2 import BrickletJoystickV2
BrickletJoystickV2_found = True
except ImportError:
BrickletJoystickV2_found = False
try:
from brickv.bindings.bricklet_laser_range_finder import BrickletLaserRangeFinder #NYI # config: mode, FIXME: special laser handling
BrickletLaserRangeFinder_found = True
except ImportError:
BrickletLaserRangeFinder_found = False
try:
from brickv.bindings.bricklet_laser_range_finder_v2 import BrickletLaserRangeFinderV2 #NYI # config: mode, FIXME: special laser handling
BrickletLaserRangeFinderV2_found = True
except ImportError:
BrickletLaserRangeFinderV2_found = False
try:
from brickv.bindings.bricklet_led_strip import BrickletLEDStrip
BrickletLEDStrip_found = True
except ImportError:
BrickletLEDStrip_found = False
try:
from brickv.bindings.bricklet_led_strip_v2 import BrickletLEDStripV2
BrickletLEDStripV2_found = True
except ImportError:
BrickletLEDStripV2_found = False
try:
from brickv.bindings.bricklet_line import BrickletLine
BrickletLine_found = True
except ImportError:
BrickletLine_found = False
try:
from brickv.bindings.bricklet_linear_poti import BrickletLinearPoti
BrickletLinearPoti_found = True
except ImportError:
BrickletLinearPoti_found = False
try:
from brickv.bindings.bricklet_linear_poti_v2 import BrickletLinearPotiV2
BrickletLinearPotiV2_found = True
except ImportError:
BrickletLinearPotiV2_found = False
try:
from brickv.bindings.bricklet_load_cell import BrickletLoadCell
BrickletLoadCell_found = True
except ImportError:
BrickletLoadCell_found = False
try:
from brickv.bindings.bricklet_load_cell_v2 import BrickletLoadCellV2
BrickletLoadCellV2_found = True
except ImportError:
BrickletLoadCellV2_found = False
try:
from brickv.bindings.bricklet_moisture import BrickletMoisture
BrickletMoisture_found = True
except ImportError:
BrickletMoisture_found = False
try:
from brickv.bindings.bricklet_motion_detector import BrickletMotionDetector
BrickletMotionDetector_found = True
except ImportError:
BrickletMotionDetector_found = False
try:
from brickv.bindings.bricklet_motion_detector_v2 import BrickletMotionDetectorV2
BrickletMotionDetectorV2_found = True
except ImportError:
BrickletMotionDetectorV2_found = False
try:
from brickv.bindings.bricklet_motorized_linear_poti import BrickletMotorizedLinearPoti
BrickletMotorizedLinearPoti_found = True
except ImportError:
BrickletMotorizedLinearPoti_found = False
try:
from brickv.bindings.bricklet_multi_touch import BrickletMultiTouch
BrickletMultiTouch_found = True
except ImportError:
BrickletMultiTouch_found = False
try:
from brickv.bindings.bricklet_multi_touch_v2 import BrickletMultiTouchV2
BrickletMultiTouchV2_found = True
except ImportError:
BrickletMultiTouchV2_found = False
try:
from brickv.bindings.bricklet_nfc import BrickletNFC
BrickletNFC_found = True
except ImportError:
BrickletNFC_found = False
try:
from brickv.bindings.bricklet_nfc_rfid import BrickletNFCRFID
BrickletNFCRFID_found = True
except ImportError:
BrickletNFCRFID_found = False
try:
from brickv.bindings.bricklet_outdoor_weather import BrickletOutdoorWeather
BrickletOutdoorWeather_found = True
except ImportError:
BrickletOutdoorWeather_found = False
try:
from brickv.bindings.bricklet_particulate_matter import BrickletParticulateMatter
BrickletParticulateMatter_found = True
except ImportError:
BrickletParticulateMatter_found = False
try:
from brickv.bindings.bricklet_performance_dc import BrickletPerformanceDC
BrickletPerformanceDC_found = True
except ImportError:
BrickletPerformanceDC_found = False
try:
from brickv.bindings.bricklet_ptc import BrickletPTC
BrickletPTC_found = True
except ImportError:
BrickletPTC_found = False
try:
from brickv.bindings.bricklet_ptc_v2 import BrickletPTCV2
BrickletPTCV2_found = True
except ImportError:
BrickletPTCV2_found = False
try:
from brickv.bindings.bricklet_real_time_clock import BrickletRealTimeClock
BrickletRealTimeClock_found = True
except ImportError:
BrickletRealTimeClock_found = False
try:
from brickv.bindings.bricklet_real_time_clock_v2 import BrickletRealTimeClockV2
BrickletRealTimeClockV2_found = True
except ImportError:
BrickletRealTimeClockV2_found = False
try:
from brickv.bindings.bricklet_remote_switch import BrickletRemoteSwitch
BrickletRemoteSwitch_found = True
except ImportError:
BrickletRemoteSwitch_found = False
try:
from brickv.bindings.bricklet_remote_switch_v2 import BrickletRemoteSwitchV2
BrickletRemoteSwitchV2_found = True
except ImportError:
BrickletRemoteSwitchV2_found = False
try:
from brickv.bindings.bricklet_rgb_led_button import BrickletRGBLEDButton
BrickletRGBLEDButton_found = True
except ImportError:
BrickletRGBLEDButton_found = False
try:
from brickv.bindings.bricklet_rgb_led_matrix import BrickletRGBLEDMatrix
BrickletRGBLEDMatrix_found = True
except ImportError:
BrickletRGBLEDMatrix_found = False
try:
from brickv.bindings.bricklet_rotary_encoder import BrickletRotaryEncoder
BrickletRotaryEncoder_found = True
except ImportError:
BrickletRotaryEncoder_found = False
try:
from brickv.bindings.bricklet_rotary_encoder_v2 import BrickletRotaryEncoderV2
BrickletRotaryEncoderV2_found = True
except ImportError:
BrickletRotaryEncoderV2_found = False
try:
from brickv.bindings.bricklet_rotary_poti import BrickletRotaryPoti
BrickletRotaryPoti_found = True
except ImportError:
BrickletRotaryPoti_found = False
try:
from brickv.bindings.bricklet_rotary_poti_v2 import BrickletRotaryPotiV2
BrickletRotaryPotiV2_found = True
except ImportError:
BrickletRotaryPotiV2_found = False
#from brickv.bindings.bricklet_rs232 import BrickletRS232 #NYI FIXME: has to use read_callback callback to get all data
try:
from brickv.bindings.bricklet_rs232_v2 import BrickletRS232V2
BrickletRS232V2_found = True
except ImportError:
BrickletRS232V2_found = False
try:
from brickv.bindings.bricklet_rs485 import BrickletRS485
BrickletRS485_found = True
except ImportError:
BrickletRS485_found = False
try:
from brickv.bindings.bricklet_segment_display_4x7 import BrickletSegmentDisplay4x7
BrickletSegmentDisplay4x7_found = True
except ImportError:
BrickletSegmentDisplay4x7_found = False
try:
from brickv.bindings.bricklet_segment_display_4x7_v2 import BrickletSegmentDisplay4x7V2
BrickletSegmentDisplay4x7V2_found = True
except ImportError:
BrickletSegmentDisplay4x7V2_found = False
try:
from brickv.bindings.bricklet_servo_v2 import BrickletServoV2
BrickletServoV2_found = True
except ImportError:
BrickletServoV2_found = False
try:
from brickv.bindings.bricklet_silent_stepper_v2 import BrickletSilentStepperV2
BrickletSilentStepperV2_found = True
except ImportError:
BrickletSilentStepperV2_found = False
try:
from brickv.bindings.bricklet_solid_state_relay import BrickletSolidStateRelay
BrickletSolidStateRelay_found = True
except ImportError:
BrickletSolidStateRelay_found = False
try:
from brickv.bindings.bricklet_solid_state_relay_v2 import BrickletSolidStateRelayV2
BrickletSolidStateRelayV2_found = True
except ImportError:
BrickletSolidStateRelayV2_found = False
try:
from brickv.bindings.bricklet_sound_intensity import BrickletSoundIntensity
BrickletSoundIntensity_found = True
except ImportError:
BrickletSoundIntensity_found = False
try:
from brickv.bindings.bricklet_sound_pressure_level import BrickletSoundPressureLevel
BrickletSoundPressureLevel_found = True
except ImportError:
BrickletSoundPressureLevel_found = False
try:
from brickv.bindings.bricklet_temperature import BrickletTemperature
BrickletTemperature_found = True
except ImportError:
BrickletTemperature_found = False
try:
from brickv.bindings.bricklet_temperature_v2 import BrickletTemperatureV2
BrickletTemperatureV2_found = True
except ImportError:
BrickletTemperatureV2_found = False
try:
from brickv.bindings.bricklet_temperature_ir import BrickletTemperatureIR
BrickletTemperatureIR_found = True
except ImportError:
BrickletTemperatureIR_found = False
try:
from brickv.bindings.bricklet_temperature_ir_v2 import BrickletTemperatureIRV2
BrickletTemperatureIRV2_found = True
except ImportError:
BrickletTemperatureIRV2_found = False
try:
from brickv.bindings.bricklet_thermal_imaging import BrickletThermalImaging
BrickletThermalImaging_found = True
except ImportError:
BrickletThermalImaging_found = False
try:
from brickv.bindings.bricklet_thermocouple import BrickletThermocouple
BrickletThermocouple_found = True
except ImportError:
BrickletThermocouple_found = False
try:
from brickv.bindings.bricklet_thermocouple_v2 import BrickletThermocoupleV2
BrickletThermocoupleV2_found = True
except ImportError:
BrickletThermocoupleV2_found = False
try:
from brickv.bindings.bricklet_tilt import BrickletTilt
BrickletTilt_found = True
except ImportError:
BrickletTilt_found = False
try:
from brickv.bindings.bricklet_uv_light import BrickletUVLight
BrickletUVLight_found = True
except ImportError:
BrickletUVLight_found = False
try:
from brickv.bindings.bricklet_uv_light_v2 import BrickletUVLightV2
BrickletUVLightV2_found = True
except ImportError:
BrickletUVLightV2_found = False
try:
from brickv.bindings.bricklet_voltage import BrickletVoltage
BrickletVoltage_found = True
except ImportError:
BrickletVoltage_found = False
try:
from brickv.bindings.bricklet_voltage_current import BrickletVoltageCurrent
BrickletVoltageCurrent_found = True
except ImportError:
BrickletVoltageCurrent_found = False
try:
from brickv.bindings.bricklet_voltage_current_v2 import BrickletVoltageCurrentV2
BrickletVoltageCurrentV2_found = True
except ImportError:
BrickletVoltageCurrentV2_found = False
else:
# Bricks
try:
from tinkerforge.brick_dc import BrickDC
BrickDC_found = True
except ImportError:
BrickDC_found = False
try:
from tinkerforge.brick_imu import BrickIMU
BrickIMU_found = True
except ImportError:
BrickIMU_found = False
try:
from tinkerforge.brick_imu_v2 import BrickIMUV2
BrickIMUV2_found = True
except ImportError:
BrickIMUV2_found = False
try:
from tinkerforge.brick_master import BrickMaster
BrickMaster_found = True
except ImportError:
BrickMaster_found = False
try:
from tinkerforge.brick_servo import BrickServo
BrickServo_found = True
except ImportError:
BrickServo_found = False
try:
from tinkerforge.brick_silent_stepper import BrickSilentStepper
BrickSilentStepper_found = True
except ImportError:
BrickSilentStepper_found = False
try:
from tinkerforge.brick_stepper import BrickStepper
BrickStepper_found = True
except ImportError:
BrickStepper_found = False
try:
from tinkerforge.brick_hat import BrickHAT
BrickHAT_found = True
except ImportError:
BrickHAT_found = False
try:
from tinkerforge.brick_hat_zero import BrickHATZero
BrickHATZero_found = True
except ImportError:
BrickHATZero_found = False
# Bricklets
try:
from tinkerforge.bricklet_accelerometer import BrickletAccelerometer
BrickletAccelerometer_found = True
except ImportError:
BrickletAccelerometer_found = False
try:
from tinkerforge.bricklet_accelerometer_v2 import BrickletAccelerometerV2
BrickletAccelerometerV2_found = True
except ImportError:
BrickletAccelerometerV2_found = False
try:
from tinkerforge.bricklet_air_quality import BrickletAirQuality
BrickletAirQuality_found = True
except ImportError:
BrickletAirQuality_found = False
try:
from tinkerforge.bricklet_ambient_light import BrickletAmbientLight
BrickletAmbientLight_found = True
except ImportError:
BrickletAmbientLight_found = False
try:
from tinkerforge.bricklet_ambient_light_v2 import BrickletAmbientLightV2
BrickletAmbientLightV2_found = True
except ImportError:
BrickletAmbientLightV2_found = False
try:
from tinkerforge.bricklet_ambient_light_v3 import BrickletAmbientLightV3
BrickletAmbientLightV3_found = True
except ImportError:
BrickletAmbientLightV3_found = False
try:
from tinkerforge.bricklet_analog_in import BrickletAnalogIn
BrickletAnalogIn_found = True
except ImportError:
BrickletAnalogIn_found = False
try:
from tinkerforge.bricklet_analog_in_v2 import BrickletAnalogInV2
BrickletAnalogInV2_found = True
except ImportError:
BrickletAnalogInV2_found = False
try:
from tinkerforge.bricklet_analog_in_v3 import BrickletAnalogInV3
BrickletAnalogInV3_found = True
except ImportError:
BrickletAnalogInV3_found = False
try:
from tinkerforge.bricklet_analog_out_v2 import BrickletAnalogOutV2
BrickletAnalogOutV2_found = True
except ImportError:
BrickletAnalogOutV2_found = False
try:
from tinkerforge.bricklet_analog_out_v3 import BrickletAnalogOutV3
BrickletAnalogOutV3_found = True
except ImportError:
BrickletAnalogOutV3_found = False
try:
from tinkerforge.bricklet_barometer import BrickletBarometer
BrickletBarometer_found = True
except ImportError:
BrickletBarometer_found = False
try:
from tinkerforge.bricklet_barometer_v2 import BrickletBarometerV2
BrickletBarometerV2_found = True
except ImportError:
BrickletBarometerV2_found = False
try:
from tinkerforge.bricklet_can import BrickletCAN #NYI FIXME: has to use frame_read callback to get all data
BrickletCAN_found = True
except ImportError:
BrickletCAN_found = False
try:
from tinkerforge.bricklet_can_v2 import BrickletCANV2 #NYI FIXME: has to use frame_read callback to get all data
BrickletCANV2_found = True
except ImportError:
BrickletCANV2_found = False
try:
from tinkerforge.bricklet_co2 import BrickletCO2
BrickletCO2_found = True
except ImportError:
BrickletCO2_found = False
try:
from tinkerforge.bricklet_co2_v2 import BrickletCO2V2
BrickletCO2V2_found = True
except ImportError:
BrickletCO2V2_found = False
try:
from tinkerforge.bricklet_color import BrickletColor
BrickletColor_found = True
except ImportError:
BrickletColor_found = False
try:
from tinkerforge.bricklet_color_v2 import BrickletColorV2
BrickletColorV2_found = True
except ImportError:
BrickletColorV2_found = False
try:
from tinkerforge.bricklet_compass import BrickletCompass
BrickletCompass_found = True
except ImportError:
BrickletCompass_found = False
try:
from tinkerforge.bricklet_current12 import BrickletCurrent12
BrickletCurrent12_found = True
except ImportError:
BrickletCurrent12_found = False
try:
from tinkerforge.bricklet_current25 import BrickletCurrent25
BrickletCurrent25_found = True
except ImportError:
BrickletCurrent25_found = False
try:
from tinkerforge.bricklet_dc_v2 import BrickletDCV2
BrickletDCV2_found = True
except ImportError:
BrickletDCV2_found = False
try:
from tinkerforge.bricklet_distance_ir import BrickletDistanceIR
BrickletDistanceIR_found = True
except ImportError:
BrickletDistanceIR_found = False
try:
from tinkerforge.bricklet_distance_ir_v2 import BrickletDistanceIRV2
BrickletDistanceIRV2_found = True
except ImportError:
BrickletDistanceIRV2_found = False
try:
from tinkerforge.bricklet_distance_us import BrickletDistanceUS
BrickletDistanceUS_found = True
except ImportError:
BrickletDistanceUS_found = False
try:
from tinkerforge.bricklet_distance_us_v2 import BrickletDistanceUSV2
BrickletDistanceUSV2_found = True
except ImportError:
BrickletDistanceUSV2_found = False
try:
from tinkerforge.bricklet_dmx import BrickletDMX
BrickletDMX_found = True
except ImportError:
BrickletDMX_found = False
try:
from tinkerforge.bricklet_dual_button import BrickletDualButton
BrickletDualButton_found = True
except ImportError:
BrickletDualButton_found = False
try:
from tinkerforge.bricklet_dual_button_v2 import BrickletDualButtonV2
BrickletDualButtonV2_found = True
except ImportError:
BrickletDualButtonV2_found = False
try:
from tinkerforge.bricklet_dual_relay import BrickletDualRelay
BrickletDualRelay_found = True
except ImportError:
BrickletDualRelay_found = False
try:
from tinkerforge.bricklet_dust_detector import BrickletDustDetector
BrickletDustDetector_found = True
except ImportError:
BrickletDustDetector_found = False
try:
from tinkerforge.bricklet_energy_monitor import BrickletEnergyMonitor
BrickletEnergyMonitor_found = True
except ImportError:
BrickletEnergyMonitor_found = False
try:
from tinkerforge.bricklet_gps import BrickletGPS
BrickletGPS_found = True
except ImportError:
BrickletGPS_found = False
try:
from tinkerforge.bricklet_gps_v2 import BrickletGPSV2
BrickletGPSV2_found = True
except ImportError:
BrickletGPSV2_found = False
try:
from tinkerforge.bricklet_gps_v3 import BrickletGPSV3
BrickletGPSV3_found = True
except ImportError:
BrickletGPSV3_found = False
try:
from tinkerforge.bricklet_hall_effect import BrickletHallEffect
BrickletHallEffect_found = True
except ImportError:
BrickletHallEffect_found = False
try:
from tinkerforge.bricklet_hall_effect_v2 import BrickletHallEffectV2
BrickletHallEffectV2_found = True
except ImportError:
BrickletHallEffectV2_found = False
try:
from tinkerforge.bricklet_humidity import BrickletHumidity
BrickletHumidity_found = True
except ImportError:
BrickletHumidity_found = False
try:
from tinkerforge.bricklet_humidity_v2 import BrickletHumidityV2
BrickletHumidityV2_found = True
except ImportError:
BrickletHumidityV2_found = False
try:
from tinkerforge.bindings.bricklet_imu_v3 import BrickletIMUV3
BrickletIMUV3_found = True
except ImportError:
BrickletIMUV3_found = False
try:
from tinkerforge.bricklet_industrial_counter import BrickletIndustrialCounter
BrickletIndustrialCounter_found = True
except ImportError:
BrickletIndustrialCounter_found = False
try:
from tinkerforge.bricklet_industrial_digital_in_4 import BrickletIndustrialDigitalIn4
BrickletIndustrialDigitalIn4_found = True
except ImportError:
BrickletIndustrialDigitalIn4_found = False
try:
from tinkerforge.bricklet_industrial_digital_in_4_v2 import BrickletIndustrialDigitalIn4V2
BrickletIndustrialDigitalIn4V2_found = True
except ImportError:
BrickletIndustrialDigitalIn4V2_found = False
try:
from tinkerforge.bricklet_industrial_dual_0_20ma import BrickletIndustrialDual020mA
BrickletIndustrialDual020mA_found = True
except ImportError:
BrickletIndustrialDual020mA_found = False
try:
from tinkerforge.bricklet_industrial_dual_0_20ma_v2 import BrickletIndustrialDual020mAV2
BrickletIndustrialDual020mAV2_found = True
except ImportError:
BrickletIndustrialDual020mAV2_found = False
try:
from tinkerforge.bricklet_industrial_dual_ac_in import BrickletIndustrialDualACIn
BrickletIndustrialDualACIn_found = True
except ImportError:
BrickletIndustrialDualACIn_found = False
try:
from tinkerforge.bricklet_industrial_dual_ac_relay import BrickletIndustrialDualACRelay
BrickletIndustrialDualACRelay_found = True
except ImportError:
BrickletIndustrialDualACRelay_found = False
try:
from tinkerforge.bricklet_industrial_dual_analog_in import BrickletIndustrialDualAnalogIn
BrickletIndustrialDualAnalogIn_found = True
except ImportError:
BrickletIndustrialDualAnalogIn_found = False
try:
from tinkerforge.bricklet_industrial_dual_analog_in_v2 import BrickletIndustrialDualAnalogInV2
BrickletIndustrialDualAnalogInV2_found = True
except ImportError:
BrickletIndustrialDualAnalogInV2_found = False
try:
from tinkerforge.bricklet_industrial_dual_relay import BrickletIndustrialDualRelay
BrickletIndustrialDualRelay_found = True
except ImportError:
BrickletIndustrialDualRelay_found = False
try:
from tinkerforge.bricklet_industrial_ptc import BrickletIndustrialPTC
BrickletIndustrialPTC_found = True
except ImportError:
BrickletIndustrialPTC_found = False
try:
from tinkerforge.bricklet_industrial_quad_relay import BrickletIndustrialQuadRelay
BrickletIndustrialQuadRelay_found = True
except ImportError:
BrickletIndustrialQuadRelay_found = False
try:
from tinkerforge.bricklet_industrial_quad_relay_v2 import BrickletIndustrialQuadRelayV2
BrickletIndustrialQuadRelayV2_found = True
except ImportError:
BrickletIndustrialQuadRelayV2_found = False
try:
from tinkerforge.bricklet_io16 import BrickletIO16
BrickletIO16_found = True
except ImportError:
BrickletIO16_found = False
try:
from tinkerforge.bricklet_io16_v2 import BrickletIO16V2
BrickletIO16V2_found = True
except ImportError:
BrickletIO16V2_found = False
try:
from tinkerforge.bricklet_io4 import BrickletIO4
BrickletIO4_found = True
except ImportError:
BrickletIO4_found = False
try:
from tinkerforge.bricklet_io4_v2 import BrickletIO4V2