Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

main.py crashes #8

Open
AlexeyBossak opened this issue Dec 31, 2021 · 2 comments
Open

main.py crashes #8

AlexeyBossak opened this issue Dec 31, 2021 · 2 comments

Comments

@AlexeyBossak
Copy link

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
Copy link

Zinki-M commented Jan 8, 2022

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
Copy link
Contributor

Could you please contact us via [email protected] which is more convenient to attached pictures?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants