Jump to content

CAN bus UPDATE script


Dirk

Recommended Posts

On 2/26/2024 at 3:30 PM, Dirk said:

It is not a stupid question. I have only heard a few in my whole life, but... It is a difficult question to answer.

 Found canbus_uuid=403544310df5, Application: Klipper - OCTOPUS PRO 1.01
 Found canbus_uuid=a74fbb9bdf70, Application: Klipper - CARTOGRAPHER v3
 Found canbus_uuid=21c36fa97c26, Application: Klipper - SBB2209 RP2040

 

You use "Cartographer probe v3"
RP2040 and OCTOPUS PRO 1.01 ... all together via CAN, right?

Can You please post here Your CAN Setup?
I mean CAN speed each device for katapult and Klipper
can0 file ?
TRSYNC_TIMEOUT ?
Main MCU, raspberry pi or something bigger?

I ask, because ...
So long I use raspberry pi 4 with OCTOPUS PRO (H723) and Mellow RP2040, I do not have any issues with CAN. Use OCTOPUS as CAN bridge.
But as soon I add Mellow ERCF easy board over CAN, have errors,
Tryed to move to raspberry pi 5 ... the same thing.
Right now I make some tests with "Dell Optiplex 7040 USFF"
looks much better, but I must slow down the CANbus to 500.000
With 1.000.000 I have "Timer Too Close" errors.

In the future will install something like "Cartographer" over CAN too.
Will have all things over CAN but must solve CAN issues before 🙂

 

Link to comment
Share on other sites

1 hour ago, Sergey said:

all together via CAN, right?

yes. The 120 ohm termination is not on my SB2209, but on the cartographer. So it is last in the chain.

1 hour ago, Sergey said:

Can You please post here Your CAN Setup?

All exactly set up like here

1 hour ago, Sergey said:

So long I use raspberry pi 4 with OCTOPUS PRO (H723) and Mellow RP2040, I do not have any issues with CAN. Use OCTOPUS as CAN bridge.
But as soon I add Mellow ERCF easy board over CAN, have errors

if I am not wrong, @mvdveer has a same set up over here and a similar one here. (maybe he used a U2C on his ERCF build). He did not have any timer-too-close- problems if I remember right. 

I do know timer-too-close errors from this description from Esoterical and I am glad I have not ran into them (yet). 

I think the best is to go ask Esoterical on Discord with such unspecific errors as TTC. He has a huge amount of experience, patience and tools.

Good luck.

 

 

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

@Dirk

Maybe im doing something wrong.. and yes, im very certain I am...

Getting an error executing the file, the CMOD executable rights have been applied on the flashCAN.sh file, and confirmed them.

Editted the file in Notepadd++ and only added my UUID and USBID in the right places.

"bad interpreter"

image.thumb.png.7f3e99e7012b3b30e4d31a94fe79609b.png

 

EDIT: Ah, I guess I have to EXECUTE the file.. ok not a Linux guy, but I try to survive.. this is how it was mentioned in the file, but my guess its not correct?

 

EDIT2: IGNORE, somehow the file got corrupted by Notepadd++, never had that before, fixed it by running: 

sed -i -e 's/\r$//' flashCAN.sh

 

  • Like 1
Link to comment
Share on other sites

Another question, I had to put my board in katapult mode to get the USB id, is there any way to get it OUT of this mode again, without powering off the machine?

The command to put it IN katapult mode:

python3 ~/katapult/scripts/flashtool.py -i can0 -u 29186379db86 -r

  • Like 1
Link to comment
Share on other sites

9 minutes ago, Buurman said:

im doing something wrong

I don't know. if you have ran the command

sudo chmod +x flashCAN.sh

succesfully, then it should be okay... 

Was never so sure about things in command line... Back in the time we didnt have google. or wiki. now we do..

https://linuxsimply.com/bash-scripting-tutorial/error-handling-and-debugging/error-handling/bin-bash-m-bad-interpreter/

Apparently your notepad++ added extra dos characters which bash doesnt like.

try this

sudo apt-get install dos2unix

then 

dos2unix flashCAN.sh

This should fix it.

then try running flashCAN.sh again.

Link to comment
Share on other sites

Posted (edited)
17 minutes ago, Buurman said:

any way to get it OUT of this mode again, without powering off the machine?

flashing the board will get it out of katapult mode 🙂

Or you can push the reset button on the board.

let me see if the manual says something...

[edit] no. no code to remove to chip from katapult mode, except reset/reboot it.

Edited by Dirk
  • Thanks 1
Link to comment
Share on other sites

24 minutes ago, Buurman said:

EDIT: Ah, I guess I have to EXECUTE the file.. ok not a Linux guy, but I try to survive.. this is how it was mentioned in the file, but my guess its not correct?

EDIT2: IGNORE, somehow the file got corrupted by Notepadd++, never had that before, fixed it by running: 

haha

yes... the script is executable. apparently the #!/bin/bash at the top of the file and the chmod commands take care of this

you then indeed need to execute it with chdir to the directory its in. and then do a ./flashCAN.sh from ssh

 

I hope the corrupt files is not a regular thing. corrupt sd card? It might explain why your mellow fly is not working anymore.

Link to comment
Share on other sites

Ran it, and stuff still seems to work... 😛 

Ok my webcam stopped working, but guess it needs a reboot - check yes it did...working.

Uncommented the makemenu lines, looking forward to future updates!!! thanks a lot! LEarned a lot again last 2 days.

Still dont know why my other board stopped working, but my best guess is that I loaded a wrong config to it.. it is possible and easy to make a mistake..

You woul just expect the BOOT0 jumper would overrule all, but maybe not.. 

Link to comment
Share on other sites

12 minutes ago, Dirk said:

I hope the corrupt files is not a regular thing. corrupt sd card? It might explain why your mellow fly is not working anymore.

No its a windows thing, opened it ones in a windows edittor maybe over WinSCP, that added hidden characters to the file, Linux doesnt like them.

Nothing to do with the rest of things I made go wrong 😛  thats just me... 

  • Haha 1
Link to comment
Share on other sites

  • Buurman featured this topic
7 minutes ago, Buurman said:

looking forward to future updates!!! thanks a lot! LEarned a lot again last 2 days.

That is cool. If you understand this script a little, you will understand how this CAN flashing goes... And that makes it easier to deal with problems you might encounter...

Because you have the ercf mellow can board, you need to add that to the script in a similar way as the toolhead-pcb.

 

You need to run the script only if a klipper update makes your setup 'dirty'. I understand it does not happen so often. 

 

Further your mellow board... I think it is worth reflashing it with STMLink. You could start making up a drawer with -toolhead-pcb's-for-in-case. 

Link to comment
Share on other sites

18 minutes ago, Buurman said:

Uncommented the makemenu lines,

 

## once you have run through this script, comment out (put a # in front of the line) the line which has the "make menuconfig" in it.

 

You mean, commented them (out) ... so they are not part of the script anymore, right? 😄

And thanks for featuring it 🙂 (didn't know it was possible!) I am glad it has helped you, and will probably in the future. 

 

 

Link to comment
Share on other sites

58 minutes ago, Dirk said:

And thanks for featuring it 🙂 (didn't know it was possible!

Me neither! Lets see what the boss thinks about it, maybe we can keep it there for a while.... 

 

Yeah I put a # in front of it, ok I am not a linux guy, but I know some scripting, I wrote programs on a Atari 800XL in my time... oh crap.. thats about 40 years ago.. ssst..

1 hour ago, Dirk said:

I think it is worth reflashing it with STMLink. You could start making up a drawer with -toolhead-pcb's-for-in-case

Great minds think alike, I already had it hooked up to my PC to try STMLink, see if I can empty it and reflash it.

And I build Vorons 2.4 350's out of a hobby, but yeah.. im over 20 builds now.. so yeah, I need those Toolheads anyhow.. I build them all with Canbus.

Link to comment
Share on other sites

  • 3 weeks later...

Is it possible to turn this into a Macro that can be ran from within the Fluid or Mainsail interfaces? I have the Github update Macro, which I think would be similar. Would be cool if you could paste in the appropriate settings for your board into drop downs for the Macro and then just run it when needed.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...