bigtreetech / IO2CAN

31 stars 2 forks source link

Errors out when trying to communicate with or flash toolhead #1

Open emersonsc opened 1 year ago

emersonsc commented 1 year ago

Followed the manual, dropped the new file where it needs to be, uncommented the MCP2515 line, put the lines in the can0 file as per the instructions. STILL errors out.

biqu@BTT-CB1:~$ python3 ~/CanBoot/scripts/flash_can.py -i can0 -f ~/klipper/out/klipper.bin -u 45eb2c5e37f3 Sending bootloader jump command... Resetting all bootloader node IDs... Checking for canboot nodes... Detected UUID: 45eb2c5e37f3, Application: CanBoot Attempting to connect to bootloader CanBoot Connected Protocol Version: 1.0.0 Block Size: 64 bytes Application Start: 0x8002000 MCU type: stm32g0b1xx Verifying canbus connection Flashing '/home/biqu/klipper/out/klipper.bin'...

[ERROR:root:Can Read Error Traceback (most recent call last): File "/usr/lib/python3.9/asyncio/streams.py", line 632, in readuntil await self._wait_for_data('readuntil') File "/usr/lib/python3.9/asyncio/streams.py", line 517, in _wait_for_data await self._waiter asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3.9/asyncio/tasks.py", line 492, in wait_for fut.result() asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/home/biqu/CanBoot/scripts/flash_can.py", line 137, in send_command ret = await self.node.readuntil() File "/home/biqu/CanBoot/scripts/flash_can.py", line 287, in readuntil return await asyncio.wait_for(self._reader.readuntil(sep), timeout) File "/usr/lib/python3.9/asyncio/tasks.py", line 494, in wait_for raise exceptions.TimeoutError() from exc asyncio.exceptions.TimeoutError ERROR:root:Can Read Error Traceback (most recent call last): File "/usr/lib/python3.9/asyncio/streams.py", line 632, in readuntil await self._wait_for_data('readuntil') File "/usr/lib/python3.9/asyncio/streams.py", line 517, in _wait_for_data await self._waiter asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3.9/asyncio/tasks.py", line 492, in wait_for fut.result() asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/home/biqu/CanBoot/scripts/flash_can.py", line 137, in send_command ret = await self.node.readuntil() File "/home/biqu/CanBoot/scripts/flash_can.py", line 287, in readuntil return await asyncio.wait_for(self._reader.readuntil(sep), timeout) File "/usr/lib/python3.9/asyncio/tasks.py", line 494, in wait_for raise exceptions.TimeoutError() from exc asyncio.exceptions.TimeoutError ^CTraceback (most recent call last): File "/home/biqu/CanBoot/scripts/flash_can.py", line 630, in main() File "/home/biqu/CanBoot/scripts/flash_can.py", line 609, in main loop.run_until_complete(sock.run(intf, uuid, fpath)) File "/usr/lib/python3.9/asyncio/base_events.py", line 629, in run_until_complete self.run_forever() File "/usr/lib/python3.9/asyncio/base_events.py", line 596, in run_forever self._run_once() File "/usr/lib/python3.9/asyncio/base_events.py", line 1854, in _run_once event_list = self._selector.select(timeout) File "/usr/lib/python3.9/selectors.py", line 469, in select fd_event_list = self._selector.poll(timeout, max_ev) KeyboardInterrupt

emersonsc commented 1 year ago

If i drop the bitrate down to 250000, I can finally flash and connect, how ever klipper throws the following error

b'Got error -1 in can write: (11)Resource temporarily unavailable' b'Got error -1 in can write: (11)Resource temporarily unavailable' b'Got error -1 in can write: (11)Resource temporarily unavailable' b'Got error -1 in can write: (11)Resource temporarily unavailable' b'Got error -1 in can write: (11)Resource temporarily unavailable' b'Got error -1 in can write: (11)Resource temporarily unavailable' b'Got error -1 in can write: (11)Resource temporarily unavailable' b'Got error -1 in can write: (11)Resource temporarily unavailable'

looxonline commented 1 year ago

I've raised it with the engineering team. I have some IO2CAN units on the way and will also be able to jump in when they arrive.

emersonsc commented 1 year ago

UPDATE:

I decided. I did a fresh flash of the OS, put the new file in before even putting it in the CB1. then followed the rest of directions for the IO2CAN. When i input dmesg | grep -i '(can|spi)' i get the results shown on the github.

Then go through the typical install of all the klipper/moonraker/mailsail/klipperscren. once all that was done i put in dmesg | grep -i '(can|spi)' again and got nothing

now going through flashing the firmware to the ebb36 produces the same timeout failure. So even a fresh install doesnt fix the issue.

EDIT:

I have even tried using the canbus firmware bin file provided in the EBB36 gethub, but that too produces communication failures. Further, I tried using the compiled firmware from my machine, but uploading it via STM32Programmer, again with no succsess. It wont even show as UUID at that point. Right now there is NO printer.cfg file thats associated with this device, so its not being "held up" in Klipper itself. Once the attempt to flash the klipper firmware via canbus (after canboot is flashed via USB, conffirmed, and provides a UUID), the EBB36 no longer gives a UUID or can be found until canboot is reflashed.

Hardware is as follows: Manta M4P, CB1 V2.2, IO2CAN hat, EBB36

emersonsc commented 1 year ago

I have a CB1 V2.1 here, tried with that. Same errors.

frutabruta commented 1 year ago

I have a CB1 V2.1 here, tried with that. Same errors.

canboot: (you might know that) If you compile Klipper after installing canboot, you have to set 8kB bootloader offset, otherwise the klipper rewrites canboot.

There has been a recent commit by @EchoHeim called "fix mcp2515" in the CB1 software image sources. But it has not been released as compiled image yet and I don't know if it helps.

looxonline commented 1 year ago

I have a CB1 V2.1 here, tried with that. Same errors.

canboot: (you might know that) If you compile Klipper after installing canboot, you have to set 8kB bootloader offset, otherwise the klipper rewrites canboot.

There has been a recent commit by @EchoHeim called "fix mcp2515" in the CB1 software image sources. But it has not been released as compiled image yet and I don't know if it helps.

That commit just applies the same overlays that have to be manually applied without it. When it is released, there will be no need to apply the overlays released on the IO2CAN github page.

emersonsc commented 1 year ago

During all my troubleshooting, I found the same file was also in the folder circled in the picture. Once I replaced it with the file provided by bigtreetech in this repository, the device would flash and communicate. As of now, the canbus network is up and communicating, but only on a test bench. I can not confirm the IO2CAN Hat performs under "real world" conditions, including using the built in ADXL on the EBB36 for input shaper without errors.

328702555_530650982466828_2721772331331709403_n