先日から稼動し始めた店のCO2センサーで使っているモジュールのCCS811だけど、エラーでモジュールの電源入れ直せというメッセージと共に落ちていた。
pi@raspberrypi:~/ccs811 $ sudo systemctl status ccs811.service ● ccs811.service - ccs811 moniter Daemon Loaded: loaded (/home/pi/ccs811/ccs811.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2020-10-21 13:12:40 JST; 4s ago Main PID: 22651 (python3) CGroup: /system.slice/ccs811.service └─22651 /home/pi/ccs811/.env/bin/python3 /home/pi/ccs811/ccs811.py Oct 21 13:12:45 raspberrypi python3[22651]: Traceback (most recent call last): Oct 21 13:12:45 raspberrypi python3[22651]: File "/home/pi/ccs811/ccs811.py", line 79, in Oct 21 13:12:45 raspberrypi python3[22651]: main() Oct 21 13:12:45 raspberrypi python3[22651]: File "/home/pi/ccs811/ccs811.py", line 60, in main Oct 21 13:12:45 raspberrypi python3[22651]: wrapper = CCSWrapper() Oct 21 13:12:45 raspberrypi python3[22651]: File "/home/pi/ccs811/ccs811.py", line 18, in init Oct 21 13:12:45 raspberrypi python3[22651]: self.ccs811 = adafruit_ccs811.CCS811(self.i2c) Oct 21 13:12:45 raspberrypi python3[22651]: File "/home/pi/ccs811/.env/lib/python3.7/site-packages/adafruit_ccs811.py", line 121, in init Oct 21 13:12:45 raspberrypi python3[22651]: "Device returned a error! Try removing and reapplying power to " Oct 21 13:12:45 raspberrypi python3[22651]: RuntimeError: Device returned a error! Try removing and reapplying power to the device and running the code agai
自動でonn/offしようと考えると、データシートみると最大で54 mA(常時観測のモード1だと30 mAなので大抵はこっちで考えてもOKかも)なのでGPIOのoutput直でon/offきりかえは無理。
無人で再起動かけようとするとトランジスタも必要かな。