Freenove / Freenove_Big_Hexapod_Robot_Kit_for_Raspberry_Pi

Apply to FNK0052
Other
120 stars 88 forks source link

main.py crashes #8

Open AlexeyBossak opened 2 years ago

AlexeyBossak commented 2 years ago

Main.py crashes when the robot is controlled remotely. Occurs with Windows, ios, and Android clients. Pressing server off then on and reconnecting the client solves the issue. The crashes seem random and are not related to any particular action of the robot. Error log is provided below. The thread number in the first line changes, the rest of the error report is always the same. Tested with both Buster and Bullseye.

Python version: Python 3.7.3 (default, Jan 22 2021, 20:04:44) [GCC 8.3.0] on linux

Error log: Exception in thread Thread-21: Traceback (most recent call last): File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner self.run() File "/usr/lib/python3.7/threading.py", line 865, in run self._target(*self._args, **self._kwargs) File "/home/pi/Freenove_Big_Hexapod_Robot_Kit_for_Raspberry_Pi/Code/Server/Server.py", line 139, in receive_instruction batteryVoltage=self.adc.batteryPower() File "/home/pi/Freenove_Big_Hexapod_Robot_Kit_for_Raspberry_Pi/Code/Server/ADC.py", line 25, in batteryPower val0 = self.batteryValue(0) File "/home/pi/Freenove_Big_Hexapod_Robot_Kit_for_Raspberry_Pi/Code/Server/ADC.py", line 21, in batteryValue return self.adc.analogRead(chn) File "/home/pi/Freenove_Big_Hexapod_Robot_Kit_for_Raspberry_Pi/Code/Server/ADCDevice.py", line 52, in analogRead value = self.bus.read_byte_data(self.address, self.cmd|(((chn<<2 | chn>>1)&0x07)<<4)) OSError: [Errno 121] Remote I/O error

Thank you Alexey

Zinki-M commented 2 years ago

Can confirm this issue. I have worked around it by wrapping the offending call in ADCDevice in a try block and returning 0 in the except block. This way, instead of crashing the server, it only briefly reports 0V in the battery indicator UI.

DenzelChen commented 2 years ago

Could you please contact us via support@freenove.com which is more convenient to attached pictures?