Bed_Distance_sensor icon indicating copy to clipboard operation
Bed_Distance_sensor copied to clipboard

No data or corrupt data from BDsensor(), Please check connection

Open Townie-au opened this issue 10 months ago • 45 comments

My setup was broken. So i had to reinstall everything. I am having an issue with katapult not being able to access after flashing the ebb42. So I have to flash klipper via stm32 programmer. I connected bdsensor to the ebb42 when flashing klipper after installing bdsensor. Now I get this error all the time. Im using BD Sensor v1. Everything was working including the bd sensor yesterday. klippy (27).log printer.txt

Ive checked continuity on the lead from the sensor to the board. OK Canboard communicating via CAN0. I just tried rolling back klipper to the previous version but no change.

Got katapult and klipper working still no chnage for bd sensor.

Townie-au avatar Apr 17 '24 10:04 Townie-au

Is the bd sensor dead? Please help

Townie-au avatar Apr 18 '24 01:04 Townie-au

you can test BDsensor with the gpio on the Pi. for example: https://github.com/markniu/Bed_Distance_sensor/issues/111#issuecomment-2046685001 connect the bdsensor to the gpio on the PI like gpio17 and gpio27.

[mcu host] serial: /tmp/klipper_host_mcu

[BDsensor] .... scl_pin: host:gpio17 sda_pin: host:gpio27

compile and flash firmware: https://www.klipper3d.org/RPi_microcontroller.html

markniu avatar Apr 18 '24 01:04 markniu

Ok. Got it working somewhat by flashing the beta firmware. M102 s-1 returns nothing M102 s-6 calibrates successfully However when I go to home z I get "Bed Distance Sensor data error:10.24" When I first started klipper up I got "collision_homing in printer.cfg invalid". So I commented out both collison homing lines.

Townie-au avatar Apr 18 '24 01:04 Townie-au

What about this Mark? However when I go to home z I get "Bed Distance Sensor data error:10.24"

Townie-au avatar Apr 18 '24 01:04 Townie-au

if M102 s-1 returns nothing or 10.24 means the same connection problem.

markniu avatar Apr 18 '24 02:04 markniu

did you modify the cable before or just the software?

markniu avatar Apr 18 '24 02:04 markniu

did you modify the cable before or just the software?

Just the software.

Townie-au avatar Apr 18 '24 02:04 Townie-au

for finding out what's the problem hardware or software, I think you can try the gpio on the pi.

markniu avatar Apr 18 '24 02:04 markniu

you can test BDsensor with the gpio on the Pi. for example: #111 (comment) connect the bdsensor to the gpio on the PI like gpio17 and gpio27. [mcu host] serial: /tmp/klipper_host_mcu [BDsensor] .... scl_pin: host:gpio17 sda_pin: host:gpio27 compile and flash firmware: https://www.klipper3d.org/RPi_microcontroller.html

host: Current version v0.12.0-124-g09a78c31 Up-to-date MCU(s):

Once the underlying issue is corrected, use the "RESTART" command to reload the config and restart the host software.

mcu 'host': Unknown command: I2C_BD_send

I connected the BD Sensor to my main board, recompiled and reflashed both EBB and M5P and got the same result. I used probe port PC15 and PC13 on the BTT M5P. Couldnt use RPI. Would have to setup as secondary MCU. :(

Townie-au avatar Apr 18 '24 04:04 Townie-au

how about use the gpio in the EXP1? E.g. PB6 PB7

markniu avatar Apr 18 '24 05:04 markniu

how about use the gpio in the EXP1? E.g. PB6 PB7

Im going to try the RPI.

Townie-au avatar Apr 18 '24 06:04 Townie-au

3.2 40 Pins GPIO When Manta series motherboard work with CB1, 40 pins GPIO is a custom IO arrangement, as shown in the figure below, Pin 7 is CB1's "PC7", and Pin 11 is CB1's "PC14". The GPIO number of CB1 corresponds to (Px–PA)*32 + Pin For example: PC7 = (PC–PA)*32 + 7 = 2 * 32 + 7 = 71 PH10 = (PH–PA)*32 + 10 = 7 * 32 + 10 = 234 PC7 is numbered in Klipper as pin: host: gpio71, PH10 as pin: host: gpio234

WTH. Trying to make sense of this. I am using pin 11 and pin 15.

Townie-au avatar Apr 18 '24 08:04 Townie-au

CB1 GPIO

Townie-au avatar Apr 18 '24 08:04 Townie-au

OMG. Finally worked it out. GPIO78 and GPIO74 Same error on CB1 GPIO.

Townie-au avatar Apr 18 '24 08:04 Townie-au

OMG. Finally worked it out. GPIO78 and GPIO74 Same error on CB1 GPIO.

worked on RPI GPIO?

markniu avatar Apr 18 '24 08:04 markniu

OMG. Finally worked it out. GPIO78 and GPIO74 Same error on CB1 GPIO.

worked on RPI GPIO?

No. Same error. No data or corrupt data from BDsensor(), Please check connection

Townie-au avatar Apr 18 '24 08:04 Townie-au

what's the hardware version of bdsensor?

markniu avatar Apr 18 '24 08:04 markniu

what's the hardware version of bdsensor?

How do I tell?

Townie-au avatar Apr 18 '24 08:04 Townie-au

there is a version text on the sensor on the other side of the white connector, like v1.3 or v1.1

markniu avatar Apr 18 '24 08:04 markniu

v1.1

Townie-au avatar Apr 18 '24 08:04 Townie-au

does the led on the sensor work? it will light on if it detects the metal else off.

markniu avatar Apr 18 '24 08:04 markniu

does the led on the sensor work? it will light on if it detects the metal else off.

Yes led lights up when metal is brought nearby

Townie-au avatar Apr 18 '24 08:04 Townie-au

then from the hardware, we can only to find if the problem is from the dead mcu or the cable. do you have one more cable to replace the old one for the bdsensor?

markniu avatar Apr 18 '24 09:04 markniu

then from the hardware, we can only to find if the problem is from the dead mcu or the cable. do you have one more cable to replace the old one for the bdsensor?

No I dont. I checked the cable with the multimeter.

Townie-au avatar Apr 18 '24 09:04 Townie-au

if you have a solder tool you can try to connect to a serial model, there will be many useful data output from the serial com port.

markniu avatar Apr 18 '24 09:04 markniu

Do I need to open the case for that?

Townie-au avatar Apr 18 '24 09:04 Townie-au

Do I need to open the case for that?

No
image

markniu avatar Apr 18 '24 09:04 markniu

Would a ST LINK work?

Townie-au avatar Apr 18 '24 10:04 Townie-au

Would a ST LINK work?

No, the MCU on the v1.1 is not stm32

markniu avatar Apr 18 '24 10:04 markniu

Would a ST LINK work?

No, the MCU on the v1.1 is not stm32

Would you be able to send me another bd sensor please? Ill get the USB>UART converter and debug this one for you.

Townie-au avatar Apr 18 '24 10:04 Townie-au