-
Notifications
You must be signed in to change notification settings - Fork 22
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
Cannot get two controllers (intelligent and motion) to communicate with each other #2
Comments
Tried to switch can buses around, i.e. can 1 goes to motion controller and can2 - to intelligent controller, but no worky. Curious if anyone else besides the author got it working using this code? |
Which S1 firmware you did test this code against? |
Yes, I can confirm it is working. I suspect that you're can bus timing is off. Make sure you clock it at 1Mbit. |
Oh sorry, that was the very old question. I got it working too awhile ago. |
Hi, how exactly did you solve the problem? Where should I set Can to 1 Mbit? |
@krvcz my issue was related to CAN bus physical connection and not the baud rate, and could be different from your issue. Basically, I was trying to connect it to both intelligent controller and motion controller at the same time with both CAN1 and CAN2 interfaces. Now with the new code, the intelligent controller was eliminated completely, and you have to use CAN1 interface only (by default, unless you change the code to use CAN2 instead). |
Thank you for reply. We stack with this project, so do you have any photos with connectivity ? Can we chat somewhere , for example gmail or Facebook etc. Now i can’t download project, with error „no such or directory in lwip/otp.h „ |
You only need 1 CAN bus is the latest version of the software. Still had it laying around so see pic. I also wrote a micropython version but it's not yet finished, it spins the wheels though. Let me know if interested. |
For wiring:
Thats it. PS. I also removed the termination resistor, not sure if needed, but I was also capturing the signal on the other microcontroller running micropython. |
Thanks a lot ! Soon as possible i will inform you about progress or possible errors . Is there a version with 2 Can buses in the picture? |
Edit: yes, not sure why, but only 1 is actually communicating. Its the purple and grey wires. I think it is the 2 on the right. |
Ok, so before I have connected board with 2 CAN's, so now should i download older program with 2 CAN in code, right ? |
You can have a look at my micropython implementation. It's probably much easier to understand. It's working but not finished. |
"Ok, so before I have connected board with 2 CAN's, so now should i download older program with 2 CAN in code, right ? That version of the code has far less features. And it's actually great to not have to power the main unit. saves battery, so I would say better to have only 1 can. Also in Micropython I first had a passthrough desing but I was running into performance limitations. |
Unfortunately, at the moment I am limited to STM32. I will keep you posted on the progress. |
You can run micropython on STM32 boards, see: https://github.com/micropython/micropython/tree/master/ports/stm32/boards It should also be easy to port to raspberry pi, but then you will need a USB can bus device, or a CAN BUS shield. |
One more question: What should be the boot order with ROS and does the boot order matter? |
I don't know, I was not using ROS. Also, there is no ROS in the firmware you are looking at. |
hmmm... but in source files are ros files with packages . So the Ros files that are in the source folders are not required? |
nope, he is running that on PC running ROS, its not used in the firmware for the STM32 |
Sorry my bad I have't understood you before. Anyway, If I connect everything (wires + connect with ROS server), then the LED should be blue? |
Yes, led blue on control board of Robomaster means it's working. Otherwise it will be red (no controller). Green means lab mode. |
Hi @JohnieBraaf , I saw your comment about micropython version. |
No I was not using ROS. Basically just use CAN functionality on micropython board. It's very simple. If I find the time I will make a generic working example repository. |
Here you see it is working like this. I modified the code when if was studying the firmware to send the wheels forward so I could debug. I don't know about ROS, sorry have not used it. Check your pins, I think you're wiring is different. Do note that the moment that you power it on matters. It has something like a startup procedure. Number of initial messages. |
Thank you a lot for your reply and help. So, I connect the same like you and everything is fine and now i can see blue LED. The only problem is with ROS . Ros server is working , ping stm work as well but robot doesn’t move. I don’ t know where is the problem. |
@krvcz , @Richard-best86 , I have placed a working example here: https://github.com/JohnieBraaf/Robomaster-Micropython |
We are trying to use your code (thanks alot for publishing it), but cannot get both controllers to negotiate. So intelligent controller keep sending CAN Bus packets to motion controller and motion controller's light stays red and never turned to blue.
Can you explain which CAN interface need to be connected to each controller? I.e. is it can1 connected to intelligent controller and can2 - to motion controller? Is it opposite? Thanks!
The text was updated successfully, but these errors were encountered: